mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-19 03:33:43 +03:00
(main) [! HAVE_SETGROUPS]: Don't call setgroups.
This commit is contained in:
1 parent
e26a29be00
commit
2e16cd4302
1 file changed
+3
-1
+3
-1
@@ -1,5 +1,5 @@
|
||||
/* setuidgid - run a command with the UID and GID of a specified user
|
||||
Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -104,8 +104,10 @@ main (int argc, char **argv)
|
||||
error (SETUIDGID_FAILURE, errno,
|
||||
_("unknown user-ID: %s"), quote (user_id));
|
||||
|
||||
#if HAVE_SETGROUPS
|
||||
if (setgroups (1, &pwd->pw_gid))
|
||||
error (SETUIDGID_FAILURE, errno, _("cannot set supplemental group"));
|
||||
#endif
|
||||
|
||||
if (setgid (pwd->pw_gid))
|
||||
error (SETUIDGID_FAILURE, errno,
|
||||
|
||||
Reference in new issue
Block a user