Files
DirectAdmin-1.62.4/services/custombuild/patches/suphp_calling_user.patch
2025-11-12 20:19:03 +07:00

29 lines
1.1 KiB
Diff

--- a/src/Application.cpp 2009-03-14 19:55:25.000000000 +0200
+++ b/src/Application.cpp 2011-01-25 14:55:25.000000000 +0300
@@ -169,11 +169,6 @@ void suPHP::Application::printAboutMessa
void suPHP::Application::checkProcessPermissions(Configuration& config)
throw (SecurityException, LookupException) {
API& api = API_Helper::getSystemAPI();
- if (api.getRealProcessUser() !=
- api.getUserInfo(config.getWebserverUser())) {
- throw SecurityException("Calling user is not webserver user!",
- __FILE__, __LINE__);
- }
if (!api.getEffectiveProcessUser().isSuperUser()) {
throw SecurityException(
@@ -392,6 +387,13 @@ void suPHP::Application::checkProcessPer
targetGroup = scriptFile.getGroup();
#endif // OPT_USERGROUP_OWNER
+ if (api.getRealProcessUser() !=
+ api.getUserInfo(config.getWebserverUser()) &&
+ api.getRealProcessUser() != targetUser) {
+ throw SecurityException("Calling user is not webserver user!",
+ __FILE__, __LINE__);
+ }
+
// Paranoid mode only
#ifdef OPT_USERGROUP_PARANOID