Due to a limit imposed by FEATURE_FORCE_APPLETS, execv is not allowed.
The execv call is required to execute CGI binaries, so it makes
FEATURE_HTTPD_CGI depend on FEATURE_FORCE_APPLET being disabled.

The execv call was changed to BB_EXECV, mostly for keeping the
codebase consistent, as all applets now use BB_EXECxx calls.

Signed-off-by: Nadav Tasher <[email protected]>
---
 networking/httpd.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/networking/httpd.c b/networking/httpd.c
index ddcb03bca..e8eb4e28e 100644
--- a/networking/httpd.c
+++ b/networking/httpd.c
@@ -154,7 +154,7 @@
 //config:config FEATURE_HTTPD_CGI
 //config:      bool "Support Common Gateway Interface (CGI)"
 //config:      default y
-//config:      depends on HTTPD
+//config:      depends on HTTPD && !FEATURE_FORCE_APPLETS
 //config:      help
 //config:      This option allows scripts and executables to be invoked
 //config:      when specific URLs are requested.
@@ -1705,8 +1705,10 @@ static void send_cgi_and_exit(
 
                /* _NOT_ execvp. We do not search PATH. argv[0] is a filename
                 * without any dir components and will only match a file
-                * in the current directory */
-               execv(argv[0], argv);
+                * in the current directory.
+                * This will not work with FEATURE_FORCE_APPLETS, which is why
+                * this feature depends on it being disabled. */
+               BB_EXECV(argv[0], argv);
                if (verbose)
                        bb_perror_msg("can't execute '%s'", argv[0]);
  error_execing_cgi:
-- 
2.43.0

_______________________________________________
busybox mailing list
[email protected]
https://lists.busybox.net/mailman/listinfo/busybox

Reply via email to