[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    [PATCH] httpd: allow '-h' to work when daemonized with NOMMU enabled
From:       Ron Yorston <rmy () pobox ! com>
Date:       2020-04-30 19:32:56
Message-ID: 5eab27e8.tjmieh80/qyBFrn3%rmy () pobox ! com
[Download RAW message or body]

Commit d1b75e184 (httpd: permit non-default home directory with NOMMU
enabled) only works when used with the '-f' (foreground) option.

When '-f' isn't specified and NOMMU is enabled bb_daemonize_or_rexec()
is called to daemonize the server.  Since the server process has been
re-execed the previous patch results in the xchdir() not being called.

Fix this by resetting the re_execed variable in this case.

Signed-off-by: Ron Yorston <rmy@pobox.com>
---
 networking/httpd.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/networking/httpd.c b/networking/httpd.c
index c2d226592..abcb9aa2a 100644
--- a/networking/httpd.c
+++ b/networking/httpd.c
@@ -2734,6 +2734,7 @@ int httpd_main(int argc UNUSED_PARAM, char **argv)
 #if !BB_MMU
 	if (!(opt & OPT_FOREGROUND)) {
 		bb_daemonize_or_rexec(0, argv); /* don't change current directory */
+		re_execed = 0; /* pretend we haven't been re-execed... */
 	}
 #endif
 
-- 
2.25.4

_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic