* Copyright (C) 1999,2000,2001 by John Beppu <beppu@codepoet.org>
* Copyright (C) 2007 by Tito Ragusa <farmatito@tiscali.it>
*
- * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
+ * Licensed under GPLv2 or later, see file LICENSE in this source tree.
*
*/
+
+//usage:#define addgroup_trivial_usage
+//usage: "[-g GID] " IF_FEATURE_ADDUSER_TO_GROUP("[USER] ") "GROUP"
+//usage:#define addgroup_full_usage "\n\n"
+//usage: "Add a group " IF_FEATURE_ADDUSER_TO_GROUP("or add a user to a group") "\n"
+//usage: "\n -g GID Group id"
+//usage: "\n -S Create a system group"
+
#include "libbb.h"
#if CONFIG_LAST_SYSTEM_ID < CONFIG_FIRST_SYSTEM_ID
if (ENABLE_FEATURE_CLEAN_UP)
free(p);
#if ENABLE_FEATURE_SHADOWPASSWDS
- /* Ignore errors: if file is missing we suppose admin doesn't want it */
+ /* /etc/gshadow fields:
+ * 1. Group name.
+ * 2. Encrypted password.
+ * If set, non-members of the group can join the group
+ * by typing the password for that group using the newgrp command.
+ * If the value is of this field ! then no user is allowed
+ * to access the group using the newgrp command. A value of !!
+ * is treated the same as a value of ! only it indicates
+ * that a password has never been set before. If the value is null,
+ * only group members can log into the group.
+ * 3. Group administrators (comma delimited list).
+ * Group members listed here can add or remove group members
+ * using the gpasswd command.
+ * 4. Group members (comma delimited list).
+ */
+ /* Ignore errors: if file is missing we assume admin doesn't want it */
update_passwd(bb_path_gshadow_file, group, "!::", NULL);
#endif
}
{
die_if_bad_username(argv[0]);
new_group(argv[0], gid);
-
}
/* Reached only on success */
return EXIT_SUCCESS;