]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
Fix build as root.
authorAndre Noll <maan@systemlinux.org>
Mon, 26 Jan 2009 13:19:19 +0000 (14:19 +0100)
committerAndre Noll <maan@systemlinux.org>
Mon, 26 Jan 2009 13:19:19 +0000 (14:19 +0100)
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

index 60d2612c1059595a31842aa2a28876b6155341cf..ffd2382e9580996a2dd15c43fbbe460a0ea177ca 100644 (file)
--- 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, &params);
        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);