diff --git a/customer_extras.php b/customer_extras.php index def51907..7bed9b75 100644 --- a/customer_extras.php +++ b/customer_extras.php @@ -297,6 +297,22 @@ if ($page == 'overview') { if (isset($result['customerid']) && $result['customerid'] != '' && $result['customerid'] == $userinfo['customerid']) { if (isset($_POST['send']) && $_POST['send'] == 'send') { + // do we have to remove the symlink and folder in suexecpath? + if ((int)Settings::Get('perl.suexecworkaround') == 1) { + $loginname = getCustomerDetail($result['customerid'], 'loginname'); + $suexecpath = makeCorrectDir(Settings::Get('perl.suexecpath').'/'.$loginname.'/'.md5($result['path']).'/'); + $perlsymlink = makeCorrectFile($result['path'].'/cgi-bin'); + // remove symlink + if (file_exists($perlsymlink)) { + safe_exec('rm -f '.escapeshellarg($perlsymlink)); + $log->logAction(USR_ACTION, LOG_DEBUG, "deleted suexecworkaround symlink '" . $perlsymlink . "'"); + } + // remove folder in suexec-path + if (file_exists($suexecpath)) { + safe_exec('rm -rf '.escapeshellarg($suexecpath)); + $log->logAction(USR_ACTION, LOG_DEBUG, "deleted suexecworkaround path '" . $suexecpath . "'"); + } + } $stmt = Database::prepare("DELETE FROM `" . TABLE_PANEL_HTACCESS . "` WHERE `customerid`= :customerid AND `id`= :id" diff --git a/scripts/jobs/cron_tasks.inc.http.10.apache.php b/scripts/jobs/cron_tasks.inc.http.10.apache.php index 3b79366a..82f36bb2 100644 --- a/scripts/jobs/cron_tasks.inc.http.10.apache.php +++ b/scripts/jobs/cron_tasks.inc.http.10.apache.php @@ -1060,7 +1060,7 @@ class apache extends HttpConfigBase { if (!file_exists($perlsymlink)) { safe_exec('ln -s '.escapeshellarg($suexecpath).' '.escapeshellarg($perlsymlink)); } - safe_exec('chown '.escapeshellarg($row_diroptions['guid']).':'.escapeshellarg($row_diroptions['guid']).' '.escapeshellarg($perlsymlink)); + safe_exec('chown -h '.escapeshellarg($row_diroptions['guid']).':'.escapeshellarg($row_diroptions['guid']).' '.escapeshellarg($perlsymlink)); } } else { // if no perl-execution is enabled but the workaround is,