diff options
author | Felix Fietkau <nbd@openwrt.org> | 2013-01-01 14:25:25 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2013-01-01 15:48:53 +0100 |
commit | 7333a14d21c474702376fbf0baa367d54448129a (patch) | |
tree | aba382dd5f7b8381ecf5076d46deb934b36c813c /main.c | |
parent | 6f3d40217ecdd59fd8bc041712d7224082525ca1 (diff) |
code cleanup
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -30,6 +30,7 @@ #include "uhttpd.h" +char uh_buf[4096]; static int run_server(void) { @@ -165,6 +166,7 @@ static void init_defaults(void) conf.max_requests = 3; conf.realm = "Protected Area"; conf.cgi_prefix = "/cgi-bin"; + conf.cgi_path = "/sbin:/usr/sbin:/bin:/usr/bin"; uh_index_add("index.html"); uh_index_add("index.htm"); @@ -180,6 +182,8 @@ int main(int argc, char **argv) int cur_fd; int bound = 0; + BUILD_BUG_ON(sizeof(uh_buf) < PATH_MAX); + init_defaults(); signal(SIGPIPE, SIG_IGN); @@ -195,11 +199,12 @@ int main(int argc, char **argv) break; case 'h': - if (!realpath(optarg, conf.docroot)) { + if (!realpath(optarg, uh_buf)) { fprintf(stderr, "Error: Invalid directory %s: %s\n", optarg, strerror(errno)); exit(1); } + conf.docroot = strdup(uh_buf); break; case 'E': |