summaryrefslogtreecommitdiff
path: root/openwrt/package/busybox/patches/320-httpd_address_binding.patch
diff options
context:
space:
mode:
Diffstat (limited to 'openwrt/package/busybox/patches/320-httpd_address_binding.patch')
-rw-r--r--openwrt/package/busybox/patches/320-httpd_address_binding.patch87
1 files changed, 47 insertions, 40 deletions
diff --git a/openwrt/package/busybox/patches/320-httpd_address_binding.patch b/openwrt/package/busybox/patches/320-httpd_address_binding.patch
index 2c2d517c60..288900b91f 100644
--- a/openwrt/package/busybox/patches/320-httpd_address_binding.patch
+++ b/openwrt/package/busybox/patches/320-httpd_address_binding.patch
@@ -1,14 +1,14 @@
---- 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 @@
+--- busybox-1.1.1/networking/httpd.c 2006-03-22 22:16:19.000000000 +0100
++++ busybox-1.1.1.new/networking/httpd.c 2006-04-01 19:41:42.150744624 +0200
+@@ -110,6 +110,7 @@
#include <sys/types.h>
#include <sys/socket.h> /* for connect and socket*/
#include <netinet/in.h> /* for sockaddr_in */
-+#include <arpa/inet.h> /* for inet_aton */
++#include <arpa/inet.h>
#include <sys/time.h>
#include <sys/stat.h>
#include <sys/wait.h>
-@@ -201,8 +202,8 @@
+@@ -204,8 +205,8 @@
void bb_show_usage(void)
{
@@ -19,15 +19,15 @@
exit(1);
}
#endif
-@@ -256,6 +257,7 @@
+@@ -255,6 +256,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 @@
+@@ -958,7 +960,10 @@
/* inet_addr() returns a value that is already in network order */
memset(&lsocket, 0, sizeof(lsocket));
lsocket.sin_family = AF_INET;
@@ -39,34 +39,41 @@
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
+@@ -1996,6 +2001,7 @@
+ USE_FEATURE_HTTPD_AUTH_MD5(m_opt_md5,)
+ USE_FEATURE_HTTPD_SETUID(u_opt_setuid,)
+ SKIP_FEATURE_HTTPD_USAGE_FROM_INETD_ONLY(p_opt_port,)
++ SKIP_FEATURE_HTTPD_USAGE_FROM_INETD_ONLY(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:"
+@@ -2003,7 +2009,7 @@
+ USE_FEATURE_HTTPD_BASIC_AUTH("r:")
+ USE_FEATURE_HTTPD_AUTH_MD5("m:")
+ USE_FEATURE_HTTPD_SETUID("u:")
+- SKIP_FEATURE_HTTPD_USAGE_FROM_INETD_ONLY("p:");
++ SKIP_FEATURE_HTTPD_USAGE_FROM_INETD_ONLY("p:l:");
+ #define OPT_CONFIG_FILE (1<<c_opt_config_file)
+ #define OPT_DECODE_URL (1<<d_opt_decode_url)
+@@ -2024,6 +2030,8 @@
+ #define OPT_PORT SKIP_FEATURE_HTTPD_USAGE_FROM_INETD_ONLY((1<<p_opt_port)) \
+ USE_FEATURE_HTTPD_USAGE_FROM_INETD_ONLY(0)
+
++#define OPT_ADDRESS SKIP_FEATURE_HTTPD_USAGE_FROM_INETD_ONLY((1<<l_opt_addr)) \
++ USE_FEATURE_HTTPD_USAGE_FROM_INETD_ONLY(0)
#ifdef HTTPD_STANDALONE
-@@ -2016,6 +2022,7 @@
- #endif
- #ifndef CONFIG_FEATURE_HTTPD_USAGE_FROM_INETD_ONLY
- const char *s_port;
-+ const char *s_addr;
- int server;
- #endif
+ int main(int argc, char *argv[])
+@@ -2036,6 +2044,7 @@
+ char *url_for_decode;
+ USE_FEATURE_HTTPD_ENCODE_URL_STR(const char *url_for_encode;)
+ SKIP_FEATURE_HTTPD_USAGE_FROM_INETD_ONLY(const char *s_port;)
++ SKIP_FEATURE_HTTPD_USAGE_FROM_INETD_ONLY(const char *s_addr;)
+ SKIP_FEATURE_HTTPD_USAGE_FROM_INETD_ONLY(int server;)
-@@ -2035,6 +2042,7 @@
+ USE_FEATURE_HTTPD_SETUID(const char *s_uid;)
+@@ -2050,6 +2059,7 @@
#ifndef CONFIG_FEATURE_HTTPD_USAGE_FROM_INETD_ONLY
config->port = 80;
@@ -74,15 +81,15 @@
#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 @@
+@@ -2061,6 +2071,7 @@
+ USE_FEATURE_HTTPD_AUTH_MD5(, &pass)
+ USE_FEATURE_HTTPD_SETUID(, &s_uid)
+ SKIP_FEATURE_HTTPD_USAGE_FROM_INETD_ONLY(, &s_port)
++ SKIP_FEATURE_HTTPD_USAGE_FROM_INETD_ONLY(, &s_addr)
+ );
+
+ if(opt & OPT_DECODE_URL) {
+@@ -2082,6 +2093,8 @@
#ifndef CONFIG_FEATURE_HTTPD_USAGE_FROM_INETD_ONLY
if(opt & OPT_PORT)
config->port = bb_xgetlarg(s_port, 10, 1, 0xffff);