Skip to content

Commit

Permalink
Forbid VM name ending with -dm
Browse files Browse the repository at this point in the history
Prevent potential clashes with stubdomain of another VM.
  • Loading branch information
marmarek committed Jun 23, 2021
1 parent 9d1809a commit af15a89
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions qubes/vm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ def validate_name(holder, prop, value):
if value in ('none', 'default'):
raise qubes.exc.QubesValueError(
'VM name cannot be \'none\' nor \'default\'')
if value.endswith('-dm'):
raise qubes.exc.QubesValueError(
'VM name cannot end with -dm')

def setter_label(self, prop, value):
''' Helper for setting the domain label '''
Expand Down

0 comments on commit af15a89

Please sign in to comment.