Changes in conf.c [4bfca70:f4a5940]
Legend:
- Unmodified
- Added
- Removed
-
conf.c
r4bfca70 rf4a5940 46 46 conf = g_new0( conf_t, 1 ); 47 47 48 #ifdef IPV6 49 conf->iface = "::"; 50 #else 48 51 conf->iface = "0.0.0.0"; 52 #endif 49 53 conf->port = 6667; 50 54 conf->nofork = 0; … … 53 57 conf->runmode = RUNMODE_INETD; 54 58 conf->authmode = AUTHMODE_OPEN; 55 conf->password = NULL; 59 conf->auth_pass = NULL; 60 conf->oper_pass = NULL; 56 61 conf->configdir = g_strdup( CONFIG ); 57 62 conf->plugindir = g_strdup( PLUGINDIR ); … … 59 64 conf->ping_interval = 180; 60 65 conf->ping_timeout = 300; 66 proxytype = 0; 61 67 62 68 i = conf_loadini( conf, CONF_FILE ); … … 71 77 } 72 78 73 while( ( opt = getopt( argc, argv, "i:p:nvIDc:d:h" ) ) >= 0 ) 79 while( argc > 0 && ( opt = getopt( argc, argv, "i:p:nvIDFc:d:h" ) ) >= 0 ) 80 /* ^^^^ Just to make sure we skip this step from the REHASH handler. */ 74 81 { 75 82 if( opt == 'i' ) … … 87 94 } 88 95 else if( opt == 'n' ) 89 conf->nofork =1;96 conf->nofork = 1; 90 97 else if( opt == 'v' ) 91 conf->verbose =1;98 conf->verbose = 1; 92 99 else if( opt == 'I' ) 93 conf->runmode =RUNMODE_INETD;100 conf->runmode = RUNMODE_INETD; 94 101 else if( opt == 'D' ) 95 conf->runmode=RUNMODE_DAEMON; 102 conf->runmode = RUNMODE_DAEMON; 103 else if( opt == 'F' ) 104 conf->runmode = RUNMODE_FORKDAEMON; 96 105 else if( opt == 'c' ) 97 106 { … … 101 110 CONF_FILE = g_strdup( optarg ); 102 111 g_free( conf ); 112 /* Re-evaluate arguments. Don't use this option twice, 113 you'll end up in an infinite loop! Hope this trick 114 works with all libcs BTW.. */ 115 optind = 1; 103 116 return( conf_load( argc, argv ) ); 104 117 } … … 118 131 " -I Classic/InetD mode. (Default)\n" 119 132 " -D Daemon mode. (Still EXPERIMENTAL!)\n" 133 " -F Forking daemon. (one process per client)\n" 120 134 " -i Specify the interface (by IP address) to listen on.\n" 121 135 " (Default: 0.0.0.0 (any interface))\n" … … 157 171 if( g_strcasecmp( ini->value, "daemon" ) == 0 ) 158 172 conf->runmode = RUNMODE_DAEMON; 173 else if( g_strcasecmp( ini->value, "forkdaemon" ) == 0 ) 174 conf->runmode = RUNMODE_FORKDAEMON; 159 175 else 160 176 conf->runmode = RUNMODE_INETD; … … 184 200 else if( g_strcasecmp( ini->key, "authpassword" ) == 0 ) 185 201 { 186 conf->password = g_strdup( ini->value ); 202 conf->auth_pass = g_strdup( ini->value ); 203 } 204 else if( g_strcasecmp( ini->key, "operpassword" ) == 0 ) 205 { 206 conf->oper_pass = g_strdup( ini->value ); 187 207 } 188 208 else if( g_strcasecmp( ini->key, "hostname" ) == 0 )
Note: See TracChangeset
for help on using the changeset viewer.