From: Olliver Schinagl Date: Sun, 13 Aug 2023 08:45:56 +0000 (+0200) Subject: main: Warn about unexpected configuration location X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0485cf470b64d3cfcc5a4e62c711789ff316cea8;p=thirdparty%2Ftvheadend.git main: Warn about unexpected configuration location When using the `--fork` flag, and no user or config arguments are supplied, the configuration folder will end up with whatever the default `daemon` user has set, which is often `/sbin` set as the homedir. This is weird, but not 'wrong' per say. Lets warn the user that forking can have an unexpected side effect. Signed-off-by: Olliver Schinagl --- diff --git a/src/main.c b/src/main.c index 3268ded52..306eee595 100644 --- a/src/main.c +++ b/src/main.c @@ -1114,6 +1114,9 @@ main(int argc, char **argv) tvh_signal(SIGPIPE, handle_sigpipe); // will be redundant later tvh_signal(SIGILL, handle_sigill); // see handler.. + if (opt_fork && !opt_user && !opt_config) + tvhwarn(LS_START, "Forking without --user or --config may use unexpected configuration location"); + /* Set privileges */ if((opt_fork && getuid() == 0) || opt_group || opt_user) { const char *homedir;