Changeset d25f6fc for conf.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
  • conf.c

    rffea9b9 rd25f6fc  
    5353        conf->runmode = RUNMODE_INETD;
    5454        conf->authmode = AUTHMODE_OPEN;
    55         conf->password = NULL;
     55        conf->auth_pass = NULL;
     56        conf->oper_pass = NULL;
    5657        conf->configdir = g_strdup( CONFIG );
    5758        conf->plugindir = g_strdup( PLUGINDIR );
     
    7172        }
    7273       
    73         while( ( opt = getopt( argc, argv, "i:p:nvIDc:d:h" ) ) >= 0 )
     74        while( ( opt = getopt( argc, argv, "i:p:nvIDFc:d:h" ) ) >= 0 )
    7475        {
    7576                if( opt == 'i' )
     
    9495                else if( opt == 'D' )
    9596                        conf->runmode=RUNMODE_DAEMON;
     97                else if( opt == 'F' )
     98                        conf->runmode=RUNMODE_FORKDAEMON;
    9699                else if( opt == 'c' )
    97100                {
     
    118121                                "  -I  Classic/InetD mode. (Default)\n"
    119122                                "  -D  Daemon mode. (Still EXPERIMENTAL!)\n"
     123                                "  -F  Forking daemon. (one process per client)\n"
    120124                                "  -i  Specify the interface (by IP address) to listen on.\n"
    121125                                "      (Default: 0.0.0.0 (any interface))\n"
     
    157161                                if( g_strcasecmp( ini->value, "daemon" ) == 0 )
    158162                                        conf->runmode = RUNMODE_DAEMON;
     163                                else if( g_strcasecmp( ini->value, "forkdaemon" ) == 0 )
     164                                        conf->runmode = RUNMODE_FORKDAEMON;
    159165                                else
    160166                                        conf->runmode = RUNMODE_INETD;
     
    184190                        else if( g_strcasecmp( ini->key, "authpassword" ) == 0 )
    185191                        {
    186                                 conf->password = g_strdup( ini->value );
     192                                conf->auth_pass = g_strdup( ini->value );
     193                        }
     194                        else if( g_strcasecmp( ini->key, "operpassword" ) == 0 )
     195                        {
     196                                conf->oper_pass = g_strdup( ini->value );
    187197                        }
    188198                        else if( g_strcasecmp( ini->key, "hostname" ) == 0 )
Note: See TracChangeset for help on using the changeset viewer.