set safe file permissions

This commit is contained in:
Daniel Winzen
2020-01-26 14:40:52 +01:00
parent 61d15297b7
commit 26c4c3c75d

View File

@ -355,4 +355,10 @@ while($tmp=$stmt->fetch(PDO::FETCH_NUM)){
}
}
$db->exec('UPDATE service_instances SET reload=1;');
//set safe file permissions
exec('chown root:www-data -R /var/www/html/');
exec('find /var/www/html/ -type f -exec chmod 640 {} \;');
exec('find /var/www/html/ -type d -exec chmod 750 {} \;');
exec('chown root:www-data /var/www/common.php /var/www/composer.json /var/www/composer.lock /var/www/cron.php /var/www/find_old.php /var/www/setup_chroot.sh /var/www/setup.php');
exec('chmod 640 /var/www/common.php /var/www/composer.json /var/www/composer.lock /var/www/cron.php /var/www/find_old.php /var/www/setup_chroot.sh /var/www/setup.php');
echo "Done - Database and files have been updated to the latest version :)\n";