aboutsummaryrefslogtreecommitdiffstats
path: root/irc_commands.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@google.com>2010-11-22 13:17:45 +0000
committerWilmer van der Gaast <wilmer@google.com>2010-11-22 13:17:45 +0000
commit9564e55a35ebffaad644c13827ec2b795fb21154 (patch)
tree5ede79f1cdfd51d28ada354a7c17fed7b7306880 /irc_commands.c
parent09d4922d3740eb0ad2e42e02ca5d57f03b263eab (diff)
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.
Diffstat (limited to 'irc_commands.c')
-rw-r--r--irc_commands.c11
1 files changed, 11 insertions, 0 deletions
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 :