1 diff -Nur shadow-4.0.0.orig/src/groupadd.c shadow-4.0.0/src/groupadd.c
2 --- shadow-4.0.0.orig/src/groupadd.c Mon Oct 9 21:02:20 2000
3 +++ shadow-4.0.0/src/groupadd.c Thu Oct 18 10:41:15 2001
5 static int oflg = 0; /* permit non-unique group ID to be specified with -g */
6 static int gflg = 0; /* ID value for the new group */
7 static int fflg = 0; /* if group already exists, do nothing and exit(0) */
8 +static int rflg = 0; /* for adding system accounts */
12 extern int gr_dbm_mode;
17 - fprintf(stderr, _("usage: groupadd [-g gid [-o]] group\n"));
18 + fprintf(stderr, _("usage: groupadd [-g gid [-o]] [-r] [-f] group\n"));
23 const struct group *grp;
24 gid_t gid_min, gid_max;
26 - gid_min = getdef_num("GID_MIN", 100);
28 + gid_min = getdef_num("GID_MIN", 500);
29 gid_max = getdef_num("GID_MAX", 60000);
32 + gid_max = getdef_num("GID_MIN", 499);
36 * Start with some GID value if the user didn't provide us with
41 - while ((arg = getopt(argc, argv, "og:O:f")) != EOF) {
42 + while ((arg = getopt(argc, argv, "og:O:fr")) != EOF) {
52 + * create system group
59 diff -Nur shadow-4.0.0.orig/src/useradd.c shadow-4.0.0/src/useradd.c
60 --- shadow-4.0.0.orig/src/useradd.c Fri Sep 7 17:12:54 2001
61 +++ shadow-4.0.0/src/useradd.c Thu Oct 18 10:51:10 2001
64 * These defaults are used if there is no defaults file.
66 -static gid_t def_group = 100;
67 +static gid_t def_group = 1000;
68 static const char *def_gname = "other";
69 -static const char *def_home = "/home";
70 -static const char *def_shell = "";
71 +static const char *def_home = "/home/users";
72 +static const char *def_shell = "/dev/null";
73 static const char *def_template = SKEL_DIR;
75 static long def_inactive = -1;
77 #define VALID(s) (strcspn (s, ":\n") == strlen (s))
79 static const char *user_name = "";
80 -static const char *user_pass = "!";
81 +static const char *user_pass = "!!";
83 static gid_t user_gid;
84 static const char *user_comment = "";
86 sflg = 0, /* shell program for new account */
87 cflg = 0, /* comment (GECOS) field for new account */
88 mflg = 0, /* create user's home directory if it doesn't exist */
89 + Mflg = 0, /* don't create user's home directory */
90 kflg = 0, /* specify a directory to fill new user directory */
91 fflg = 0, /* days until account with expired password is locked */
92 eflg = 0, /* days since 1970-01-01 when account is locked */
93 Dflg = 0, /* set/show new user default values */
94 + rflg = 0, /* system account */
95 nflg = 0; /* create a group having the same name as the user */
101 #define E_SUCCESS 0 /* success */
102 +#define E_LOCKING 1 /* locking error */
103 #define E_PW_UPDATE 1 /* can't update password file */
104 #define E_USAGE 2 /* bad command syntax */
105 #define E_BAD_ARG 3 /* invalid argument to option */
108 fprintf(stderr, _("[-A program] "));
110 - fprintf(stderr, _("[-p passwd] name\n"));
111 + fprintf(stderr, _("[-p passwd] [-n] [-r] name\n"));
113 fprintf(stderr, _(" %s\t-D [-g group] [-b base] [-s shell]\n"),
117 const struct passwd *pwd;
118 uid_t uid_min, uid_max;
120 - uid_min = getdef_num("UID_MIN", 100);
123 + uid_min = getdef_num("UID_MIN", 500);
124 uid_max = getdef_num("UID_MAX", 60000);
131 * Start with some UID value if the user didn't provide us with
132 @@ -1143,9 +1151,9 @@
136 -#define FLAGS "A:Du:og:G:d:s:c:mk:p:f:e:b:O:M"
137 +#define FLAGS "A:Du:og:G:d:s:c:mk:p:f:e:b:O:Mnr"
139 -#define FLAGS "A:Du:og:G:d:s:c:mk:p:b:O:M"
140 +#define FLAGS "A:Du:og:G:d:s:c:mk:p:b:O:Mnr"
142 while ((arg = getopt(argc, argv, FLAGS)) != EOF) {
144 @@ -1278,6 +1286,9 @@
153 * override login.defs defaults (-O name=value)
154 @@ -1304,6 +1315,9 @@
158 + case 'r': /* system account */
162 if (!VALID(optarg) || (optarg[0] &&
163 (optarg[0] != '/' && optarg[0] != '*'))) {
164 @@ -1329,7 +1343,9 @@
165 * Certain options are only valid in combination with others.
166 * Check it here so that they can be specified in any order.
168 - if ((oflg && !uflg) || (kflg && !mflg))