mirror of
https://github.com/webmin/webmin.git
synced 2025-07-21 23:40:34 +00:00
When running a command as a different user, the username needs to be passed to switch_to_unix_user so that all the secondary groups can be populated https://github.com/webmin/webmin/issues/2223
This commit is contained in:
@ -286,8 +286,9 @@ if (!$@) {
|
||||
|
||||
close(STDIN); close(STDOUT); close(STDERR);
|
||||
untie(*STDIN); untie(*STDOUT); untie(*STDERR);
|
||||
if ($_[1]) {
|
||||
&switch_to_unix_user([ undef, undef, $_[1], $_[2] ]);
|
||||
if ($uid) {
|
||||
my $username = getpwuid($uid);
|
||||
&switch_to_unix_user([ $username, undef, $uid, $gid ]);
|
||||
}
|
||||
|
||||
close($ptyfh); # Used by other side only
|
||||
|
Reference in New Issue
Block a user