Changeset aaf92a9 for conf.c


Ignore:
Timestamp:
2007-12-02T23:18:25Z (16 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
08135df, de03374
Parents:
80e9db9
Message:

Imported setuid() patch from Simo Leone <simo@archlinux...> with some
modifications. Also adding some missing g_free()s to conf.c.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • conf.c

    r80e9db9 raaf92a9  
    6363        conf->ping_interval = 180;
    6464        conf->ping_timeout = 300;
     65        conf->user = NULL;
    6566        proxytype = 0;
    6667       
     
    7677        }
    7778       
    78         while( argc > 0 && ( opt = getopt( argc, argv, "i:p:P:nvIDFc:d:hR:" ) ) >= 0 )
     79        while( argc > 0 && ( opt = getopt( argc, argv, "i:p:P:nvIDFc:d:hR:u:" ) ) >= 0 )
    7980        /*     ^^^^ Just to make sure we skip this step from the REHASH handler. */
    8081        {
     
    132133                                "  -D  Daemon mode. (Still EXPERIMENTAL!)\n"
    133134                                "  -F  Forking daemon. (one process per client)\n"
     135                                "  -u  Run daemon as specified user.\n"
    134136                                "  -P  Specify PID-file (not for inetd mode)\n"
    135137                                "  -i  Specify the interface (by IP address) to listen on.\n"
     
    151153                        ipc_master_set_statefile( optarg );
    152154                }
     155                else if( opt == 'u' )
     156                {
     157                        g_free( conf->user );
     158                        conf->user = g_strdup( optarg );
     159                }
    153160        }
    154161       
     
    192199                        else if( g_strcasecmp( ini->key, "daemoninterface" ) == 0 )
    193200                        {
     201                                g_free( conf->iface );
    194202                                conf->iface = g_strdup( ini->value );
    195203                        }
    196204                        else if( g_strcasecmp( ini->key, "daemonport" ) == 0 )
    197205                        {
     206                                g_free( conf->port );
    198207                                conf->port = g_strdup( ini->value );
    199208                        }
     
    209218                        else if( g_strcasecmp( ini->key, "authpassword" ) == 0 )
    210219                        {
     220                                g_free( conf->auth_pass );
    211221                                conf->auth_pass = g_strdup( ini->value );
    212222                        }
    213223                        else if( g_strcasecmp( ini->key, "operpassword" ) == 0 )
    214224                        {
     225                                g_free( conf->oper_pass );
    215226                                conf->oper_pass = g_strdup( ini->value );
    216227                        }
    217228                        else if( g_strcasecmp( ini->key, "hostname" ) == 0 )
    218229                        {
     230                                g_free( conf->hostname );
    219231                                conf->hostname = g_strdup( ini->value );
    220232                        }
     
    281293                                g_free( url );
    282294                        }
     295                        else if( g_strcasecmp( ini->key, "user" ) == 0 )
     296                        {
     297                                g_free( conf->user );
     298                                conf->user = g_strdup( ini->value );
     299                        }
    283300                        else
    284301                        {
Note: See TracChangeset for help on using the changeset viewer.