From 41ba079eb86f7d6ee138254519cbb41c8dbcb779 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Tue, 8 Oct 2013 22:47:56 +0200 Subject: [PATCH] Force the first character of VM name to be a letter Especially don't allow numeric-only name (our deserializer of qubes.xml will convert it to int instead of str...). --- core-modules/000QubesVm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core-modules/000QubesVm.py b/core-modules/000QubesVm.py index ddab54cf..d229e6d6 100644 --- a/core-modules/000QubesVm.py +++ b/core-modules/000QubesVm.py @@ -399,7 +399,7 @@ class QubesVm(object): return False def verify_name(self, name): - return re.match(r"^[a-zA-Z0-9_-]*$", name) is not None + return re.match(r"^[a-zA-Z][a-zA-Z0-9_-]*$", name) is not None def pre_rename(self, new_name): # fire hooks