Changes in unix.c [aaf92a9:60c1a4e]
Legend:
- Unmodified
- Added
- Removed
-
unix.c
raaf92a9 r60c1a4e 34 34 #include <sys/time.h> 35 35 #include <sys/wait.h> 36 #include <pwd.h>37 36 38 37 global_t global; /* Against global namespace pollution */ … … 46 45 struct sigaction sig, old; 47 46 47 memset( &global, 0, sizeof( global_t ) ); 48 48 49 log_init(); 49 50 CONF_FILE = g_strdup( CONF_FILE_DEF ); … … 86 87 return( i ); 87 88 88 if( ( global.conf->user && *global.conf->user ) &&89 ( global.conf->runmode == RUNMODE_DAEMON ||90 global.conf->runmode == RUNMODE_FORKDAEMON ) &&91 ( !getuid() || !geteuid() ) )92 {93 struct passwd *pw = NULL;94 pw = getpwnam( global.conf->user );95 if( pw )96 {97 setgid( pw->pw_gid );98 setuid( pw->pw_uid );99 }100 }101 102 89 global.storage = storage_init( global.conf->primary_storage, global.conf->migrate_storage ); 103 if( global.storage == NULL ) 104 { 90 if ( global.storage == NULL) { 105 91 log_message( LOGLVL_ERROR, "Unable to load storage backend '%s'", global.conf->primary_storage ); 106 92 return( 1 ); 107 93 } 94 108 95 109 96 /* Catch some signals to tell the user what's happening before quitting */
Note: See TracChangeset
for help on using the changeset viewer.