Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
isv:cpanel:EA4
scl-php56
php-5.6.23-fpm-user-ini-docroot.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File php-5.6.23-fpm-user-ini-docroot.patch of Package scl-php56
diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c index d12ac01..dd05f03 100644 --- a/sapi/fpm/fpm/fpm_main.c +++ b/sapi/fpm/fpm/fpm_main.c @@ -715,6 +715,9 @@ static void php_cgi_ini_activate_user_config(char *path, int path_len, const cha /* Check whether cache entry has expired and rescan if it is */ if (request_time > entry->expires) { + char pwnambuf[4096 + 256]; + struct passwd pwd, *pwdp; + long homedirlen; char * real_path; int real_path_len; char *s1, *s2; @@ -743,6 +746,15 @@ static void php_cgi_ini_activate_user_config(char *path, int path_len, const cha s_len = path_len; } + /* Find our home directory, and ensure the document root is within it. + */ + if (getpwuid_r(geteuid(), &pwd, pwnambuf, sizeof(pwnambuf), &pwdp) || !pwdp || !pwdp->pw_dir) + return; + + homedirlen = strlen(pwdp->pw_dir); + if (strncmp(doc_root, pwdp->pw_dir, homedirlen) || doc_root[homedirlen] != '/') + return; + /* we have to test if path is part of DOCUMENT_ROOT. if it is inside the docroot, we scan the tree up to the docroot to find more user.ini, if not we only scan the current path.
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor