X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/20baebab2ac3f56f63aa3aa695dae9ca0d69baac..3b6c388d0259994a0de64af5fa4817639c8818e2:/package/busybox/patches/320-httpd_address_binding.patch?ds=sidebyside diff --git a/package/busybox/patches/320-httpd_address_binding.patch b/package/busybox/patches/320-httpd_address_binding.patch index 2c2d517c6..68487b88c 100644 --- a/package/busybox/patches/320-httpd_address_binding.patch +++ b/package/busybox/patches/320-httpd_address_binding.patch @@ -1,33 +1,28 @@ ---- busybox-1.1.0.orig/networking/httpd.c 2006-02-06 16:02:30.000000000 +0100 -+++ busybox-1.1.0/networking/httpd.c 2006-02-06 16:25:34.000000000 +0100 -@@ -109,6 +109,7 @@ +# Copyright (C) 2006 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +diff -ruN busybox-1.2.0-old/networking/httpd.c busybox-1.2.0-new/networking/httpd.c +--- busybox-1.2.0-old/networking/httpd.c 2006-07-01 00:42:02.000000000 +0200 ++++ busybox-1.2.0-new/networking/httpd.c 2006-08-01 10:06:58.000000000 +0200 +@@ -99,6 +99,7 @@ #include #include /* for connect and socket*/ #include /* for sockaddr_in */ -+#include /* for inet_aton */ - #include ++#include #include #include -@@ -201,8 +202,8 @@ - - void bb_show_usage(void) - { -- fprintf(stderr, "Usage: %s [-p ] [-c configFile] [-d/-e ] " -- "[-r realm] [-u user] [-h homedir]\n", bb_applet_name); -+ fprintf(stderr, "Usage: %s [-p ] [-l ] [-c configFile]" -+ "[-d/-e ] [-r realm] [-u user] [-h homedir]\n", bb_applet_name); - exit(1); - } - #endif -@@ -256,6 +257,7 @@ + #include /* for open modes */ +@@ -165,6 +166,7 @@ #endif unsigned port; /* server initial port and for set env REMOTE_PORT */ -+ char *address; /* server initial address */ ++ char *address; union HTTPD_FOUND { const char *found_mime_type; const char *found_moved_temporarily; -@@ -942,7 +944,10 @@ +@@ -868,7 +870,10 @@ /* inet_addr() returns a value that is already in network order */ memset(&lsocket, 0, sizeof(lsocket)); lsocket.sin_family = AF_INET; @@ -36,54 +31,61 @@ + if (config->address != NULL) lsocket.sin_addr.s_addr = ((struct in_addr *) ((gethostbyname(config->address))->h_addr))->s_addr; + else lsocket.sin_addr.s_addr = htons(INADDR_ANY); + } - lsocket.sin_port = htons(config->port) ; - fd = socket(AF_INET, SOCK_STREAM, 0); - if (fd >= 0) { -@@ -1985,7 +1990,7 @@ - #define OPT_INC_3 ENABLE_FEATURE_HTTPD_AUTH_MD5 + lsocket.sin_port = htons(config->port); + fd = bb_xsocket(AF_INET, SOCK_STREAM, 0); + /* tell the OS it's OK to reuse a previous address even though */ +@@ -1899,6 +1904,7 @@ + USE_FEATURE_HTTPD_AUTH_MD5(m_opt_md5,) + USE_FEATURE_HTTPD_SETUID(u_opt_setuid,) + USE_FEATURE_HTTPD_WITHOUT_INETD(p_opt_port,) ++ USE_FEATURE_HTTPD_WITHOUT_INETD(l_opt_addr,) + }; - #ifndef CONFIG_FEATURE_HTTPD_USAGE_FROM_INETD_ONLY -- "p:" -+ "p:l:" - #endif - #ifdef CONFIG_FEATURE_HTTPD_SETUID - "u:" -@@ -1999,7 +2004,8 @@ - #define OPT_REALM (1<<(2+OPT_INC_1+OPT_INC_2)) /* r */ - #define OPT_MD5 (1<<(2+OPT_INC_1+OPT_INC_2+OPT_INC_3)) /* m */ - #define OPT_PORT (1<<(3+OPT_INC_1+OPT_INC_2+OPT_INC_3)) /* p */ --#define OPT_SETUID (1<<(4+OPT_INC_1+OPT_INC_2+OPT_INC_3)) /* u */ -+#define OPT_ADDRESS (1<<(4+OPT_INC_1+OPT_INC_2+OPT_INC_3)) /* l */ -+#define OPT_SETUID (1<<(5+OPT_INC_1+OPT_INC_2+OPT_INC_3)) /* u */ + static const char httpd_opts[]="c:d:h:" +@@ -1906,7 +1912,7 @@ + USE_FEATURE_HTTPD_BASIC_AUTH("r:") + USE_FEATURE_HTTPD_AUTH_MD5("m:") + USE_FEATURE_HTTPD_SETUID("u:") +- USE_FEATURE_HTTPD_WITHOUT_INETD("p:"); ++ USE_FEATURE_HTTPD_WITHOUT_INETD("p:l:"); + #define OPT_CONFIG_FILE (1<port = 80; + config->address = ""; #endif config->ContentLength = -1; -@@ -2052,6 +2060,7 @@ - #endif - #ifndef CONFIG_FEATURE_HTTPD_USAGE_FROM_INETD_ONLY - , &s_port -+ , &s_addr - #endif - #ifdef CONFIG_FEATURE_HTTPD_SETUID - , &s_uid -@@ -2077,6 +2086,8 @@ - #ifndef CONFIG_FEATURE_HTTPD_USAGE_FROM_INETD_ONLY +@@ -1960,6 +1970,7 @@ + USE_FEATURE_HTTPD_AUTH_MD5(, &pass) + USE_FEATURE_HTTPD_SETUID(, &s_uid) + USE_FEATURE_HTTPD_WITHOUT_INETD(, &s_port) ++ USE_FEATURE_HTTPD_WITHOUT_INETD(, &s_addr) + ); + + if(opt & OPT_DECODE_URL) { +@@ -1981,6 +1992,8 @@ + #ifdef CONFIG_FEATURE_HTTPD_WITHOUT_INETD if(opt & OPT_PORT) config->port = bb_xgetlarg(s_port, 10, 1, 0xffff); + if (opt & OPT_ADDRESS)