2 * Copyright (c) 1990 - 1994, Julianne Frances Haugh
3 * Copyright (c) 1996 - 2000, Marek Michałkiewicz
4 * Copyright (c) 2001 - 2006, Tomasz Kłoczko
5 * Copyright (c) 2007 - 2008, Nicolas François
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. The name of the copyright holders or contributors may not be used to
17 * endorse or promote products derived from this software without
18 * specific prior written permission.
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
23 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43 #include <sys/types.h>
45 #include "exitcodes.h"
48 #include "prototypes.h"
55 /* The name of this command, as it is invoked */
59 /* Indicate if shadow groups are enabled on the system
60 * (/etc/gshadow present) */
61 static bool is_shadowgrp;
62 static bool gshadow_locked = false;
64 static bool group_locked = false;
66 /* Flags set by options */
67 static bool aflg = false;
68 static bool Aflg = false;
69 static bool dflg = false;
70 static bool Mflg = false;
71 static bool rflg = false;
72 static bool Rflg = false;
73 /* The name of the group that is being affected */
74 static char *group = NULL;
75 /* The name of the user being added (-a) or removed (-d) from group */
76 static char *user = NULL;
77 /* The new list of members set with -M */
78 static char *members = NULL;
80 /* The new list of group administrators set with -A */
81 static char *admins = NULL;
83 /* The name of the caller */
84 static char *myname = NULL;
85 /* The UID of the caller */
87 /* Indicate if gpasswd was called by root */
88 #define amroot (0 == bywho)
90 /* The number of retries for th user to provide and repeat a new password */
95 /* local function prototypes */
96 static void usage (void);
97 static RETSIGTYPE catch_signals (int killed);
98 static void fail_exit (int status);
99 static bool is_valid_user_list (const char *users);
100 static void process_flags (int argc, char **argv);
101 static void check_flags (int argc, int opt_index);
102 static void open_files (void);
103 static void close_files (void);
105 static void get_group (struct group *gr, struct sgrp *sg);
106 static void check_perms (const struct group *gr, const struct sgrp *sg);
107 static void update_group (struct group *gr, struct sgrp *sg);
108 static void change_passwd (struct group *gr, struct sgrp *sg);
110 static void get_group (struct group *gr);
111 static void check_perms (const struct group *gr);
112 static void update_group (struct group *gr);
113 static void change_passwd (struct group *gr);
117 * usage - display usage message
119 static void usage (void)
121 fprintf (stderr, _("Usage: %s [-r|-R] group\n"), Prog);
122 fprintf (stderr, _(" %s [-a user] group\n"), Prog);
123 fprintf (stderr, _(" %s [-d user] group\n"), Prog);
126 _(" %s [-A user,...] [-M user,...] group\n"), Prog);
128 fprintf (stderr, _(" %s [-M user,...] group\n"), Prog);
134 * catch_signals - set or reset termio modes.
136 * catch_signals() is called before processing begins. signal() is then
137 * called with catch_signals() as the signal handler. If signal later
138 * calls catch_signals() with a signal number, the terminal modes are
141 static RETSIGTYPE catch_signals (int killed)
152 (void) putchar ('\n');
153 (void) fflush (stdout);
159 * fail_exit - undo as much as possible
161 static void fail_exit (int status)
164 if (gr_unlock () == 0) {
165 fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname ());
166 SYSLOG ((LOG_WARN, "failed to unlock %s", gr_dbname ()));
168 audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
169 "unlocking group file",
170 group, AUDIT_NO_ID, 0);
175 if (gshadow_locked) {
176 if (sgr_unlock () == 0) {
177 fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
178 SYSLOG ((LOG_WARN, "failed to unlock %s", sgr_dbname ()));
180 audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
181 "unlocking gshadow file",
182 group, AUDIT_NO_ID, 0);
192 * is_valid_user_list - check a comma-separated list of user names for validity
194 * is_valid_user_list scans a comma-separated list of user names and
195 * checks that each listed name exists is the user database.
197 * It returns true if the list of users is valid.
199 static bool is_valid_user_list (const char *users)
201 const char *start, *end;
206 for (start = users; (NULL != start) && ('\0' != *start); start = end) {
207 end = strchr (start, ',');
209 len = (size_t) (end - start);
212 len = strlen (start);
215 if (len > sizeof (username) - 1) {
216 len = sizeof (username) - 1;
218 strncpy (username, start, len);
219 username[len] = '\0';
222 * This user must exist.
225 /* local, no need for xgetpwnam */
226 if (getpwnam (username) == NULL) {
227 fprintf (stderr, _("%s: user '%s' does not exist\n"),
235 static void failure (void)
237 fprintf (stderr, _("%s: Permission denied.\n"), Prog);
242 * process_flags - process the command line options and arguments
244 static void process_flags (int argc, char **argv)
248 while ((flag = getopt (argc, argv, "a:A:d:gM:rR")) != EOF) {
250 case 'a': /* add a user */
252 /* local, no need for xgetpwnam */
253 if (getpwnam (user) == NULL) {
255 _("%s: user '%s' does not exist\n"), Prog,
258 audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
260 user, AUDIT_NO_ID, 0);
270 audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
271 "Listing administrators",
272 NULL, (unsigned int) bywho, 0);
278 _("%s: shadow group passwords required for -A\n"),
283 if (!is_valid_user_list (admins)) {
289 case 'd': /* delete a user */
293 case 'g': /* no-op from normal password */
298 audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
300 NULL, (unsigned int) bywho, 0);
305 if (!is_valid_user_list (members)) {
310 case 'r': /* remove group password */
313 case 'R': /* restrict group password */
321 /* Get the name of the group that is being affected. */
322 group = argv[optind];
324 check_flags (argc, optind);
328 * check_flags - check the validity of options
330 static void check_flags (int argc, int opt_index)
334 * Make sure exclusive flags are exclusive
356 * Make sure one (and only one) group was provided
358 if ((argc != (opt_index+1)) || (NULL == group)) {
364 * open_files - lock and open the group databases
366 * It will call exit in case of error.
368 static void open_files (void)
370 if (gr_lock () == 0) {
371 fprintf (stderr, _("%s: cannot lock %s\n"), Prog, gr_dbname ());
372 SYSLOG ((LOG_WARN, "cannot lock %s", gr_dbname ()));
374 audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
375 "locking /etc/group",
376 group, AUDIT_NO_ID, 0);
383 if (sgr_lock () == 0) {
385 _("%s: cannot lock %s\n"), Prog, sgr_dbname ());
386 SYSLOG ((LOG_WARN, "cannot lock %s", sgr_dbname ()));
388 audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
389 "locking /etc/gshadow",
390 group, AUDIT_NO_ID, 0);
394 gshadow_locked = true;
397 if (gr_open (O_RDWR) == 0) {
398 fprintf (stderr, _("%s: cannot open %s\n"), Prog, gr_dbname ());
399 SYSLOG ((LOG_WARN, "cannot open %s", gr_dbname ()));
401 audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
402 "opening /etc/group",
403 group, AUDIT_NO_ID, 0);
408 if (is_shadowgrp && (sgr_open (O_RDWR) == 0)) {
409 fprintf (stderr, _("%s: cannot open %s\n"), Prog, sgr_dbname ());
410 SYSLOG ((LOG_WARN, "cannot open %s", sgr_dbname ()));
412 audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
413 "opening /etc/gshadow",
414 group, AUDIT_NO_ID, 0);
422 * close_files - close and unlock the group databases
424 * This cause any changes in the databases to be committed.
426 * It will call exit in case of error.
428 static void close_files (void)
430 if (gr_close () == 0) {
431 fprintf (stderr, _("%s: failure while writing changes to %s\n"), Prog, gr_dbname ());
432 SYSLOG ((LOG_WARN, "failure while writing changes to %s", gr_dbname ()));
434 audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
435 "rewriting /etc/group",
436 group, AUDIT_NO_ID, 0);
442 if (sgr_close () == 0) {
443 fprintf (stderr, _("%s: failure while writing changes to %s\n"), Prog, sgr_dbname ());
444 SYSLOG ((LOG_WARN, "failure while writing changes to %s", sgr_dbname ()));
446 audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
447 "rewriting /etc/gshadow",
448 group, AUDIT_NO_ID, 0);
452 if (sgr_unlock () == 0) {
453 fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
454 SYSLOG ((LOG_WARN, "failed to unlock %s", sgr_dbname ()));
456 audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
457 "unlocking gshadow file",
458 group, AUDIT_NO_ID, 0);
462 gshadow_locked = false;
465 if (gr_unlock () == 0) {
466 fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname ());
467 SYSLOG ((LOG_WARN, "failed to unlock %s", gr_dbname ()));
469 audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
470 "unlocking group file",
471 group, AUDIT_NO_ID, 0);
475 group_locked = false;
479 * check_perms - check if the user is allowed to change the password of
480 * the specified group.
482 * It only returns if the user is allowed.
485 static void check_perms (const struct group *gr, const struct sgrp *sg)
487 static void check_perms (const struct group *gr)
493 * The policy here for changing a group is that
494 * 1) you must be root or
495 * 2) you must be listed as an administrative member.
496 * Administrative members can do anything to a group that
499 if (!amroot && !is_on_list (sg->sg_adm, myname)) {
501 audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
503 group, AUDIT_NO_ID, 0);
508 #endif /* ! SHADOWGRP */
510 #ifdef FIRST_MEMBER_IS_ADMIN
512 * The policy here for changing a group is that
513 * 1) you must be root or
514 * 2) you must be the first listed member of the group.
515 * The first listed member of a group can do anything to
516 * that group that the root user can. The rationale for
517 * this hack is that the FIRST user is probably the most
518 * important user in this entire group.
520 * This feature enabled by default could be a security
521 * problem when installed on existing systems where the
522 * first group member might be just a normal user.
526 if (gr->gr_mem[0] == (char *) 0) {
528 audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
530 group, AUDIT_NO_ID, 0);
535 if (strcmp (gr->gr_mem[0], myname) != 0) {
537 audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
539 myname, AUDIT_NO_ID, 0);
544 #else /* ! FIRST_MEMBER_IS_ADMIN */
547 audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
549 group, AUDIT_NO_ID, 0);
558 * update_group - Update the group information in the databases
561 static void update_group (struct group *gr, struct sgrp *sg)
563 static void update_group (struct group *gr)
566 if (gr_update (gr) == 0) {
568 _("%s: cannot update entry '%s' in %s\n"),
569 Prog, gr->gr_name, gr_dbname ());
570 SYSLOG ((LOG_WARN, "cannot update entry '%s' in %s", gr->gr_name, gr_dbname ()));
572 audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
573 "updating /etc/group",
574 group, AUDIT_NO_ID, 0);
579 if (is_shadowgrp && (sgr_update (sg) == 0)) {
580 fprintf (stderr, _("%s: cannot update entry '%s' in %s\n"), Prog, sg->sg_name, sgr_dbname ());
581 SYSLOG ((LOG_WARN, "cannot update entry '%s' in %s", sg->sg_name, sgr_dbname ()));
583 audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
584 "updating /etc/gshadow",
585 group, AUDIT_NO_ID, 0);
593 * get_group - get the current information for the group
595 * The information are copied in group structure(s) so that they can be
598 * Note: If !is_shadowgrp, *sg will not be initialized.
601 static void get_group (struct group *gr, struct sgrp *sg)
603 static void get_group (struct group *gr)
606 struct group const*tmpgr = NULL;
607 struct sgrp const*tmpsg = NULL;
609 if (gr_open (O_RDONLY) == 0) {
610 fprintf (stderr, _("%s: cannot open %s\n"), Prog, gr_dbname ());
611 SYSLOG ((LOG_WARN, "cannot open %s", gr_dbname ()));
613 audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
614 "opening /etc/group",
615 group, AUDIT_NO_ID, 0);
620 tmpgr = gr_locate (group);
622 fprintf (stderr, _("%s: group '%s' does not exist in %s\n"), Prog, group, gr_dbname ());
624 audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
626 group, AUDIT_NO_ID, 0);
632 gr->gr_name = xstrdup (tmpgr->gr_name);
633 gr->gr_passwd = xstrdup (tmpgr->gr_passwd);
634 gr->gr_mem = dup_list (tmpgr->gr_mem);
636 if (gr_close () == 0) {
637 fprintf (stderr, _("%s: failure while writing changes to %s\n"), Prog, gr_dbname ());
638 SYSLOG ((LOG_WARN, "failure while writing changes to %s", gr_dbname ()));
640 audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
641 "closing /etc/group",
642 group, AUDIT_NO_ID, 0);
649 if (sgr_open (O_RDONLY) == 0) {
651 _("%s: cannot open %s\n"), Prog, sgr_dbmane ());
652 SYSLOG ((LOG_WARN, "cannot open %s", sgr_dbname ()));
654 audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
655 "opening /etc/gshadow",
656 group, AUDIT_NO_ID, 0);
660 tmpsg = sgr_locate (group);
663 sg->sg_name = xstrdup (tmpsg->sg_name);
664 sg->sg_passwd = xstrdup (tmpsg->sg_passwd);
666 sg->sg_mem = dup_list (tmpsg->sg_mem);
667 sg->sg_adm = dup_list (tmpsg->sg_adm);
669 sg->sg_name = xstrdup (group);
670 sg->sg_passwd = gr->gr_passwd;
671 gr->gr_passwd = SHADOW_PASSWD_STRING; /* XXX warning: const */
673 sg->sg_mem = dup_list (gr->gr_mem);
675 sg->sg_adm = (char **) xmalloc (sizeof (char *) * 2);
676 #ifdef FIRST_MEMBER_IS_ADMIN
678 sg->sg_adm[0] = xstrdup (sg->sg_mem[0]);
679 sg->sg_adm[1] = NULL;
683 sg->sg_adm[0] = NULL;
687 if (sgr_close () == 0) {
689 _("%s: failure while writing changes to %s\n"), Prog, sgr_dbname ());
690 SYSLOG ((LOG_WARN, "failure while writing changes to %s", sgr_dbname ()));
692 audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
693 "closing /etc/gshadow",
694 group, AUDIT_NO_ID, 0);
699 #endif /* SHADOWGRP */
703 * change_passwd - change the group's password
705 * Get the new password from the user and update the password in the
708 * It will call exit in case of error.
711 static void change_passwd (struct group *gr, struct sgrp *sg)
713 static void change_passwd (struct group *gr)
717 static char pass[BUFSIZ];
721 * A new password is to be entered and it must be encrypted, etc.
722 * The password will be prompted for twice, and both entries must be
723 * identical. There is no need to validate the old password since
724 * the invoker is either the group owner, or root.
726 printf (_("Changing the password for group %s\n"), group);
728 for (retries = 0; retries < RETRIES; retries++) {
729 cp = getpass (_("New Password: "));
736 cp = getpass (_("Re-enter new password: "));
741 if (strcmp (pass, cp) == 0) {
747 memzero (pass, sizeof pass);
749 if (retries + 1 < RETRIES) {
750 puts (_("They don't match; try again"));
752 audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
754 group, AUDIT_NO_ID, 0);
759 if (retries == RETRIES) {
760 fprintf (stderr, _("%s: Try again later\n"), Prog);
764 cp = pw_encrypt (pass, crypt_make_salt (NULL, NULL));
765 memzero (pass, sizeof pass);
775 audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
777 group, AUDIT_NO_ID, 1);
779 SYSLOG ((LOG_INFO, "change the password for group %s by %s", group,
784 * gpasswd - administer the /etc/group file
786 * -a user add user to the named group
787 * -d user remove user from the named group
788 * -r remove password from the named group
789 * -R restrict access to the named group
790 * -A user,... make list of users the administrative users
791 * -M user,... make list of users the group members
793 int main (int argc, char **argv)
799 struct passwd *pw = NULL;
806 (void) setlocale (LC_ALL, "");
807 (void) bindtextdomain (PACKAGE, LOCALEDIR);
808 (void) textdomain (PACKAGE);
811 * Make a note of whether or not this command was invoked by root.
812 * This will be used to bypass certain checks later on. Also, set
813 * the real user ID to match the effective user ID. This will
814 * prevent the invoker from issuing signals which would interfer
818 Prog = Basename (argv[0]);
821 setbuf (stdout, NULL);
822 setbuf (stderr, NULL);
825 is_shadowgrp = sgr_file_present ();
828 /* Parse the options */
829 process_flags (argc, argv);
832 * Determine the name of the user that invoked this command. This
833 * is really hit or miss because there are so many ways that command
834 * can be executed and so many ways to trip up the routines that
835 * report the user name.
838 pw = get_my_pwent ();
840 fputs (_("Who are you?\n"), stderr);
842 audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
844 NULL, (unsigned int) bywho, 0);
848 myname = xstrdup (pw->pw_name);
851 * Replicate the group so it can be modified later on.
854 get_group (&grent, &sgent);
860 * Check if the user is allowed to change the password of this group.
863 check_perms (&grent, &sgent);
865 check_perms (&grent);
869 * Removing a password is straight forward. Just set the password
873 grent.gr_passwd = ""; /* XXX warning: const */
875 sgent.sg_passwd = ""; /* XXX warning: const */
878 audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
879 "deleting group password",
880 group, AUDIT_NO_ID, 1);
882 SYSLOG ((LOG_INFO, "remove password from group %s by %s",
887 * Same thing for restricting the group. Set the password
890 grent.gr_passwd = "!"; /* XXX warning: const */
892 sgent.sg_passwd = "!"; /* XXX warning: const */
895 audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
896 "restrict access to group",
897 group, AUDIT_NO_ID, 1);
899 SYSLOG ((LOG_INFO, "restrict access to group %s by %s",
905 * Adding a member to a member list is pretty straightforward as
906 * well. Call the appropriate routine and split.
909 printf (_("Adding user %s to group %s\n"), user, group);
910 grent.gr_mem = add_list (grent.gr_mem, user);
913 sgent.sg_mem = add_list (sgent.sg_mem, user);
917 audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
918 "adding group member",
919 user, AUDIT_NO_ID, 1);
921 SYSLOG ((LOG_INFO, "add member %s to group %s by %s", user,
927 * Removing a member from the member list is the same deal as adding
928 * one, except the routine is different.
931 bool removed = false;
933 printf (_("Removing user %s from group %s\n"), user, group);
935 if (is_on_list (grent.gr_mem, user)) {
937 grent.gr_mem = del_list (grent.gr_mem, user);
941 if (is_on_list (sgent.sg_mem, user)) {
943 sgent.sg_mem = del_list (sgent.sg_mem, user);
948 fprintf (stderr, _("%s: user '%s' is not a member of '%s'\n"),
951 audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
953 user, AUDIT_NO_ID, 0);
958 audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
960 user, AUDIT_NO_ID, 1);
962 SYSLOG ((LOG_INFO, "remove member %s from group %s by %s",
963 user, group, myname));
968 * Replacing the entire list of administrators is simple. Check the
969 * list to make sure everyone is a real user. Then slap the new list
974 audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
975 "setting group admin",
976 group, AUDIT_NO_ID, 1);
978 SYSLOG ((LOG_INFO, "set administrators of %s to %s",
980 sgent.sg_adm = comma_to_list (admins);
988 * Replacing the entire list of members is simple. Check the list to
989 * make sure everyone is a real user. Then slap the new list in
994 audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
995 "setting group members",
996 group, AUDIT_NO_ID, 1);
998 SYSLOG ((LOG_INFO, "set members of %s to %s", group, members));
1000 sgent.sg_mem = comma_to_list (members);
1002 grent.gr_mem = comma_to_list (members);
1007 * If the password is being changed, the input and output must both
1008 * be a tty. The typical keyboard signals are caught so the termio
1009 * modes can be restored.
1011 if ((isatty (0) == 0) || (isatty (1) == 0)) {
1012 fprintf (stderr, _("%s: Not a tty\n"), Prog);
1014 audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
1015 "changing password",
1016 group, AUDIT_NO_ID, 0);
1021 catch_signals (0); /* save tty modes */
1023 (void) signal (SIGHUP, catch_signals);
1024 (void) signal (SIGINT, catch_signals);
1025 (void) signal (SIGQUIT, catch_signals);
1026 (void) signal (SIGTERM, catch_signals);
1028 (void) signal (SIGTSTP, catch_signals);
1031 /* Prompt for the new password */
1033 change_passwd (&grent, &sgent);
1035 change_passwd (&grent);
1039 * This is the common arrival point to output the new group file.
1040 * The freshly crafted entry is in allocated space. The group file
1041 * will be locked and opened for writing. The new entry will be
1045 if (setuid (0) != 0) {
1046 fputs (_("Cannot change ID to root.\n"), stderr);
1047 SYSLOG ((LOG_ERR, "can't setuid(0)"));
1049 audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
1050 "changing id to root",
1051 group, AUDIT_NO_ID, 0);
1061 update_group (&grent, &sgent);
1063 update_group (&grent);
1068 nscd_flush_cache ("group");