Package: vmdebootstrap
Version: 1.6-1
Severity: minor
Tags: patch

The fix for #831030:

> When using both --owner and --convert-qcow2 together, the resulting .img
> file must also be chowned to be useful. Otherwise, the owner will only
> be able to access the .raw file.

appears to be incomplete. While the .img file is being chowned now, the
.raw file no longer is.

Hence why I duplicated the support in #831030, but that was indeed not
clean. I have attached an alternative solution.

Or, perhaps the .raw file should just be removed? Is there any reason to
keep it around? I don't see much of a use case to keep both, especially
when qcow2 is explicitly being requested.

Regards,
Christian
From 960e830f066d9116bd6b8e28424a604644fc8738 Mon Sep 17 00:00:00 2001
From: Christian Kastner <c...@kvr.at>
Date: Sat, 13 Aug 2016 09:33:41 +0200
Subject: [PATCH] Also chown raw image

When both the --owner and --convert-qcow2 option are used, in addition to the
.img file, also chown the original .raw file.
---
 vmdebootstrap/filesystem.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/vmdebootstrap/filesystem.py b/vmdebootstrap/filesystem.py
index b911c05..a744098 100644
--- a/vmdebootstrap/filesystem.py
+++ b/vmdebootstrap/filesystem.py
@@ -69,6 +69,10 @@ class Filesystem(Base):
             return
         self.message("Changing owner to %s" % self.settings["owner"])
         runcmd(["chown", "-R", self.settings["owner"], filename])
+        # This combination produces a second file to chown
+        if self.settings['image'] and self.settings['convert-qcow2']:
+            rawfile = self.settings['image'] + '.raw'
+            runcmd(["chown", "-R", self.settings["owner"], rawfile])
 
     def update_initramfs(self):
         rootdir = self.devices['rootdir']
-- 
2.8.1

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to