Skip to content

Make os.exec support supplementary groups #1056

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

Merged
merged 2 commits into from
May 18, 2025

Conversation

bnoordhuis
Copy link
Contributor

@bnoordhuis bnoordhuis commented May 17, 2025

Add a .groups property that is an array of group ids for setgroups.

Fixes: #1055


No test because it cannot be tested without elevated privileges but strace -fe setgroups shows it works with both empty and non-empty lists:

$ strace -fe q=attach,exit -fe signal=kill -fe setgroups build/debug/qjs --std -e 'os.exec(["true"], {groups:[]})'
[pid 87228] setgroups(0, [])            = 0

$ strace -fe q=attach,exit -fe signal=kill -fe setgroups build/debug/qjs --std -e 'os.exec(["true"], {groups:[1,2,3]})'
[pid 87252] setgroups(3, [1, 2, 3])     = 0

Add a .groups property that is an array of group ids for setgroups.

Fixes: quickjs-ng#1055
@bnoordhuis bnoordhuis merged commit f731e4a into quickjs-ng:master May 18, 2025
128 checks passed
@bnoordhuis bnoordhuis deleted the fix1055 branch May 18, 2025 20:31
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.

Proper handling of supplementary groups?
2 participants