初始提交:DSH 多租户平台(dshs)
This commit is contained in:
commit
43976fea6a
167 files changed
+24456
No files matched your search
@@ -0,0 +1,16 @@
|
||||
// Stand-in for a setuid wrapper (e.g. `setpriv --reuid`). Logs the uid it was
|
||||
// given, then execs the remaining argv (the real DSH command) so the smoke test
|
||||
// can verify the account-level uid was passed while still running the child.
|
||||
import { spawn } from 'node:child_process'
|
||||
import { writeFileSync } from 'node:fs'
|
||||
|
||||
const uidIdx = process.argv.indexOf('--uid')
|
||||
const uid = uidIdx >= 0 ? process.argv[uidIdx + 1] : 'unknown'
|
||||
writeFileSync('setpriv-uid.txt', String(uid))
|
||||
const rest = process.argv.slice(uidIdx >= 0 ? uidIdx + 2 : 2)
|
||||
if (rest.length > 0) {
|
||||
const child = spawn(rest[0], rest.slice(1), { stdio: 'inherit' })
|
||||
child.on('exit', (code) => process.exit(code ?? 0))
|
||||
} else {
|
||||
process.exit(0)
|
||||
}
|
||||
Reference in new issue
Block a user