This is an automated email from the ASF dual-hosted git repository.

RosiKyu pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/main by this push:
     new 2737087a800 systemvm: keep /var/www owned by www-data after patching 
the SSVM (#14727)
2737087a800 is described below

commit 2737087a8009a54ceef5e0eb29dbae1fef4a8f10
Author: Rositsa Kyuchukova <[email protected]>
AuthorDate: Fri Nov 20 13:40:34 2026 +0200

    systemvm: keep /var/www owned by www-data after patching the SSVM (#14727)
    
    Patching the secondary storage VM extracts cloud-scripts.tgz as root,
    which also carries /var/www/html/userdata. The folder then belongs to
    root and new download links (volumes, templates, ISOs) fail with
    "mkdir: cannot create directory ... Permission denied" until the SSVM
    is rebooted. Give /var/www back to www-data after the extract, the same
    as the boot setup does.
    
    Fixes #14726
---
 systemvm/patch-sysvms.sh | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/systemvm/patch-sysvms.sh b/systemvm/patch-sysvms.sh
index e8fa06018ed..147b9f5b1d2 100755
--- a/systemvm/patch-sysvms.sh
+++ b/systemvm/patch-sysvms.sh
@@ -119,6 +119,13 @@ patch_systemvm() {
   echo "Extracting cloud scripts" >> $logfile 2>&1
   tar -xvf $newpath/cloud-scripts.tgz -C / >> $logfile 2>&1
 
+  if [ "$TYPE" = "secstorage" ]; then
+    # The archive also carries /var/www, which is extracted as root. Give it 
back
+    # to the web server user, the same as on boot, so that new download links
+    # can still be created under /var/www/html/userdata after the patch.
+    chown www-data:www-data -R /var/www
+  fi
+
   if [ -f $backupfolder/conf/cloud.jks ]; then
     cp -r $backupfolder/conf/* /usr/local/cloud/systemvm/conf/
     echo "Restored keystore file and certs using backup" >> $logfile 2>&1

Reply via email to