summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2007-02-28 17:58:23 +0000
committerFelix Fietkau <nbd@openwrt.org>2007-02-28 17:58:23 +0000
commitfd854cdd2a8dbba25d1b073549855d25e8b2aed6 (patch)
treeb83be7f06c783e2f5307af3115308e8c1cbe1099 /package
parentfae10ffbd2c31fa2dfc74d69b0fd37283233eecd (diff)
downloadmtk-20170518-fd854cdd2a8dbba25d1b073549855d25e8b2aed6.zip
mtk-20170518-fd854cdd2a8dbba25d1b073549855d25e8b2aed6.tar.gz
mtk-20170518-fd854cdd2a8dbba25d1b073549855d25e8b2aed6.tar.bz2
fix the issue of httpd no longer working when its root directory is replaced
SVN-Revision: 6437
Diffstat (limited to 'package')
-rw-r--r--package/busybox/patches/440-httpd_chdir.patch28
1 files changed, 28 insertions, 0 deletions
diff --git a/package/busybox/patches/440-httpd_chdir.patch b/package/busybox/patches/440-httpd_chdir.patch
new file mode 100644
index 0000000..fcd2689
--- /dev/null
+++ b/package/busybox/patches/440-httpd_chdir.patch
@@ -0,0 +1,28 @@
+diff -ur busybox.old/networking/httpd.c busybox.dev/networking/httpd.c
+--- busybox.old/networking/httpd.c 2007-02-27 23:15:20.611300000 +0100
++++ busybox.dev/networking/httpd.c 2007-02-27 23:18:10.022546112 +0100
+@@ -102,6 +102,7 @@
+ static const char default_path_httpd_conf[] = "/etc";
+ static const char httpd_conf[] = "httpd.conf";
+ static const char home[] = "./";
++static const char *home_httpd = home;
+
+ #define TIMEOUT 60
+
+@@ -1500,6 +1501,8 @@
+ #if ENABLE_FEATURE_HTTPD_BASIC_AUTH
+ int credentials = -1; /* if not required this is Ok */
+ #endif
++
++ xchdir(home_httpd);
+
+ sa.sa_handler = handle_sigalrm;
+ sigemptyset(&sa.sa_mask);
+@@ -1931,7 +1934,6 @@
+ int httpd_main(int argc, char *argv[])
+ {
+ unsigned opt;
+- const char *home_httpd = home;
+ char *url_for_decode;
+ USE_FEATURE_HTTPD_ENCODE_URL_STR(const char *url_for_encode;)
+ const char *s_port;