Skip to content
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

Implement fn close_range for MacOS #901

Open
squell opened this issue Nov 4, 2024 · 1 comment
Open

Implement fn close_range for MacOS #901

squell opened this issue Nov 4, 2024 · 1 comment
Labels

Comments

@squell
Copy link
Member

squell commented Nov 4, 2024

This function exists on Linux (since we updated to a newer libc) and FreeBSD. Maybe it's as easy as finding the right IOCTL, or maybe we need to do this the slow painful way.

@bjorn3
Copy link
Collaborator

bjorn3 commented Nov 4, 2024

Looks like on macOS og-sudo sets the CLOEXEC flag for all files in the range 0..sysconf(_SC_OPEN_MAX) manually rather than closing them to prevent a libdispatch crash.

https://github.com/sudo-project/sudo/blob/116115229a625afe068ac6c593a5ce2176a96a08/lib/util/closefrom.c#L70-L76

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

No branches or pull requests

2 participants