diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2005-12-26 15:02:47 +0100 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2005-12-26 15:02:47 +0100 |
commit | d25f6fcbe8e291dd858bf734fa85cde176dc8415 (patch) | |
tree | 58fffb8b1dd8cc0a3cf3583c0daf7c10271af871 /irc.c | |
parent | ffea9b950b183dd54952b56703506508b0984d4b (diff) |
Added OperPassword and RunMode = ForkDaemon settings. Oper stuff is
*INSECURE* because users can just do /mode +o to become operator.
Diffstat (limited to 'irc.c')
-rw-r--r-- | irc.c | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -263,7 +263,7 @@ void irc_free(irc_t * irc) } g_free(irc); - if( global.conf->runmode == RUNMODE_INETD ) + if( global.conf->runmode == RUNMODE_INETD || global.conf->runmode == RUNMODE_FORKDAEMON ) g_main_quit( global.loop ); } @@ -421,7 +421,7 @@ int irc_exec( irc_t *irc, char **cmd ) { irc_reply( irc, 461, "%s :Need more parameters", cmd[0] ); } - else if( strcmp( cmd[1], (global.conf)->password ) == 0 ) + else if( strcmp( cmd[1], (global.conf)->auth_pass ) == 0 ) { irc->status = USTATUS_AUTHORIZED; } @@ -500,6 +500,15 @@ int irc_exec( irc_t *irc, char **cmd ) { irc_write( irc, ":%s PONG %s :%s", irc->myhost, irc->myhost, cmd[1]?cmd[1]:irc->myhost ); } + else if( g_strcasecmp( cmd[0], "OPER" ) == 0 ) + { + if( !cmd[2] ) + irc_reply( irc, 461, "%s :Need more parameters", cmd[0] ); + else if( strcmp( cmd[2], global.conf->oper_pass ) == 0 ) + irc_umode_set( irc, irc->nick, "+o" ); + // else + /* FIXME/TODO: Find out which reply to send now. */ + } else if( g_strcasecmp( cmd[0], "MODE" ) == 0 ) { if( !cmd[1] ) |