Skip to content

Make os.exec support supplementary groups#1056

Merged
bnoordhuis merged 2 commits intoquickjs-ng:masterfrom
bnoordhuis:fix1055
May 18, 2025
Merged

Make os.exec support supplementary groups#1056
bnoordhuis merged 2 commits intoquickjs-ng:masterfrom
bnoordhuis:fix1055

Conversation

@bnoordhuis
Copy link
Copy Markdown
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

2 participants