diff options
| author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-07-20 23:25:32 +0000 |
|---|---|---|
| committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-07-20 23:25:32 +0000 |
| commit | 395410b748e0ca0a673da4d288cbf89f6cff3c93 (patch) | |
| tree | 5855e69a4a408c4701888e6d93bb56ff54403be3 | |
| parent | 7ae1cc16b4ecec930cd776f9ed688b6d4d53a166 (diff) | |
| download | busybox-w32-395410b748e0ca0a673da4d288cbf89f6cff3c93.tar.gz busybox-w32-395410b748e0ca0a673da4d288cbf89f6cff3c93.tar.bz2 busybox-w32-395410b748e0ca0a673da4d288cbf89f6cff3c93.zip | |
httpd: add Hopedir directive specially for
(and by) walter harms <wharms AT bfs.de>;
fix silly double-parse bug added in 21412.
function old new delta
parse_conf 1532 1576 +44
| -rw-r--r-- | networking/httpd.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/networking/httpd.c b/networking/httpd.c index 30ef30552..66c6982bc 100644 --- a/networking/httpd.c +++ b/networking/httpd.c | |||
| @@ -37,6 +37,7 @@ | |||
| 37 | * | 37 | * |
| 38 | * httpd.conf has the following format: | 38 | * httpd.conf has the following format: |
| 39 | * | 39 | * |
| 40 | * H:/serverroot # define the server root. It will override -h | ||
| 40 | * A:172.20. # Allow address from 172.20.0.0/16 | 41 | * A:172.20. # Allow address from 172.20.0.0/16 |
| 41 | * A:10.0.0.0/25 # Allow any address from 10.0.0.0-10.0.0.127 | 42 | * A:10.0.0.0/25 # Allow any address from 10.0.0.0-10.0.0.127 |
| 42 | * A:10.0.0.0/255.255.255.128 # Allow any address that previous set | 43 | * A:10.0.0.0/255.255.255.128 # Allow any address that previous set |
| @@ -687,6 +688,13 @@ static void parse_conf(const char *path, int flag) | |||
| 687 | continue; | 688 | continue; |
| 688 | } | 689 | } |
| 689 | 690 | ||
| 691 | /* Do not allow jumping around using H in subdir's configs */ | ||
| 692 | if (flag == FIRST_PARSE && *p0 == 'H') { | ||
| 693 | home_httpd = xstrdup(after_colon); | ||
| 694 | xchdir(home_httpd); | ||
| 695 | continue; | ||
| 696 | } | ||
| 697 | |||
| 690 | #if ENABLE_FEATURE_HTTPD_BASIC_AUTH \ | 698 | #if ENABLE_FEATURE_HTTPD_BASIC_AUTH \ |
| 691 | || ENABLE_FEATURE_HTTPD_CONFIG_WITH_MIME_TYPES \ | 699 | || ENABLE_FEATURE_HTTPD_CONFIG_WITH_MIME_TYPES \ |
| 692 | || ENABLE_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR | 700 | || ENABLE_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR |
| @@ -2256,8 +2264,7 @@ static void mini_httpd_inetd(void) | |||
| 2256 | #if ENABLE_FEATURE_HTTPD_RELOAD_CONFIG_SIGHUP | 2264 | #if ENABLE_FEATURE_HTTPD_RELOAD_CONFIG_SIGHUP |
| 2257 | static void sighup_handler(int sig) | 2265 | static void sighup_handler(int sig) |
| 2258 | { | 2266 | { |
| 2259 | parse_conf(default_path_httpd_conf, sig == SIGHUP ? SIGNALED_PARSE : FIRST_PARSE); | 2267 | parse_conf(default_path_httpd_conf, sig ? SIGNALED_PARSE : FIRST_PARSE); |
| 2260 | |||
| 2261 | signal_SA_RESTART_empty_mask(SIGHUP, sighup_handler); | 2268 | signal_SA_RESTART_empty_mask(SIGHUP, sighup_handler); |
| 2262 | } | 2269 | } |
| 2263 | #endif | 2270 | #endif |
| @@ -2392,10 +2399,14 @@ int httpd_main(int argc UNUSED_PARAM, char **argv) | |||
| 2392 | #endif | 2399 | #endif |
| 2393 | 2400 | ||
| 2394 | #if ENABLE_FEATURE_HTTPD_RELOAD_CONFIG_SIGHUP | 2401 | #if ENABLE_FEATURE_HTTPD_RELOAD_CONFIG_SIGHUP |
| 2395 | if (!(opt & OPT_INETD)) | 2402 | if (!(opt & OPT_INETD)) { |
| 2403 | /* runs parse_conf() inside */ | ||
| 2396 | sighup_handler(0); | 2404 | sighup_handler(0); |
| 2405 | } else | ||
| 2397 | #endif | 2406 | #endif |
| 2398 | parse_conf(default_path_httpd_conf, FIRST_PARSE); | 2407 | { |
| 2408 | parse_conf(default_path_httpd_conf, FIRST_PARSE); | ||
| 2409 | } | ||
| 2399 | 2410 | ||
| 2400 | xfunc_error_retval = 0; | 2411 | xfunc_error_retval = 0; |
| 2401 | if (opt & OPT_INETD) | 2412 | if (opt & OPT_INETD) |
