Changeset d25f6fc for irc.c


Ignore:
Timestamp:
2005-12-26T14:02:47Z (18 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
238f828
Parents:
ffea9b9
Message:

Added OperPassword and RunMode = ForkDaemon settings. Oper stuff is
*INSECURE* because users can just do /mode +o to become operator.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • irc.c

    rffea9b9 rd25f6fc  
    264264        g_free(irc);
    265265       
    266         if( global.conf->runmode == RUNMODE_INETD )
     266        if( global.conf->runmode == RUNMODE_INETD || global.conf->runmode == RUNMODE_FORKDAEMON )
    267267                g_main_quit( global.loop );
    268268}
     
    422422                                irc_reply( irc, 461, "%s :Need more parameters", cmd[0] );
    423423                        }
    424                         else if( strcmp( cmd[1], (global.conf)->password ) == 0 )
     424                        else if( strcmp( cmd[1], (global.conf)->auth_pass ) == 0 )
    425425                        {
    426426                                irc->status = USTATUS_AUTHORIZED;
     
    500500        {
    501501                irc_write( irc, ":%s PONG %s :%s", irc->myhost, irc->myhost, cmd[1]?cmd[1]:irc->myhost );
     502        }
     503        else if( g_strcasecmp( cmd[0], "OPER" ) == 0 )
     504        {
     505                if( !cmd[2] )
     506                        irc_reply( irc, 461, "%s :Need more parameters", cmd[0] );
     507                else if( strcmp( cmd[2], global.conf->oper_pass ) == 0 )
     508                        irc_umode_set( irc, irc->nick, "+o" );
     509                // else
     510                        /* FIXME/TODO: Find out which reply to send now. */
    502511        }
    503512        else if( g_strcasecmp( cmd[0], "MODE" ) == 0 )
Note: See TracChangeset for help on using the changeset viewer.