tmp is created by setup_chroot script already
This commit is contained in:
@ -29,7 +29,7 @@ while($id=$stmt->fetch(PDO::FETCH_NUM)){
|
|||||||
exec('useradd -l -p ' . escapeshellarg($id[2]) . ' -g www-data -k /var/www/skel -m -s /usr/sbin/nologin ' . escapeshellarg($system_account));
|
exec('useradd -l -p ' . escapeshellarg($id[2]) . ' -g www-data -k /var/www/skel -m -s /usr/sbin/nologin ' . escapeshellarg($system_account));
|
||||||
exec('/var/www/setup_chroot.sh ' . escapeshellarg("/home/$system_account"));
|
exec('/var/www/setup_chroot.sh ' . escapeshellarg("/home/$system_account"));
|
||||||
exec('grep ' . escapeshellarg($system_account) . ' /etc/passwd >> ' . escapeshellarg("/home/$system_account/etc/passwd"));
|
exec('grep ' . escapeshellarg($system_account) . ' /etc/passwd >> ' . escapeshellarg("/home/$system_account/etc/passwd"));
|
||||||
foreach(['.ssh', 'data', 'Maildir', 'tmp'] as $dir){
|
foreach(['.ssh', 'data', 'Maildir'] as $dir){
|
||||||
mkdir("/home/$system_account/$dir", 0700);
|
mkdir("/home/$system_account/$dir", 0700);
|
||||||
chown("/home/$system_account/$dir", $system_account);
|
chown("/home/$system_account/$dir", $system_account);
|
||||||
chgrp("/home/$system_account/$dir", 'www-data');
|
chgrp("/home/$system_account/$dir", 'www-data');
|
||||||
|
Reference in New Issue
Block a user