1 diff -Naur shadow-19990827/src/groupadd.c shadow-19990827-patched/src/groupadd.c
2 --- shadow-19990827/src/groupadd.c Mon Jun 7 18:40:45 1999
3 +++ shadow-19990827-patched/src/groupadd.c Wed Apr 12 12:25:07 2000
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);
33 + gid_max = getdef_num("GID_MIN", 499);
36 * Start with some GID value if the user didn't provide us with
42 - while ((arg = getopt(argc, argv, "og:O:f")) != EOF) {
43 + while ((arg = getopt(argc, argv, "og:O:fr")) != EOF) {
48 * RedHat's patch from shadow-utils-970616-9.
54 + * create system group
60 diff -Naur shadow-19990827/src/useradd.c shadow-19990827-patched/src/useradd.c
61 --- shadow-19990827/src/useradd.c Mon Jun 7 18:40:45 1999
62 +++ shadow-19990827-patched/src/useradd.c Wed Apr 12 12:25:41 2000
65 * These defaults are used if there is no defaults file.
67 -static gid_t def_group = 100;
68 +static gid_t def_group = 1000;
69 static const char *def_gname = "other";
70 -static const char *def_home = "/home";
71 -static const char *def_shell = "";
72 +static const char *def_home = "/home/users";
73 +static const char *def_shell = "/dev/null";
74 static const char *def_template = SKEL_DIR;
76 static long def_inactive = -1;
78 #define VALID(s) (strcspn (s, ":\n") == strlen (s))
80 static const char *user_name = "";
81 -static const char *user_pass = "!";
82 +static const char *user_pass = "!!";
84 static gid_t user_gid;
85 static const char *user_comment = "";
87 sflg = 0, /* shell program for new account */
88 cflg = 0, /* comment (GECOS) field for new account */
89 mflg = 0, /* create user's home directory if it doesn't exist */
90 + nflg = 0, /* no group for this user */
91 kflg = 0, /* specify a directory to fill new user directory */
92 + Mflg = 0, /* don't crate user's home directory */
93 fflg = 0, /* days until account with expired password is locked */
94 eflg = 0, /* days since 1970-01-01 when account is locked */
95 - Dflg = 0; /* set/show new user default values */
96 + Dflg = 0, /* set/show new user default values */
97 + rflg = 0; /* system account */
100 static int Aflg = 0; /* specify authentication method for user */
104 #define E_SUCCESS 0 /* success */
105 +#define E_LOCKING 1 /* locking error */
106 #define E_PW_UPDATE 1 /* can't update password file */
107 #define E_USAGE 2 /* bad command syntax */
108 #define E_BAD_ARG 3 /* invalid argument to option */
111 fprintf(stderr, _("[-A program] "));
113 - fprintf(stderr, _("[-p passwd] name\n"));
114 + fprintf(stderr, _("[-p passwd] [-n] [-r] name\n"));
116 fprintf(stderr, _(" %s\t-D [-g group] [-b base] [-s shell]\n"),
118 @@ -968,10 +972,13 @@
120 const struct passwd *pwd;
121 uid_t uid_min, uid_max;
123 - uid_min = getdef_num("UID_MIN", 100);
125 + uid_min = getdef_num("UID_MIN", 500);
126 uid_max = getdef_num("UID_MAX", 60000);
133 * Start with some UID value if the user didn't provide us with
135 @@ -1126,9 +1133,9 @@
139 -#define FLAGS "A:Du:og:G:d:s:c:mk:p:f:e:b:O:M"
140 +#define FLAGS "A:Du:og:G:d:s:c:mk:p:f:e:b:O:M:nr"
142 -#define FLAGS "A:Du:og:G:d:s:c:mk:p:b:O:M"
143 +#define FLAGS "A:Du:og:G:d:s:c:mk:p:b:O:M:nr"
145 while ((arg = getopt(argc, argv, FLAGS)) != EOF) {
147 @@ -1261,6 +1268,12 @@
159 * override login.defs defaults (-O name=value)
160 @@ -1312,9 +1325,10 @@
161 * Certain options are only valid in combination with others.
162 * Check it here so that they can be specified in any order.
164 - if ((oflg && !uflg) || (kflg && !mflg))
171 * Either -D or username is required. Defaults can be set with -D
172 * for the -b, -e, -f, -g, -s options only.