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