From 9f7915d9988bf1b4e76052c7535fbd24d6c2787c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Sun, 13 Aug 2017 21:11:45 +0200 Subject: [PATCH] Forbid creating VM with name 'none' or 'default' Those were special names in Qubes 3.x, don't allow such VMs to avoid (potentially fatal) confusion. Fixes QubesOS/qubes-issues#3002 --- qubes/vm/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qubes/vm/__init__.py b/qubes/vm/__init__.py index 7b714038..4694efad 100644 --- a/qubes/vm/__init__.py +++ b/qubes/vm/__init__.py @@ -60,6 +60,9 @@ def validate_name(holder, prop, value): else: raise qubes.exc.QubesValueError( 'VM name contains illegal characters') + if value in ('none', 'default'): + raise qubes.exc.QubesValueError( + 'VM name cannot be \'none\' nor \'default\'') class Features(dict):