Package: vmdebootstrap
Version: 1.5-1
Severity: normal
Tags: patch

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.

The attached patch against HEAD of master implements this.

Regards,
Christian
From 6e383b38a06e4d251a6e5f559578d26d519fd69c Mon Sep 17 00:00:00 2001
From: Christian Kastner <[email protected]>
Date: Wed, 13 Jul 2016 20:33:01 +0200
Subject: [PATCH 4/4] When chowning, also chown generated qcow2

When using both --owner and --convert-qcow2 together, the resulting .img file
must also be chowned to be useful.
---
 vmdebootstrap/filesystem.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/vmdebootstrap/filesystem.py b/vmdebootstrap/filesystem.py
index 9b3369b..a697515 100644
--- a/vmdebootstrap/filesystem.py
+++ b/vmdebootstrap/filesystem.py
@@ -312,3 +312,8 @@ class Filesystem(Base):
         os.rename(self.settings['image'], tmpname)
         runcmd(['qemu-img', 'convert', '-O', 'qcow2',
                 tmpname, self.settings['image']])
+
+        if not self.settings['owner']:
+            return
+        self.message("Changing owner to %s" % self.settings["owner"])
+        runcmd(["chown", "-R", self.settings["owner"], self.settings['image']])
-- 
2.8.1

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to