Vodz, last_patch_86
This commit is contained in:
@@ -58,6 +58,7 @@ config CONFIG_FEATURE_HTTPD_BASIC_AUTH
|
||||
authentication on a per url basis.
|
||||
|
||||
|
||||
if !CONFIG_FEATURE_HTTPD_USAGE_FROM_INETD_ONLY
|
||||
config CONFIG_FEATURE_HTTPD_RELOAD_CONFIG_SIGHUP
|
||||
bool " Enable support reload global config file after hup signaled"
|
||||
default n
|
||||
@@ -75,6 +76,7 @@ config CONFIG_FEATURE_HTTPD_SETUID
|
||||
rather than defaulting to the user that starts the server.
|
||||
Use of this option requires special privilegies to change to a
|
||||
different user.
|
||||
endif
|
||||
|
||||
config CONFIG_FEATURE_HTTPD_CONFIG_WITH_MIME_TYPES
|
||||
bool " Enable support load from config file mime types"
|
||||
@@ -91,6 +93,7 @@ config CONFIG_FEATURE_HTTPD_CGI
|
||||
help
|
||||
This option allows scripts and executables to be invoked
|
||||
when specific urls are requested.
|
||||
|
||||
config CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV
|
||||
bool " Enable support set eviroment REMOTE_PORT variable for CGI"
|
||||
default n
|
||||
@@ -111,15 +114,6 @@ config CONFIG_FEATURE_HTTPD_SET_CGI_VARS_TO_ENV
|
||||
to 'bar'. In addition, this option sets a variable that
|
||||
lists all the argument names. e.g. CGI_VARNAMES_="name1 name2".
|
||||
|
||||
config CONFIG_FEATURE_HTTPD_DECODE_URL_STR
|
||||
bool " Enable the -d option for shell script CGI simplification"
|
||||
default y
|
||||
depends on CONFIG_HTTPD
|
||||
help
|
||||
After set, this option enables support for decoding of
|
||||
url-encoded form arguments via the -d option. Output goes to
|
||||
stdout. For example, httpd -d "Hello%20World" produces "Hello World".
|
||||
|
||||
config CONFIG_FEATURE_HTTPD_ENCODE_URL_STR
|
||||
bool " Enable the -e option for shell script CGI simplification."
|
||||
default y
|
||||
@@ -474,7 +468,7 @@ config CONFIG_FEATURE_TFTP_BLOCKSIZE
|
||||
|
||||
config CONFIG_FEATURE_TFTP_DEBUG
|
||||
bool " Enable debug"
|
||||
default y
|
||||
default n
|
||||
depends on CONFIG_TFTP
|
||||
help
|
||||
Please submit a patch to add help text for this item.
|
||||
@@ -487,14 +481,14 @@ config CONFIG_TRACEROUTE
|
||||
|
||||
config CONFIG_FEATURE_TRACEROUTE_VERBOSE
|
||||
bool " Enable verbose output"
|
||||
default y
|
||||
default n
|
||||
depends on CONFIG_TRACEROUTE
|
||||
help
|
||||
Please submit a patch to add help text for this item.
|
||||
|
||||
config CONFIG_FEATURE_TRACEROUTE_SO_DEBUG
|
||||
bool " Enable SO_DEBUG option"
|
||||
default y
|
||||
default n
|
||||
depends on CONFIG_TRACEROUTE
|
||||
help
|
||||
Please submit a patch to add help text for this item.
|
||||
|
||||
@@ -60,8 +60,7 @@
|
||||
* .au:audio/basic # additional mime type for audio.au files
|
||||
*
|
||||
* A/D may be as a/d or allow/deny - first char case unsensitive
|
||||
* Deny IP rules take precedence over allow rules. Any IP rules after D:* are
|
||||
* ignored.
|
||||
* Deny IP rules take precedence over allow rules.
|
||||
*
|
||||
*
|
||||
* The Deny/Allow IP logic:
|
||||
@@ -123,7 +122,7 @@
|
||||
#include "busybox.h"
|
||||
|
||||
|
||||
static const char httpdVersion[] = "busybox httpd/1.26 18-May-2003";
|
||||
static const char httpdVersion[] = "busybox httpd/1.27 25-May-2003";
|
||||
static const char default_path_httpd_conf[] = "/etc";
|
||||
static const char httpd_conf[] = "httpd.conf";
|
||||
static const char home[] = "./";
|
||||
@@ -234,6 +233,7 @@ typedef struct
|
||||
time_t last_mod;
|
||||
|
||||
Htaccess *ip_a_d; /* config allow/deny lines */
|
||||
int flg_deny_all;
|
||||
#ifdef CONFIG_FEATURE_HTTPD_BASIC_AUTH
|
||||
Htaccess *auth; /* config user:password lines */
|
||||
#endif
|
||||
@@ -452,16 +452,21 @@ static void parse_conf(const char *path, int flag)
|
||||
/* test for empty or strange line */
|
||||
if (c == NULL || *c == 0)
|
||||
continue;
|
||||
if(*c == '*')
|
||||
*c = 0; /* Allow all */
|
||||
p0 = buf;
|
||||
if((*p0 == 'i') || (*p0 == 'I'))
|
||||
*p0 = 'A'; // version 1.1/1.2 compatibility for ip:
|
||||
if(*p0 == 'a')
|
||||
*p0 = 'A';
|
||||
if(*p0 == 'd')
|
||||
*p0 = 'D';
|
||||
if(*p0 != 'A' && *p0 != 'D'
|
||||
if(*c == '*') {
|
||||
if(*p0 == 'D') {
|
||||
/* memorize deny all */
|
||||
config->flg_deny_all++;
|
||||
}
|
||||
/* skip default other "word:*" config lines */
|
||||
continue;
|
||||
}
|
||||
|
||||
if(*p0 == 'a')
|
||||
*p0 = 'A';
|
||||
else if(*p0 != 'D'
|
||||
#ifdef CONFIG_FEATURE_HTTPD_BASIC_AUTH
|
||||
&& *p0 != '/'
|
||||
#endif
|
||||
@@ -471,17 +476,8 @@ static void parse_conf(const char *path, int flag)
|
||||
)
|
||||
continue;
|
||||
|
||||
if(*p0 == 'A' && *c == 0) {
|
||||
/* skip default A:* */
|
||||
continue;
|
||||
}
|
||||
p0 = buf;
|
||||
#ifdef CONFIG_FEATURE_HTTPD_BASIC_AUTH
|
||||
if(*p0 == '/') {
|
||||
if(*c == 0) {
|
||||
/* skip /path:* */
|
||||
continue;
|
||||
}
|
||||
/* make full path from httpd root / curent_path / config_line_path */
|
||||
cf = flag == SUBDIR_PARSE ? path : "";
|
||||
p0 = malloc(strlen(cf) + (c - buf) + 2 + strlen(c));
|
||||
@@ -532,12 +528,12 @@ static void parse_conf(const char *path, int flag)
|
||||
free(p0);
|
||||
#endif
|
||||
if(*cf == 'A' || *cf == 'D') {
|
||||
if(*cf == 'D' && *c) {
|
||||
if(*cf == 'D') {
|
||||
/* Deny:form_IP move top */
|
||||
cur->next = config->ip_a_d;
|
||||
config->ip_a_d = cur;
|
||||
} else {
|
||||
/* add to bottom current IP config line */
|
||||
/* add to bottom A:form_IP config line */
|
||||
Htaccess *prev_IP = config->ip_a_d;
|
||||
|
||||
if(prev_IP == NULL) {
|
||||
@@ -573,12 +569,11 @@ static void parse_conf(const char *path, int flag)
|
||||
cur->next = hti;
|
||||
if(prev_hti != hti) {
|
||||
prev_hti->next = cur;
|
||||
break;
|
||||
} else {
|
||||
/* insert as top */
|
||||
config->auth = cur;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if(prev_hti != hti)
|
||||
prev_hti = prev_hti->next;
|
||||
@@ -695,18 +690,16 @@ static void addEnv(const char *name_before_underline,
|
||||
const char *name_after_underline, const char *value)
|
||||
{
|
||||
char *s;
|
||||
const char *underline;
|
||||
|
||||
if (config->envCount >= ENVSIZE)
|
||||
return;
|
||||
if (!value)
|
||||
value = "";
|
||||
s = malloc(strlen(name_before_underline) + strlen(name_after_underline) +
|
||||
strlen(value) + 3);
|
||||
if (s) {
|
||||
const char *underline = *name_after_underline ? "_" : "";
|
||||
|
||||
sprintf(s,"%s%s%s=%s", name_before_underline, underline,
|
||||
underline = *name_after_underline ? "_" : "";
|
||||
asprintf(&s, "%s%s%s=%s", name_before_underline, underline,
|
||||
name_after_underline, value);
|
||||
if(s) {
|
||||
config->envp[config->envCount++] = s;
|
||||
config->envp[config->envCount] = 0;
|
||||
}
|
||||
@@ -764,11 +757,11 @@ static void addEnvCgi(const char *pargs)
|
||||
*args++ = 0;
|
||||
addEnv("CGI", name, decodeString(value, 1));
|
||||
if (*namelist) strcat(namelist, " ");
|
||||
strcat(namelist,name);
|
||||
strcat(namelist, name);
|
||||
}
|
||||
free(memargs);
|
||||
if (namelist) {
|
||||
addEnv("CGI","ARGLIST_",namelist);
|
||||
addEnv("CGI", "ARGLIST_", namelist);
|
||||
free(namelist);
|
||||
}
|
||||
}
|
||||
@@ -1337,6 +1330,8 @@ static int checkPerm(const char *path, const char *request)
|
||||
}
|
||||
} /* for */
|
||||
|
||||
if(ipaddr)
|
||||
return config->flg_deny_all;
|
||||
return prev == NULL;
|
||||
}
|
||||
|
||||
@@ -1359,7 +1354,7 @@ static int checkPermIP(const char *request)
|
||||
}
|
||||
|
||||
/* if uncofigured, return 1 - access from all */
|
||||
return 1;
|
||||
return config->flg_deny_all;
|
||||
}
|
||||
#define checkPerm(null, request) checkPermIP(request)
|
||||
#endif /* CONFIG_FEATURE_HTTPD_BASIC_AUTH */
|
||||
@@ -1788,9 +1783,7 @@ int httpd_main(int argc, char *argv[])
|
||||
config->debugHttpd = 1;
|
||||
break;
|
||||
case 'p':
|
||||
config->port = atoi(optarg);
|
||||
if(config->port <= 0 || config->port > 0xffff)
|
||||
bb_error_msg_and_die("invalid %s for -p", optarg);
|
||||
config->port = bb_xgetlarg(optarg, 10, 1, 0xffff);
|
||||
break;
|
||||
#endif
|
||||
case 'd':
|
||||
@@ -1854,10 +1847,11 @@ int httpd_main(int argc, char *argv[])
|
||||
#ifdef TEST
|
||||
if (numTestArgs)
|
||||
{
|
||||
if (strcmp(testArgs[0],"ip") == 0) testArgs[0] = 0;
|
||||
int result;
|
||||
if (strcmp(testArgs[0], "ip") == 0) testArgs[0] = 0;
|
||||
if (numTestArgs > 2)
|
||||
parse_conf(testArgs[2], SUBDIR_PARSE);
|
||||
int result = printf("%d\n",checkPerm(testArgs[0],testArgs[1]));
|
||||
result = printf("%d\n", checkPerm(testArgs[0], testArgs[1]));
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
* Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* $Id: ifconfig.c,v 1.23 2003/03/19 09:12:38 mjn3 Exp $
|
||||
* $Id: ifconfig.c,v 1.24 2003/05/26 14:06:01 bug1 Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -296,7 +296,7 @@ int ifconfig_main(int argc, char **argv)
|
||||
#ifdef CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS
|
||||
unsigned int mask;
|
||||
unsigned int did_flags;
|
||||
in_addr_t sai_hostname, sai_netmask;
|
||||
unsigned int sai_hostname, sai_netmask;
|
||||
#else
|
||||
unsigned char mask;
|
||||
unsigned char did_flags;
|
||||
|
||||
Reference in New Issue
Block a user