Skip to content

Conversation

@CtrlZvi
Copy link
Contributor

@CtrlZvi CtrlZvi commented May 16, 2018

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.

https://bugs.python.org/issue33542

Lib/uuid.py Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^ at the begin of the pattern is not needed since re.match() always matches at the start of the string.

You can use re.fullmatch() in Python 3.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add "Patch by yourname."

Use ``uuid.get_node`` instead of `uuid.get_node`.

@serhiy-storchaka serhiy-storchaka added type-bug An unexpected behavior, bug, or error needs backport to 3.6 labels May 17, 2018
@serhiy-storchaka
Copy link
Member

And since it is your first contribution, please add your name in Misc/ACKS.

@CtrlZvi
Copy link
Contributor Author

CtrlZvi commented May 18, 2018

Not a problem. Would it be better to use re.fullmatch() or stick with $ to ease backport to 2.7?

@serhiy-storchaka
Copy link
Member

I think it is better to use re.fullmatch() in Python 3 and $ in the 2.7 backport.

@CtrlZvi CtrlZvi force-pushed the fix-bpo-33542 branch 2 times, most recently from d9d8a9e to 261ac16 Compare May 19, 2018 05:04
@CtrlZvi
Copy link
Contributor Author

CtrlZvi commented May 19, 2018

I've made the requested changes (I think). I'm happy to do the work for the backporting, but my understanding is that those PRs would happen after this PR is merged?

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.
@serhiy-storchaka serhiy-storchaka merged commit c66c342 into python:master May 20, 2018
@miss-islington
Copy link
Contributor

Thanks @CtrlZvi for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 2.7, 3.6, 3.7.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 20, 2018
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.
(cherry picked from commit c66c342)

Co-authored-by: CtrlZvi <[email protected]>
@bedevere-bot
Copy link

GH-7011 is a backport of this pull request to the 3.7 branch.

@miss-islington
Copy link
Contributor

Sorry, @CtrlZvi and @serhiy-storchaka, I could not cleanly backport this to 2.7 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker c66c342cb42ab8a88884527ddfe3a5086bc06316 2.7

@miss-islington
Copy link
Contributor

Sorry, @CtrlZvi and @serhiy-storchaka, I could not cleanly backport this to 3.6 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker c66c342cb42ab8a88884527ddfe3a5086bc06316 3.6

serhiy-storchaka pushed a commit to serhiy-storchaka/cpython that referenced this pull request May 20, 2018
)

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..
(cherry picked from commit c66c342)

Co-authored-by: CtrlZvi <[email protected]>
@bedevere-bot
Copy link

GH-7014 is a backport of this pull request to the 3.6 branch.

serhiy-storchaka pushed a commit to serhiy-storchaka/cpython that referenced this pull request May 20, 2018
)

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..
(cherry picked from commit c66c342)

Co-authored-by: CtrlZvi <[email protected]>
@bedevere-bot
Copy link

GH-7015 is a backport of this pull request to the 2.7 branch.

miss-islington added a commit that referenced this pull request May 20, 2018
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.
(cherry picked from commit c66c342)

Co-authored-by: CtrlZvi <[email protected]>
serhiy-storchaka added a commit that referenced this pull request May 20, 2018
…H-7015)

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..
(cherry picked from commit c66c342)

Co-authored-by: CtrlZvi <[email protected]>
serhiy-storchaka added a commit that referenced this pull request May 21, 2018
…H-7014)

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.
(cherry picked from commit c66c342)

Co-authored-by: CtrlZvi <[email protected]>
@serhiy-storchaka serhiy-storchaka removed their assignment Dec 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-bug An unexpected behavior, bug, or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants