mirror of
https://github.com/php/php-src.git
synced 2025-08-19 08:49:28 +02:00
@- 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)
This commit is contained in:
parent
e247b206e0
commit
0719e7e006
1 changed files with 8 additions and 0 deletions
|
@ -121,6 +121,14 @@ PHPAPI int php_checkuid(const char *filename, char *fopen_mode, int mode)
|
||||||
if (duid == (uid=php_getuid())) {
|
if (duid == (uid=php_getuid())) {
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
} 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);
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue