diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-04-13 23:59:52 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-04-13 23:59:52 +0000 |
commit | 16abcd90aefae8bdb9f7d80a555982dba6ca59b5 (patch) | |
tree | b7e23fd3c844849d188813323076c93105a57d4d /networking | |
parent | 334fa9bcb50df9a03288be252096750dcec14404 (diff) | |
download | busybox-w32-16abcd90aefae8bdb9f7d80a555982dba6ca59b5.tar.gz busybox-w32-16abcd90aefae8bdb9f7d80a555982dba6ca59b5.tar.bz2 busybox-w32-16abcd90aefae8bdb9f7d80a555982dba6ca59b5.zip |
teach find_root_device to deal with /dev/ subdirs
(by "Kirill K. Smirnov" <lich@math.spbu.ru>)
Diffstat (limited to 'networking')
-rw-r--r-- | networking/httpd.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/networking/httpd.c b/networking/httpd.c index d80df937a..1f7c886de 100644 --- a/networking/httpd.c +++ b/networking/httpd.c | |||
@@ -1573,7 +1573,7 @@ static void handleIncoming(void) | |||
1573 | } | 1573 | } |
1574 | 1574 | ||
1575 | /* algorithm stolen from libbb bb_simplify_path(), | 1575 | /* algorithm stolen from libbb bb_simplify_path(), |
1576 | but don't strdup and reducing trailing slash and protect out root */ | 1576 | * but don't strdup and reducing trailing slash and protect out root */ |
1577 | purl = test = url; | 1577 | purl = test = url; |
1578 | do { | 1578 | do { |
1579 | if (*purl == '/') { | 1579 | if (*purl == '/') { |
@@ -1583,18 +1583,18 @@ static void handleIncoming(void) | |||
1583 | } | 1583 | } |
1584 | if (*test == '.') { | 1584 | if (*test == '.') { |
1585 | /* skip extra '.' */ | 1585 | /* skip extra '.' */ |
1586 | if (test[1] == '/' || test[1] == 0) { | 1586 | if (test[1] == '/' || !test[1]) { |
1587 | continue; | 1587 | continue; |
1588 | } else | 1588 | } |
1589 | /* '..': be careful */ | 1589 | /* '..': be careful */ |
1590 | if (test[1] == '.' && (test[2] == '/' || test[2] == 0)) { | 1590 | if (test[1] == '.' && (test[2] == '/' || !test[2])) { |
1591 | ++test; | 1591 | ++test; |
1592 | if (purl == url) { | 1592 | if (purl == url) { |
1593 | /* protect out root */ | 1593 | /* protect out root */ |
1594 | goto BAD_REQUEST; | 1594 | goto BAD_REQUEST; |
1595 | } | 1595 | } |
1596 | while (*--purl != '/') /* omit previous dir */; | 1596 | while (*--purl != '/') /* omit previous dir */; |
1597 | continue; | 1597 | continue; |
1598 | } | 1598 | } |
1599 | } | 1599 | } |
1600 | } | 1600 | } |