Changeset ece2cd2
- Timestamp:
- 2006-06-20T21:48:28Z (18 years ago)
- Branches:
- master
- Children:
- 9b46b64
- Parents:
- 2befb95
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
storage_xml.c
r2befb95 rece2cd2 343 343 static storage_status_t xml_save( irc_t *irc, int overwrite ) 344 344 { 345 char path[512], *path2 ;345 char path[512], *path2, md5_buf[33]; 346 346 set_t *set; 347 347 nick_t *nick; 348 348 account_t *acc; 349 int fd; 349 int fd, i; 350 md5_byte_t pass_md5[16]; 351 md5_state_t md5_state; 352 353 if( irc->password == NULL ) 354 { 355 irc_usermsg( irc, "Please register yourself if you want to save your settings." ); 356 return STORAGE_OTHER_ERROR; 357 } 350 358 351 359 g_snprintf( path, sizeof( path ) - 2, "%s%s%s", global.conf->configdir, irc->nick, ".xml" ); … … 361 369 } 362 370 363 if( !xml_printf( fd, "<user nick=\"%s\" password=\"%s\">\n", irc->nick, irc->password ) ) 371 md5_init( &md5_state ); 372 md5_append( &md5_state, (md5_byte_t*) irc->password, strlen( irc->password ) ); 373 md5_finish( &md5_state, pass_md5 ); 374 for( i = 0; i < 16; i ++ ) 375 g_snprintf( md5_buf + i * 2, 3, "%02x", pass_md5[i] ); 376 377 if( !xml_printf( fd, "<user nick=\"%s\" password=\"%s\">\n", irc->nick, md5_buf ) ) 364 378 goto write_error; 365 379
Note: See TracChangeset
for help on using the changeset viewer.