Skip to content

Commit

Permalink
Do not allow MAC addresses to end with newlines
Browse files Browse the repository at this point in the history
This was presumably unintentional.

(cherry picked from commit 37420fc)
  • Loading branch information
DemiMarie authored and marmarek committed May 13, 2023
1 parent 026e95f commit aa96221
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion qubes/vm/mix/net.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def _setter_mac(self, prop, value):
if not isinstance(value, str):
raise ValueError('MAC address must be a string')
value = value.lower()
if re.match(r"^([0-9a-f][0-9a-f]:){5}[0-9a-f][0-9a-f]$", value) is None:
if re.match(r"\A([0-9a-f][0-9a-f]:){5}[0-9a-f][0-9a-f]\Z", value) is None:
raise ValueError('Invalid MAC address value')
return value

Expand Down

0 comments on commit aa96221

Please sign in to comment.