summaryrefslogtreecommitdiff
path: root/main/safe_mode.c
diff options
context:
space:
mode:
authorWez Furlong <wez@php.net>2003-03-17 13:40:45 +0000
committerWez Furlong <wez@php.net>2003-03-17 13:40:45 +0000
commitcfd0466389aaa2d3ff2068fb87b7a65128c3db3e (patch)
treec6d02f5ed4438388c175811dc816950de58c5fe7 /main/safe_mode.c
parentdbe4f2238ceed386a69cacbbce5cae8b0a856fab (diff)
downloadphp-git-cfd0466389aaa2d3ff2068fb87b7a65128c3db3e.tar.gz
Fix for Bug #21310, based on a patch by jflemer@php.net.
Diffstat (limited to 'main/safe_mode.c')
-rw-r--r--main/safe_mode.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/main/safe_mode.c b/main/safe_mode.c
index 4c21cb49d7..c7e3fd7abe 100644
--- a/main/safe_mode.c
+++ b/main/safe_mode.c
@@ -126,6 +126,11 @@ PHPAPI int php_checkuid_ex(const char *filename, char *fopen_mode, int mode, int
VCWD_REALPATH(filename, path);
*s = DEFAULT_SLASH;
} else {
+ /* Under Solaris, getcwd() can fail if there are no
+ * read permissions on a component of the path, even
+ * though it has the required x permissions */
+ path[0] = '.';
+ path[1] = '\0';
VCWD_GETCWD(path, sizeof(path));
}
} /* end CHECKUID_ALLOW_ONLY_DIR */