{NULL, 0, NULL, '\0'}
};
- /*
+ /*
* The remaining arguments will be processed one by one and executed
* by this command. The name is the last argument if it does not
* begin with a "-", otherwise the name is determined from the
/*
* Non-privileged users are optionally authenticated (must enter the
* password of the user whose information is being changed) before
- * any changes can be made. Idea from util-linux chfn/chsh.
+ * any changes can be made. Idea from util-linux chfn/chsh.
* --marekm
*/
if (!amroot && getdef_bool ("CHFN_AUTH")) {
newgr.gr_passwd = cp;
}
- /*
+ /*
* The updated group file entry is then put back and will
* be written to the group file later, after all the
* other entries have been updated as well.
}
}
-/*
+/*
* expiry - check and enforce password expiration policy
*
* expiry checks (-c) the current password expiration and forces (-f)
sanitize_env ();
- /*
+ /*
* Start by disabling all of the keyboard signals.
*/
(void) signal (SIGHUP, catch_signals);
* main - groupdel command
*
* The syntax of the groupdel command is
- *
+ *
* groupdel group
*
* The named group will be deleted.
static char *whoami (void);
static void add_user (const char *user,
const struct group *grp);
-static void remove_user (const char *user,
+static void remove_user (const char *user,
const struct group *grp);
static void purge_members (const struct group *grp);
static void display_members (const char *const *members);
/*
* remove_user - Remove an user from a given group
*/
-static void remove_user (const char *user,
+static void remove_user (const char *user,
const struct group *grp)
{
struct group *newgrp;
#endif
}
-int main (int argc, char **argv)
+int main (int argc, char **argv)
{
char *name;
const struct group *grp;
}
/*
- * All shadow group file deletions wind up here.
+ * All shadow group file deletions wind up here.
* This code removes the current entry from the
* linked list. When done, it skips back to the top
* of the loop to try out the next list element.
*
* Redistribution and use in source and binary forms are permitted
* provided that this entire copyright notice is duplicated in all such
-* copies.
+* copies.
*
* This software is provided "as is" and without any expressed or implied
* warranties, including, without limitation, the implied warranties of
* control based on login names and on host (or domain) names, internet
* addresses (or network numbers), or on terminal line names in case of
* non-networked logins. Diagnostics are reported through syslog(3).
- *
+ *
* Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
*/
#include <sys/types.h>
*/
while (true) {
- /*
+ /*
* Attempt to re-open the utmpx/utmp file. The file is only
* open while it is being used.
*/
initflag = true;
}
if (!is_newgrp) {
- /*
+ /*
* Do the command line for everything that is
* not "newgrp".
*/
group = argv[0];
} else {
/*
- * get the group file entry for her login group id.
+ * get the group file entry for her login group id.
* the entry must exist, simply to be annoying.
*
* Perhaps in the past, but the default behavior now depends on the
* now we put her in the new group. The password file entry for her
* current user id has been gotten. If there was no optional group
* argument she will have her real and effective group id set to the
- * set to the value from her password file entry.
+ * set to the value from her password file entry.
*
* If run as newgrp, or as sg with no command, this process exec's
- * an interactive subshell with the effective GID of the new group.
+ * an interactive subshell with the effective GID of the new group.
* If run as sg with a command, that command is exec'ed in this
* subshell. When this process terminates, either because the user
* exits, or the command completes, the parent of this process
* resumes with the current GID.
*
* If a group is explicitly specified on the command line, the
- * interactive shell or command is run with that effective GID.
+ * interactive shell or command is run with that effective GID.
* Access will be denied if no entry for that group can be found in
* /etc/group. If the current user name appears in the members list
* for that group, access will be granted immediately; if not, the
}
#endif /* HAVE_SETGROUPS */
/*
- * For splitted groups (due to limitations of NIS), check all
+ * For splitted groups (due to limitations of NIS), check all
* groups of the same GID like the requested group for
* membership of the current user.
*/
#ifdef HAVE_SETGROUPS
/*
* I am going to try to add her new group id to her concurrent group
- * set. If the group id is already present i'll just skip this part.
+ * set. If the group id is already present i'll just skip this part.
* If the group doesn't fit, i'll complain loudly and skip this
* part.
*/
/*
* The previous code, when run as newgrp, re-exec'ed the shell in
- * the current process with the original gid on error conditions.
+ * the current process with the original gid on error conditions.
* See the comment above. This historical behavior now has the
* effect of creating unlogged extraneous shell layers when the
* command line has an error or there is an authentication failure.
if (NULL != group) {
snprintf (audit_buf, sizeof(audit_buf),
"changing new-group=%s", group);
- audit_logger (AUDIT_CHGRP_ID, Prog,
+ audit_logger (AUDIT_CHGRP_ID, Prog,
audit_buf, NULL,
(unsigned int) getuid (), 0);
} else {
(unsigned long) getuid ()));
return EXIT_FAILURE;
}
-
+
/* Get the effective uid and effective gid of the target process */
if (fstat(proc_dir_fd, &st) < 0) {
fprintf(stderr, _("%s: Could not stat directory for target %u\n"),
}
#ifndef USE_PAM
-/*
+/*
* update_passwd - update the password in the passwd entry
*
* Return 0 if successful.
/*
* If enabled, warn about weak passwords even if you are
- * root (enter this password again to use it anyway).
+ * root (enter this password again to use it anyway).
* --marekm
*/
if (amroot && !warned && getdef_bool ("PASS_ALWAYS_WARN")
STRFCPY (crypt_passwd, cp);
/*
- * See if the user is permitted to change the password.
+ * See if the user is permitted to change the password.
* Otherwise, go ahead and set a new password.
*/
check_password (pw, sp);
#ifdef SU_ACCESS
-/* Really, I could do with a few const char's here defining all the
+/* Really, I could do with a few const char's here defining all the
* strings output to the user or the syslog. -- chris
*/
static int applies (const char *, char *);
/*
* XXX - can't enter single user mode if root password is
* empty. I think this doesn't happen very often :-). But
- * it will work with standard getpass() (no NULL on EOF).
+ * it will work with standard getpass() (no NULL on EOF).
* --marekm
*/
if ((NULL == cp) || ('\0' == *cp)) {