Changeset 9564e55
- Timestamp:
- 2010-11-22T13:17:45Z (14 years ago)
- Branches:
- master
- Children:
- bedad20
- Parents:
- 09d4922
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
bitlbee.h
r09d4922 r9564e55 126 126 #define CONF_FILE_DEF ETCDIR "bitlbee.conf" 127 127 128 /* Hack to give a little bit more password security on IRC: If an account has 129 this password set, use /OPER to change it. */ 130 #define PASSWORD_PENDING "\r\rchangeme\r\r" 131 128 132 #include "bee.h" 129 133 #include "irc.h" -
irc_commands.c
r09d4922 r9564e55 401 401 static void irc_cmd_oper( irc_t *irc, char **cmd ) 402 402 { 403 account_t *a; 404 405 /* /OPER can now also be used to enter IM passwords without echoing. 406 It's a hack but the extra password security is worth it. */ 407 for( a = irc->b->accounts; a; a = a->next ) 408 if( strcmp( a->pass, PASSWORD_PENDING ) == 0 ) 409 { 410 set_setstr( &a->set, "password", cmd[2] ); 411 return; 412 } 413 403 414 if( global.conf->oper_pass && 404 415 ( strncmp( global.conf->oper_pass, "md5:", 4 ) == 0 ? -
root_commands.c
r09d4922 r9564e55 394 394 struct prpl *prpl; 395 395 396 MIN_ARGS( 4 ); 396 MIN_ARGS( 3 ); 397 398 if( cmd[4] == NULL ) 399 for( a = irc->b->accounts; a; a = a->next ) 400 if( strcmp( a->pass, PASSWORD_PENDING ) == 0 ) 401 { 402 irc_usermsg( irc, "Enter password for account %s(%s) " 403 "first (use /OPER)", a->prpl->name, a->user ); 404 return; 405 } 397 406 398 407 prpl = find_protocol( cmd[2] ); … … 410 419 "trying to add it twice?", prpl->name, cmd[3] ); 411 420 412 a = account_add( irc->b, prpl, cmd[3], cmd[4] );421 a = account_add( irc->b, prpl, cmd[3], cmd[4] ? cmd[4] : PASSWORD_PENDING ); 413 422 if( cmd[5] ) 414 423 { … … 419 428 420 429 irc_usermsg( irc, "Account successfully added" ); 430 431 if( cmd[4] == NULL ) 432 irc_usermsg( irc, "Now, use /OPER to enter your password for this account" ); 421 433 422 434 return; … … 462 474 for( a = irc->b->accounts; a; a = a->next ) 463 475 if( !a->ic && a->auto_connect ) 464 account_on( irc->b, a ); 476 { 477 if( strcmp( a->pass, PASSWORD_PENDING ) == 0 ) 478 irc_usermsg( irc, "Enter password for account %s(%s) " 479 "first (use /OPER)", a->prpl->name, a->user ); 480 else 481 account_on( irc->b, a ); 482 } 465 483 } 466 484 else … … 520 538 if( a->ic ) 521 539 irc_usermsg( irc, "Account already online" ); 540 else if( strcmp( a->pass, PASSWORD_PENDING ) == 0 ) 541 irc_usermsg( irc, "Enter password for account %s(%s) " 542 "first (use /OPER)", a->prpl->name, a->user ); 522 543 else 523 544 account_on( irc->b, a );
Note: See TracChangeset
for help on using the changeset viewer.