Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

GH-85724: Ignore the MAC from the Touch Bar interface on macOS in uuid#99717

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
ronaldoussoren wants to merge3 commits intopython:main
base:main
Choose a base branch
Loading
fromronaldoussoren:gh-85724-uuid-touchbar

Conversation

ronaldoussoren
Copy link
Contributor

@ronaldoussorenronaldoussoren commentedNov 23, 2022
edited by bedevere-bot
Loading

All Intel MacBook Pro devices with a Touch Bar have a network interface connected to a controller for that device that has the same MAC address for all MacBooks.

Ignore these MAC adresses in the UUID library.

…in uuidAll Intel MacBook Pro devices with a Touch Bar have a networkinterface connected to a controller for that device that hasthe same MAC address for all MacBooks.Ignore these MAC adresses in the UUID library.
@ronaldoussoren
Copy link
ContributorAuthor

One thing I haven't seriously looked into yet is how to include tests for my changes, other than a trivial change to test_uuid that will ensure tests fail on an affected device without the changes to uuid.py.

I have manually checked that uuid.uuid1() does not use the MAC address for the Touch Bar interface on an affected device.

1. Remove the "BLACKLIST" variable as it is both lazy naming   not necessary2. Be more explicit in tests3. Add test that checks that the mac touchbar mac is   actually ignored.
@@ -581,6 +589,18 @@ def _netbios_getnode():
_generate_time_safe = getattr(_uuid, "generate_time_safe", None)
_UuidCreate = getattr(_uuid, "UuidCreate", None)
_has_uuid_generate_time_safe = _uuid.has_uuid_generate_time_safe

if sys.platform == "darwin" and _generate_time_safe is not None:
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

I'm not 100% sure about this test, and in particular not about the test for "darwin".

There are people running Linux on Apple hardware and I don't know if those could be affected by this issue, in particular if there is a driver that exposes a ethernet-like interface to the Touch Bar hardware.

_x = _generate_time_safe()[0]
if _x.endswith(bytes.fromhex(_MACOS_TOUCHBAR_MAC.replace(":", ""))):
_has_uuid_generate_time_safe = False
_generate_time_safe = None
Copy link
Member

Choose a reason for hiding this comment

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

Would it make sense/be possible to implement this test directly in the _uuid module: remove the function if it returns this address?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Hmmm... Possible yes, sensible maybe not.

The implementation of_uuid.generate_time_safe has 3 or 4 variants (depending on how you count) and because of that an implementation in C mirrors the Python code above but is more verbose and likely not faster than the Python implementation.

I have a patch, but haven't tested it on a device with a Touch Bar yet. That patch adds 49 lines of code to _uuidmodule.c and removes the 4 lines of python code above.

@hugovkhugovk removed the needs backport to 3.10only security fixes labelApr 7, 2023
@serhiy-storchakaserhiy-storchaka added needs backport to 3.12only security fixes needs backport to 3.13bugs and security fixes and removed needs backport to 3.11only security fixes labelsMay 9, 2024
@serhiy-storchakaserhiy-storchaka added the needs backport to 3.14bugs and security fixes labelMay 8, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@vstinnervstinnervstinner left review comments

Assignees
No one assigned
Labels
awaiting core reviewneeds backport to 3.12only security fixesneeds backport to 3.13bugs and security fixesneeds backport to 3.14bugs and security fixesOS-mac
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

5 participants
@ronaldoussoren@vstinner@hugovk@serhiy-storchaka@bedevere-bot

[8]ページ先頭

©2009-2025 Movatter.jp