From cdee646de17fb348f447f994a213ce2e73150521 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Mon, 26 Jan 2009 14:19:19 +0100 Subject: [PATCH] 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. --- audiod.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.39.2