From 0485cf470b64d3cfcc5a4e62c711789ff316cea8 Mon Sep 17 00:00:00 2001 From: Olliver Schinagl Date: Sun, 13 Aug 2023 10:45:56 +0200 Subject: [PATCH] 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 --- src/main.c | 3 +++ 1 file changed, 3 insertions(+) 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; -- 2.47.2