From 9564e55a35ebffaad644c13827ec2b795fb21154 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Mon, 22 Nov 2010 13:17:45 +0000 Subject: Allow omitting the password argument to "account add", to then separately enter the password using the /OPER command (which will not echo to the screen and/or logs). It's a fairly ugly hack but the improved password security is worth it IMHO. --- irc_commands.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'irc_commands.c') diff --git a/irc_commands.c b/irc_commands.c index d9ff929f..3b561d00 100644 --- a/irc_commands.c +++ b/irc_commands.c @@ -400,6 +400,17 @@ static void irc_cmd_nickserv( irc_t *irc, char **cmd ) static void irc_cmd_oper( irc_t *irc, char **cmd ) { + account_t *a; + + /* /OPER can now also be used to enter IM passwords without echoing. + It's a hack but the extra password security is worth it. */ + for( a = irc->b->accounts; a; a = a->next ) + if( strcmp( a->pass, PASSWORD_PENDING ) == 0 ) + { + set_setstr( &a->set, "password", cmd[2] ); + return; + } + if( global.conf->oper_pass && ( strncmp( global.conf->oper_pass, "md5:", 4 ) == 0 ? md5_verify_password( cmd[2], global.conf->oper_pass + 4 ) == 0 : -- cgit v1.2.3