From 49d510dc653dcc6f2d56efd5c9009ab7f5e820f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Fri, 16 Jan 2015 04:29:18 +0100 Subject: [PATCH] core: prevent permissions error when VM was started by root When VM is started by root, config file is created with root owner and user has no write access to it. As the directory is user-writable, delete the file first. Conflicts: core-modules/000QubesVm.py --- core-modules/000QubesVm.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core-modules/000QubesVm.py b/core-modules/000QubesVm.py index 23ed8765..6ce6a7b5 100644 --- a/core-modules/000QubesVm.py +++ b/core-modules/000QubesVm.py @@ -1090,6 +1090,8 @@ class QubesVm(object): # FIXME: This is only for debugging purposes old_umask = os.umask(002) try: + if os.path.exists(file_path): + os.unlink(file_path) conf_appvm = open(file_path, "w") conf_appvm.write(domain_config) conf_appvm.close()