aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--networking/httpd.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/networking/httpd.c b/networking/httpd.c
index 9cf85dc21..35c94cb00 100644
--- a/networking/httpd.c
+++ b/networking/httpd.c
@@ -1983,7 +1983,11 @@ static int check_user_passwd(const char *path, char *user_and_passwd)
1983 1983
1984 /* WHY? */ 1984 /* WHY? */
1985 /* If already saw a match, don't accept other different matches */ 1985 /* If already saw a match, don't accept other different matches */
1986#if !ENABLE_PLATFORM_MINGW32
1986 if (prev && strcmp(prev, dir_prefix) != 0) 1987 if (prev && strcmp(prev, dir_prefix) != 0)
1988#else
1989 if (prev && strcasecmp(prev, dir_prefix) != 0)
1990#endif
1987 continue; 1991 continue;
1988 1992
1989 if (DEBUG) 1993 if (DEBUG)
@@ -1992,7 +1996,11 @@ static int check_user_passwd(const char *path, char *user_and_passwd)
1992 /* If it's not a prefix match, continue searching */ 1996 /* If it's not a prefix match, continue searching */
1993 len = strlen(dir_prefix); 1997 len = strlen(dir_prefix);
1994 if (len != 1 /* dir_prefix "/" matches all, don't need to check */ 1998 if (len != 1 /* dir_prefix "/" matches all, don't need to check */
1999#if !ENABLE_PLATFORM_MINGW32
1995 && (strncmp(dir_prefix, path, len) != 0 2000 && (strncmp(dir_prefix, path, len) != 0
2001#else
2002 && (strncasecmp(dir_prefix, path, len) != 0
2003#endif
1996 || (path[len] != '/' && path[len] != '\0') 2004 || (path[len] != '/' && path[len] != '\0')
1997 ) 2005 )
1998 ) { 2006 ) {
@@ -2527,7 +2535,11 @@ static void handle_incoming_and_exit(const len_and_sockaddr *fromAddr)
2527 /* We are done reading headers, disable peer timeout */ 2535 /* We are done reading headers, disable peer timeout */
2528 alarm(0); 2536 alarm(0);
2529 2537
2538#if !ENABLE_PLATFORM_MINGW32
2530 if (strcmp(bb_basename(urlcopy), HTTPD_CONF) == 0) { 2539 if (strcmp(bb_basename(urlcopy), HTTPD_CONF) == 0) {
2540#else
2541 if (strcasecmp(bb_basename(urlcopy), HTTPD_CONF) == 0) {
2542#endif
2531 /* protect listing [/path]/httpd.conf or IP deny */ 2543 /* protect listing [/path]/httpd.conf or IP deny */
2532 send_headers_and_exit(HTTP_FORBIDDEN); 2544 send_headers_and_exit(HTTP_FORBIDDEN);
2533 } 2545 }