commit 3065f08c041aa183200511b6371a883e945f3187 from: Mark Jamsek date: Tue Nov 19 13:35:33 2024 UTC gotwebd: ensure child procs inherit non-default config If a non-default config filepath is specified with -f, it is effectively ignored as child processes always either parse the default config file (/etc/gotwebd.conf) if it exists, or use defaults. Options specified in the config file used by server procs (e.g., chroot, user) are ignored. If -f is used with a non-default config file, pass it to child procs. ok stsp@ commit - 87e823f249effd48cf55c950a1a24cbfa39267c0 commit + 3065f08c041aa183200511b6371a883e945f3187 blob - 80cd0545feee7ce87bd2fdf066a67b5a87c1e0d8 blob + 792b6cd2d9a880c6eda669664af5e7f61c4b8126 --- gotwebd/gotwebd.c +++ gotwebd/gotwebd.c @@ -210,7 +210,7 @@ gotwebd_sighdlr(int sig, short event, void *arg) static int spawn_socket_process(struct gotwebd *env, const char *argv0, int n) { - const char *argv[6]; + const char *argv[8]; int argc = 0; int p[2]; pid_t pid; @@ -238,6 +238,10 @@ spawn_socket_process(struct gotwebd *env, const char * argv[argc++] = argv0; argv[argc++] = "-S"; + if (strcmp(env->gotwebd_conffile, GOTWEBD_CONF) != 0) { + argv[argc++] = "-f"; + argv[argc++] = env->gotwebd_conffile; + } if (env->gotwebd_debug) argv[argc++] = "-d"; if (env->gotwebd_verbose > 0)