cvs: php4 /main safe_mode.c
| From: | Thies C. Arntzen | Date: | Tue, 09 Jan 2001 11:58:58 +0000 |
| Subject: | cvs: php4 /main safe_mode.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-3510@lists.php.net to get a copy of this message | ||
thies Tue Jan 9 03:58:58 2001 EDT
Modified files:
/php4/main safe_mode.c
Log:
@- Allow access to uploaded files in safe_mode. Beware that you can only
@ read the file. If you copy it to new location the copy will not have the
@ right UID and you script won't be able to access that copy. (Thies)
Index: php4/main/safe_mode.c
diff -u php4/main/safe_mode.c:1.24 php4/main/safe_mode.c:1.25
--- php4/main/safe_mode.c:1.24 Sat Dec 16 12:52:43 2000
+++ php4/main/safe_mode.c Tue Jan 9 03:58:57 2001
@@ -15,7 +15,7 @@
| Authors: Rasmus Lerdorf <rasmus@lerdorf.on.ca> |
+----------------------------------------------------------------------+
*/
-/* $Id: safe_mode.c,v 1.24 2000/12/16 20:52:43 andi Exp $ */
+/* $Id: safe_mode.c,v 1.25 2001/01/09 11:58:57 thies Exp $ */
#include "php.h"
@@ -121,6 +121,14 @@
if (duid == (uid=php_getuid())) {
return 1;
} else {
+ SLS_FETCH();
+
+ if (SG(rfc1867_uploaded_files)) {
+ if (zend_hash_exists(SG(rfc1867_uploaded_files),filename,strlen(filename)+1)) {
+ return 1;
+ }
+ }
+
php_error(E_WARNING, "SAFE MODE Restriction in effect. The script whose uid is %ld is not
allowed to access %s owned by uid %ld", uid, filename, duid);
return 0;
}