aboutsummaryrefslogtreecommitdiffstats
path: root/root_commands.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@google.com>2011-02-01 13:05:58 +0000
committerWilmer van der Gaast <wilmer@google.com>2011-02-01 13:05:58 +0000
commit060d0661ff8c1465f394c307d0f4c2a22964c6b2 (patch)
treed55e43451f55690dc0ef74e4b8e0475c3e731081 /root_commands.c
parent00fd005cd04ce4f68ff2d72de75a313868564f54 (diff)
More password paranoia: Allow omitting the identify/register password as
well (and enter it using /OPER instead). This is a gross hack and indeed still not solid: In irssi one can still use /RAWLOG SAVE to find the OPER line sent to BitlBee (and of course not everyone uses SSL to talk to remote BitlBee servers). This only works within 10-30 minutes after entering the password though.
Diffstat (limited to 'root_commands.c')
-rw-r--r--root_commands.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/root_commands.c b/root_commands.c
index a7b626b8..a05cffb0 100644
--- a/root_commands.c
+++ b/root_commands.c
@@ -113,7 +113,10 @@ static void cmd_identify( irc_t *irc, char **cmd )
return;
}
- if( strncmp( cmd[1], "-no", 3 ) == 0 )
+ if( cmd[1] == NULL )
+ {
+ }
+ else if( strncmp( cmd[1], "-no", 3 ) == 0 )
{
load = FALSE;
password = cmd[2];
@@ -134,7 +137,9 @@ static void cmd_identify( irc_t *irc, char **cmd )
if( password == NULL )
{
- MIN_ARGS( 2 );
+ irc_usermsg( irc, "About to identify, use /OPER to enter the password" );
+ irc->status |= OPER_HACK_IDENTIFY;
+ return;
}
if( load )
@@ -212,6 +217,13 @@ static void cmd_register( irc_t *irc, char **cmd )
irc_usermsg( irc, "This server does not allow registering new accounts" );
return;
}
+
+ if( cmd[1] == NULL )
+ {
+ irc_usermsg( irc, "About to register, use /OPER to enter the password" );
+ irc->status |= OPER_HACK_REGISTER;
+ return;
+ }
switch( storage_save( irc, cmd[1], FALSE ) ) {
case STORAGE_ALREADY_EXISTS:
@@ -1361,12 +1373,12 @@ command_t root_commands[] = {
{ "ft", 0, cmd_transfer, 0 },
{ "group", 1, cmd_group, 0 },
{ "help", 0, cmd_help, 0 },
- { "identify", 1, cmd_identify, 0 },
+ { "identify", 0, cmd_identify, 0 },
{ "info", 1, cmd_info, 0 },
{ "nick", 1, cmd_nick, 0 },
{ "no", 0, cmd_yesno, 0 },
{ "qlist", 0, cmd_qlist, 0 },
- { "register", 1, cmd_register, 0 },
+ { "register", 0, cmd_register, 0 },
{ "remove", 1, cmd_remove, 0 },
{ "rename", 2, cmd_rename, 0 },
{ "save", 0, cmd_save, 0 },