cvs: php4 /main safe_mode.c
| From: | James E. Flemer | Date: | Sun, 03 Mar 2002 20:49:05 +0000 |
| Subject: | cvs: php4 /main safe_mode.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-9610@lists.php.net to get a copy of this message | ||
jflemer Sun Mar 3 15:49:05 2002 EDT
Modified files:
/php4/main safe_mode.c
Log:
(php_checkuid) Added case for root directory when mode is
CHECKUID_ALLOW_ONLY_DIR.
Index: php4/main/safe_mode.c
diff -u php4/main/safe_mode.c:1.40 php4/main/safe_mode.c:1.41
--- php4/main/safe_mode.c:1.40 Thu Feb 28 03:27:04 2002
+++ php4/main/safe_mode.c Sun Mar 3 15:49:04 2002
@@ -15,7 +15,7 @@
| Author: Rasmus Lerdorf <rasmus@lerdorf.on.ca> |
+----------------------------------------------------------------------+
*/
-/* $Id: safe_mode.c,v 1.40 2002/02/28 08:27:04 sebastian Exp $ */
+/* $Id: safe_mode.c,v 1.41 2002/03/03 20:49:04 jflemer Exp $ */
#include "php.h"
@@ -103,7 +103,11 @@
} else { /* CHECKUID_ALLOW_ONLY_DIR */
s = strrchr(filename, DEFAULT_SLASH);
- if (s) {
+ if (s == filename) {
+ /* root dir */
+ path[0] = DEFAULT_SLASH;
+ path[1] = '\0';
+ } else if (s) {
*s = '\0';
VCWD_REALPATH(filename, path);
*s = DEFAULT_SLASH;