Skip to content

unix: reject out-of-range chown ids but allow -1 for unchanged - #928

Open
avsm wants to merge 1 commit into
ocaml-multicore:mainfrom
avsm:fix-chown-id-range
Open

unix: reject out-of-range chown ids but allow -1 for unchanged#928
avsm wants to merge 1 commit into
ocaml-multicore:mainfrom
avsm:fix-chown-id-range

Conversation

@avsm

@avsm avsm commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

posix allows -1 for 'unchanged'

@talex5

talex5 commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Won't the kernel check this for us anyway? Also, uid_t is unsigned on Linux!

@avsm

avsm commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

This is sufficiently weird that I thought a check here (in the portable layer) would be prudent The sign of uid_t/gid_t can be either signed or unsigned, so some casts here are probably necessary as well. e.g. python/cpython#46289 discusses this as well.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants