From: Andre Noll Date: Mon, 26 Jan 2009 13:19:19 +0000 (+0100) Subject: Fix build as root. X-Git-Tag: v0.3.4~73^2 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=cdee646de17fb348f447f994a213ce2e73150521;p=paraslash.git Fix build as root. As noted by Gerrit Renker, when trying to extract help text from ./para_audiod, the build stops when logged in as root because para_audiod refuses to start as root if --user and --group are not given. This patch moves the check for UID==0 after the check for --help and --detailed-help so that the help text may be extracted as root even if no --user and --group options are given. --- diff --git a/audiod.c b/audiod.c index 60d2612c..ffd2382e 100644 --- a/audiod.c +++ b/audiod.c @@ -1126,9 +1126,9 @@ int main(int argc, char *argv[]) valid_fd_012(); audiod_cmdline_parser_ext(argc, argv, &conf, ¶ms); HANDLE_VERSION_FLAG("audiod", conf); - drop_privileges_or_die(conf.user_arg, conf.group_arg); if (conf.help_given || conf.detailed_help_given) print_help_and_die(); + drop_privileges_or_die(conf.user_arg, conf.group_arg); parse_config_or_die(); daemon_set_flag(DF_LOG_TIME); daemon_set_flag(DF_LOG_HOSTNAME);