Commit dc679e38 authored by Marius Cramer's avatar Marius Cramer

- added fuser calls to unmount directoriies more securely

parent 5b3c2917
......@@ -594,6 +594,7 @@ class apache2_plugin {
}
//* Unmount the old log directory bfore we move the log dir
exec('fuser -km '.escapeshellcmd($old_dir.'/log'));
exec('umount '.escapeshellcmd($old_dir.'/log'));
//* Create new base directory, if it does not exist yet
......@@ -676,6 +677,7 @@ class apache2_plugin {
$app->system->removeLine('/etc/fstab', $fstab_line);
//* Unmount log directory
exec('fuser -km '.escapeshellarg($data['old']['document_root'].'/'.$old_log_folder));
exec('umount '.escapeshellarg($data['old']['document_root'].'/'.$old_log_folder));
}
......@@ -1900,10 +1902,12 @@ class apache2_plugin {
if(is_array($log_folders) && !empty($log_folders)){
foreach($log_folders as $log_folder){
//if($app->system->is_mounted($data['old']['document_root'].'/'.$log_folder)) exec('umount '.escapeshellarg($data['old']['document_root'].'/'.$log_folder));
exec('fuser -km '.escapeshellarg($data['old']['document_root'].'/'.$log_folder).' 2>/dev/null');
exec('umount '.escapeshellarg($data['old']['document_root'].'/'.$log_folder).' 2>/dev/null');
}
} else {
//if($app->system->is_mounted($data['old']['document_root'].'/'.$log_folder)) exec('umount '.escapeshellarg($data['old']['document_root'].'/'.$log_folder));
exec('fuser -km '.escapeshellarg($data['old']['document_root'].'/'.$log_folder).' 2>/dev/null');
exec('umount '.escapeshellarg($data['old']['document_root'].'/'.$log_folder).' 2>/dev/null');
}
}
......
......@@ -475,6 +475,7 @@ class nginx_plugin {
}
//* Unmount the old log directory bfore we move the log dir
exec('fuser -km '.escapeshellcmd($old_dir.'/log'));
exec('umount '.escapeshellcmd($old_dir.'/log'));
//* Create new base directory, if it does not exist yet
......@@ -557,6 +558,7 @@ class nginx_plugin {
$app->system->removeLine('/etc/fstab', $fstab_line);
//* Unmount log directory
exec('fuser -km '.escapeshellarg($data['old']['document_root'].'/'.$old_log_folder));
exec('umount '.escapeshellarg($data['old']['document_root'].'/'.$old_log_folder));
}
......@@ -1880,10 +1882,12 @@ class nginx_plugin {
if(is_array($log_folders) && !empty($log_folders)){
foreach($log_folders as $log_folder){
//if($app->system->is_mounted($data['old']['document_root'].'/'.$log_folder)) exec('umount '.escapeshellarg($data['old']['document_root'].'/'.$log_folder));
exec('fuser -km '.escapeshellarg($data['old']['document_root'].'/'.$log_folder).' 2>/dev/null');
exec('umount '.escapeshellarg($data['old']['document_root'].'/'.$log_folder).' 2>/dev/null');
}
} else {
//if($app->system->is_mounted($data['old']['document_root'].'/'.$log_folder)) exec('umount '.escapeshellarg($data['old']['document_root'].'/'.$log_folder));
exec('fuser -km '.escapeshellarg($data['old']['document_root'].'/'.$log_folder).' 2>/dev/null');
exec('umount '.escapeshellarg($data['old']['document_root'].'/'.$log_folder).' 2>/dev/null');
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment