From f76337c97f635c6c8381d612cbf7ca59aaa5e06e Mon Sep 17 00:00:00 2001 From: SimonFair <39065407+SimonFair@users.noreply.github.com> Date: Thu, 23 May 2024 21:43:52 +0100 Subject: [PATCH] Update VMs to use my_mkdir --- .../dynamix.vm.manager/include/VMajax.php | 4 ++-- .../dynamix.vm.manager/include/libvirt.php | 24 +++++++++---------- .../include/libvirt_helpers.php | 8 +++---- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/emhttp/plugins/dynamix.vm.manager/include/VMajax.php b/emhttp/plugins/dynamix.vm.manager/include/VMajax.php index 3a694cf4f..828962754 100644 --- a/emhttp/plugins/dynamix.vm.manager/include/VMajax.php +++ b/emhttp/plugins/dynamix.vm.manager/include/VMajax.php @@ -396,8 +396,8 @@ case 'disk-create': $driver = $_REQUEST['driver']; $size = str_replace(["KB","MB","GB","TB","PB", " ", ","], ["K","M","G","T","P", "", ""], strtoupper($_REQUEST['size'])); $dir = dirname($disk); - if (!is_dir($dir)) mkdir($dir); - #if (!is_dir($dir)) my_mkdir($dir); + #if (!is_dir($dir)) mkdir($dir); + if (!is_dir($dir)) my_mkdir($dir); // determine the actual disk if user share is being used $dir = transpose_user_path($dir); #@exec("chattr +C -R ".escapeshellarg($dir)." >/dev/null"); diff --git a/emhttp/plugins/dynamix.vm.manager/include/libvirt.php b/emhttp/plugins/dynamix.vm.manager/include/libvirt.php index e3c024f01..4d0660064 100644 --- a/emhttp/plugins/dynamix.vm.manager/include/libvirt.php +++ b/emhttp/plugins/dynamix.vm.manager/include/libvirt.php @@ -175,10 +175,10 @@ // create folder if needed if (!is_dir($strImgFolder)) { - mkdir($strImgFolder, 0777, true); - #my_mkdir($strImgFolder, 0777, true); - chown($strImgFolder, 'nobody'); - chgrp($strImgFolder, 'users'); + #mkdir($strImgFolder, 0777, true); + my_mkdir($strImgFolder, 0777, true); + #chown($strImgFolder, 'nobody'); + #chgrp($strImgFolder, 'users'); } $this->set_folder_nodatacow($strImgFolder); @@ -192,10 +192,10 @@ // create parent folder if needed if (!is_dir($path_parts['dirname'])) { - mkdir($path_parts['dirname'], 0777, true); - #my_mkdir($path_parts['dirname'], 0777, true); - chown($path_parts['dirname'], 'nobody'); - chgrp($path_parts['dirname'], 'users'); + #mkdir($path_parts['dirname'], 0777, true); + my_mkdir($path_parts['dirname'], 0777, true); + #chown($path_parts['dirname'], 'nobody'); + #chgrp($path_parts['dirname'], 'users'); } $this->set_folder_nodatacow($path_parts['dirname']); @@ -219,10 +219,10 @@ // create folder if needed $strImgRawLocationParent = dirname($strImgRawLocationPath); if (!is_dir($strImgRawLocationParent)) { - mkdir($strImgRawLocationParent, 0777, true); - #my_mkdir($strImgRawLocationParent, 0777, true); - chown($strImgRawLocationParent, 'nobody'); - chgrp($strImgRawLocationParent, 'users'); + #mkdir($strImgRawLocationParent, 0777, true); + my_mkdir($strImgRawLocationParent, 0777, true); + #chown($strImgRawLocationParent, 'nobody'); + #chgrp($strImgRawLocationParent, 'users'); } $this->set_folder_nodatacow($strImgRawLocationParent); diff --git a/emhttp/plugins/dynamix.vm.manager/include/libvirt_helpers.php b/emhttp/plugins/dynamix.vm.manager/include/libvirt_helpers.php index 8718cc6e3..8d78bcd93 100644 --- a/emhttp/plugins/dynamix.vm.manager/include/libvirt_helpers.php +++ b/emhttp/plugins/dynamix.vm.manager/include/libvirt_helpers.php @@ -1717,10 +1717,10 @@ private static $encoding = 'UTF-8'; if ($storage == "default") $clonedir = $domain_cfg['DOMAINDIR'].$clone ; else $clonedir = str_replace('/mnt/user/', "/mnt/$storage/", $domain_cfg['DOMAINDIR']).$clone; if (!is_dir($clonedir)) { - mkdir($clonedir,0777,true); - #my_mkdir($clonedir,0777,true); - chown($clonedir, 'nobody'); - chgrp($clonedir, 'users'); + #mkdir($clonedir,0777,true); + my_mkdir($clonedir,0777,true); + #chown($clonedir, 'nobody'); + #chgrp($clonedir, 'users'); } write("addLog\0".htmlspecialchars("Checking for image files")); if ($file_exists && $overwrite != "yes") { write("addLog\0".htmlspecialchars(_("New image file names exist and Overwrite is not allowed"))); return( false) ; }