summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCtrlZvi <viz+github@flippedperspective.com>2018-05-20 08:03:25 -0700
committerSerhiy Storchaka <storchaka@gmail.com>2018-05-20 18:03:25 +0300
commitc66c342cb42ab8a88884527ddfe3a5086bc06316 (patch)
tree63fbe92c9152418de4654f888d0c43af1ca9e9c5 /Lib/uuid.py
parentbpo-30940: Updating round() docs. (GH-6342) (diff)
downloadcpython-c66c342cb42ab8a88884527ddfe3a5086bc06316.tar.gz
cpython-c66c342cb42ab8a88884527ddfe3a5086bc06316.tar.bz2
cpython-c66c342cb42ab8a88884527ddfe3a5086bc06316.zip
bpo-33542: Ignore DUID in uuid.get_node on Windows. (GH-6922)
uuid._ipconfig_getnode did not validate the maximum length of the value, so long as the value had the same type of formatting as a MAC address. This let it select DUIDs as MAC addresses. It now requires an exact length match.
Diffstat (limited to 'Lib/uuid.py')
-rw-r--r--Lib/uuid.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/uuid.py b/Lib/uuid.py
index 9cb73e87718..66383218e70 100644
--- a/Lib/uuid.py
+++ b/Lib/uuid.py
@@ -488,7 +488,7 @@ def _ipconfig_getnode():
with proc:
for line in proc.stdout:
value = line.split(':')[-1].strip().lower()
- if re.match('([0-9a-f][0-9a-f]-){5}[0-9a-f][0-9a-f]', value):
+ if re.fullmatch('(?:[0-9a-f][0-9a-f]-){5}[0-9a-f][0-9a-f]', value):
mac = int(value.replace('-', ''), 16)
if _is_universal(mac):
return mac