Drop group privileges before dropping user privileges when execing
This ensures that the saved-set-gid is also set, although this shouldn't matter in practice since we always call execve() soon after, which overwrites the saved-set-gid with the effective gid anyway.
This commit is contained in:
@@ -569,8 +569,8 @@ BUILT_IN_COMMAND(execcmd)
|
||||
#if !defined(WINNT) && !defined(__EMX__)
|
||||
setsid();
|
||||
#endif
|
||||
setuid(getuid());
|
||||
setgid(getgid());
|
||||
setuid(getuid());
|
||||
my_signal(SIGINT, SIG_IGN, 0);
|
||||
my_signal(SIGQUIT, SIG_DFL, 0);
|
||||
my_signal(SIGSEGV, SIG_DFL, 0);
|
||||
|
||||
Reference in New Issue
Block a user