first work on permission-improvements by adding webserver-user to ftp-group of customer and therefore make it possible to chown the user-docroot to 750 keeping 'others' out, refs #532
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
@@ -809,7 +809,7 @@ if ($page == 'customers'
|
|||||||
'customerid' => $customerid,
|
'customerid' => $customerid,
|
||||||
'groupname' => $loginname,
|
'groupname' => $loginname,
|
||||||
'guid' => $guid,
|
'guid' => $guid,
|
||||||
'members' => $loginname
|
'members' => $loginname.','.$settings['system']['httpuser']
|
||||||
);
|
);
|
||||||
Database::pexecute($ins_stmt, $ins_data);
|
Database::pexecute($ins_stmt, $ins_data);
|
||||||
// FTP-Quotatallies
|
// FTP-Quotatallies
|
||||||
|
|||||||
@@ -2537,7 +2537,7 @@ if (isFroxlorVersion('0.9.31-rc1')) {
|
|||||||
|
|
||||||
if (isFroxlorVersion('0.9.31-rc2')) {
|
if (isFroxlorVersion('0.9.31-rc2')) {
|
||||||
|
|
||||||
showUpdateStep("Updating from 0.9.31-rc1 to 0.9.31-rc99");
|
showUpdateStep("Updating from 0.9.31-rc2 to 0.9.31-rc99");
|
||||||
lastStepStatus(0);
|
lastStepStatus(0);
|
||||||
|
|
||||||
showUpdateStep("Removing APS-module (deprecated)");
|
showUpdateStep("Removing APS-module (deprecated)");
|
||||||
@@ -2582,5 +2582,9 @@ if (isFroxlorVersion('0.9.31-rc2')) {
|
|||||||
Database::query("DROP TABLE IF EXISTS `mail_autoresponder`;");
|
Database::query("DROP TABLE IF EXISTS `mail_autoresponder`;");
|
||||||
lastStepStatus(0);
|
lastStepStatus(0);
|
||||||
|
|
||||||
|
showUpdateStep("Updating ftp-groups entries");
|
||||||
|
Database::query("UPDATE `".TABLE_FTP_GROUPS."` SET `members` = CONCAT(`members`, ',".$settings['system']['httpuser']."');");
|
||||||
|
lastStepStatus(0);
|
||||||
|
|
||||||
updateToVersion('0.9.31-rc99');
|
updateToVersion('0.9.31-rc99');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -143,6 +143,8 @@ while ($row = $result_tasks_stmt->fetch(PDO::FETCH_ASSOC)) {
|
|||||||
|
|
||||||
$cronlog->logAction(CRON_ACTION, LOG_NOTICE, 'Running: chown -R ' . (int)$row['data']['uid'] . ':' . (int)$row['data']['gid'] . ' ' . escapeshellarg($userhomedir));
|
$cronlog->logAction(CRON_ACTION, LOG_NOTICE, 'Running: chown -R ' . (int)$row['data']['uid'] . ':' . (int)$row['data']['gid'] . ' ' . escapeshellarg($userhomedir));
|
||||||
safe_exec('chown -R ' . (int)$row['data']['uid'] . ':' . (int)$row['data']['gid'] . ' ' . escapeshellarg($userhomedir));
|
safe_exec('chown -R ' . (int)$row['data']['uid'] . ':' . (int)$row['data']['gid'] . ' ' . escapeshellarg($userhomedir));
|
||||||
|
// don't allow others to access the directory (webserver will be in the users' group)
|
||||||
|
safe_exec('chmod 0750 ' . escapeshellarg($userhomedir));
|
||||||
$cronlog->logAction(CRON_ACTION, LOG_NOTICE, 'Running: chown -R ' . (int)$settings['system']['vmail_uid'] . ':' . (int)$settings['system']['vmail_gid'] . ' ' . escapeshellarg($usermaildir));
|
$cronlog->logAction(CRON_ACTION, LOG_NOTICE, 'Running: chown -R ' . (int)$settings['system']['vmail_uid'] . ':' . (int)$settings['system']['vmail_gid'] . ' ' . escapeshellarg($usermaildir));
|
||||||
safe_exec('chown -R ' . (int)$settings['system']['vmail_uid'] . ':' . (int)$settings['system']['vmail_gid'] . ' ' . escapeshellarg($usermaildir));
|
safe_exec('chown -R ' . (int)$settings['system']['vmail_uid'] . ':' . (int)$settings['system']['vmail_gid'] . ' ' . escapeshellarg($usermaildir));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user