Skip to content

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