Skip to content

gh-113078: Use uint64 for dev_t and uint32 for makedev params #113080

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

renatoalencar
Copy link

@renatoalencar renatoalencar commented Dec 14, 2023

Following the implementions from both FreeBSD and GNU glibc, `PyLong_FromDev should actually be unsigned. This can break on FreeBSD systems using ZFS, since they wouldn't generate device IDs with 56 upper bits randomly, therefore the MSB too.

Also, following the documentation from FreeBSD and Linux, makedev should accept unsigned 32 bit integers. The reason to that is because on FreeBSD major and minor can return anything on the 32 bit int range and on Linux it really specifies that it returns a unsigned integer.

@ghost
Copy link

ghost commented Dec 14, 2023

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-app
Copy link

bedevere-app bot commented Dec 14, 2023

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@bedevere-app
Copy link

bedevere-app bot commented Dec 14, 2023

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

renatoalencar and others added 2 commits December 13, 2023 22:50
Following the implementions from both FreeBSD and GNU glibc,
`PyLong_FromDev should actually be unsigned. This can break
on FreeBSD systems using ZFS, since they wouldn't generate
device IDs with 56 upper bits randomly, therefore the MSB
too.

Also, following the documentation from FreeBSD and Linux,
`makedev` should accept unsigned 32 bit integers. The reason
to that is because on FreeBSD `major` and `minor` can return
anything on the 32 bit int range and on Linux it really specifies
that it returns a unsigned integer.
@renatoalencar renatoalencar changed the title gh-113078: Use uint64 for dev_t and uint32 for make params gh-113078: Use uint64 for dev_t and uint32 for makedev params Dec 14, 2023
@vstinner
Copy link
Member

I suggest to continue the work on #31794 which is more complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants