From b2162b1af9f23c70a9d553df86db595caf0713a5 Mon Sep 17 00:00:00 2001 From: Wojciech Zygmunt Porczyk Date: Thu, 26 Jun 2014 13:55:35 +0200 Subject: [PATCH] Forbid renaming of RPM-borne VMs (mainly templates) (#839) User can still clone VM and remove old via rpm/yum. --- core-modules/000QubesVm.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core-modules/000QubesVm.py b/core-modules/000QubesVm.py index f7eb27c0..e83e9000 100644 --- a/core-modules/000QubesVm.py +++ b/core-modules/000QubesVm.py @@ -506,6 +506,9 @@ class QubesVm(object): if not self.verify_name(name): raise QubesException("Invalid characters in VM name") + if self.installed_by_rpm: + raise QubesException("Cannot rename VM installed by RPM -- first clone VM and then use yum to remove package.") + self.pre_rename(name) new_conf = os.path.join(self.dir_path, name + '.conf')