mirror of
https://github.com/bellard/quickjs.git
synced 2026-06-07 14:42:08 +00:00
fixed setuid() / setgid() ordering (#517)
This commit is contained in:
parent
e6c2be818a
commit
4a13c45081
@ -3305,14 +3305,14 @@ static JSValue js_os_exec(JSContext *ctx, JSValueConst this_val,
|
||||
if (chdir(cwd) < 0)
|
||||
_exit(127);
|
||||
}
|
||||
if (uid != -1) {
|
||||
if (setuid(uid) < 0)
|
||||
_exit(127);
|
||||
}
|
||||
if (gid != -1) {
|
||||
if (setgid(gid) < 0)
|
||||
_exit(127);
|
||||
}
|
||||
if (uid != -1) {
|
||||
if (setuid(uid) < 0)
|
||||
_exit(127);
|
||||
}
|
||||
|
||||
if (!file)
|
||||
file = exec_argv[0];
|
||||
|
||||
Loading…
Reference in New Issue
Block a user