[Pkg-shadow-commits] r864 - trunk/debian/patches
Christian Perrier
bubulle at costa.debian.org
Tue Feb 14 13:27:09 UTC 2006
Author: bubulle
Date: 2006-02-14 13:27:09 +0000 (Tue, 14 Feb 2006)
New Revision: 864
Added:
trunk/debian/patches/467_useradd_-r_LSB
Removed:
trunk/debian/patches/466_useradd_-r_LSB
Log:
Rename the 466 patch to avoid confusion
Deleted: trunk/debian/patches/466_useradd_-r_LSB
===================================================================
--- trunk/debian/patches/466_useradd_-r_LSB 2006-02-14 13:26:29 UTC (rev 863)
+++ trunk/debian/patches/466_useradd_-r_LSB 2006-02-14 13:27:09 UTC (rev 864)
@@ -1,134 +0,0 @@
-Goal: Add a "-r" option to useradd
-
-Fixes: #333706
-
-Status wrt upstream: Forwarded but not applied yet. Not sure that upstream
- is really ready to apply it. We apply it anyway because
- LSB compliance is important for Debian
-
-Index: shadow-4.0.14/src/useradd.c
-===================================================================
---- shadow-4.0.14.orig/src/useradd.c 2006-02-14 13:51:51.330033243 +0100
-+++ shadow-4.0.14/src/useradd.c 2006-02-14 13:52:04.908279473 +0100
-@@ -127,6 +127,7 @@
- mflg = 0, /* create user's home directory if it doesn't exist */
- nflg = 0, /* create a group having the same name as the user */
- oflg = 0, /* permit non-unique user ID to be specified with -u */
-+ rflg = 0, /* create a system account (LSB compliance) */
- sflg = 0, /* shell program for new account */
- uflg = 0; /* specify user ID for new account */
-
-@@ -633,6 +634,7 @@
- " (non-unique) UID\n"
- " -p, --password PASSWORD use encrypted password for the new user\n"
- " account\n"
-+ " -r, --system create a system account\n"
- " -s, --shell SHELL the login shell for the new user account\n"
- " -u, --uid UID force use the UID for the new user account\n"));
- exit (E_USAGE);
-@@ -680,11 +682,19 @@
- spent->sp_namp = (char *) user_name;
- spent->sp_pwdp = (char *) user_pass;
- spent->sp_lstchg = time ((time_t *) 0) / SCALE;
-- spent->sp_min = scale_age (getdef_num ("PASS_MIN_DAYS", -1));
-- spent->sp_max = scale_age (getdef_num ("PASS_MAX_DAYS", -1));
-- spent->sp_warn = scale_age (getdef_num ("PASS_WARN_AGE", -1));
-- spent->sp_inact = scale_age (def_inactive);
-- spent->sp_expire = scale_age (user_expire);
-+ if (!rflg) {
-+ spent->sp_min = scale_age (getdef_num ("PASS_MIN_DAYS", -1));
-+ spent->sp_max = scale_age (getdef_num ("PASS_MAX_DAYS", -1));
-+ spent->sp_warn = scale_age (getdef_num ("PASS_WARN_AGE", -1));
-+ spent->sp_inact = scale_age (def_inactive);
-+ spent->sp_expire = scale_age (user_expire);
-+ } else {
-+ spent->sp_min = scale_age(-1);
-+ spent->sp_max = scale_age(-1);
-+ spent->sp_warn = scale_age(-1);
-+ spent->sp_inact = scale_age(-1);
-+ spent->sp_expire = scale_age(-1);
-+ }
- spent->sp_flag = -1;
- }
-
-@@ -832,8 +842,13 @@
- const struct passwd *pwd;
- uid_t uid_min, uid_max;
-
-- uid_min = getdef_unum ("UID_MIN", 1000);
-- uid_max = getdef_unum ("UID_MAX", 60000);
-+ if (!rflg) {
-+ uid_min = getdef_unum ("UID_MIN", 1000);
-+ uid_max = getdef_unum ("UID_MAX", 60000);
-+ } else {
-+ uid_min = 1;
-+ uid_max = getdef_unum ("UID_MIN", 1000) - 1;
-+ }
-
- /*
- * Start with some UID value if the user didn't provide us with
-@@ -1012,12 +1027,13 @@
- {"create-home", no_argument, NULL, 'm'},
- {"non-unique", no_argument, NULL, 'o'},
- {"password", required_argument, NULL, 'p'},
-+ {"system", no_argument, NULL, 'r'},
- {"shell", required_argument, NULL, 's'},
- {"uid", required_argument, NULL, 'u'},
- {NULL, 0, NULL, '\0'}
- };
- while ((c =
-- getopt_long (argc, argv, "b:c:d:De:f:g:G:k:O:K:mMop:s:u:",
-+ getopt_long (argc, argv, "b:c:d:De:f:g:G:k:O:K:mMop:rs:u:",
- long_options, NULL)) != -1) {
- switch (c) {
- case 'b':
-@@ -1171,6 +1187,9 @@
- }
- user_pass = optarg;
- break;
-+ case 'r':
-+ rflg++;
-+ break;
- case 's':
- if (!VALID (optarg)
- || (optarg[0]
-@@ -1556,23 +1575,25 @@
- */
- static void create_home (void)
- {
-- if (access (user_home, F_OK)) {
-- /* XXX - create missing parent directories. --marekm */
-- if (mkdir (user_home, 0)) {
-- fprintf (stderr,
-- _
-- ("%s: cannot create directory %s\n"),
-- Prog, user_home);
-- fail_exit (E_HOMEDIR);
-- }
-- chown (user_home, user_id, user_gid);
-- chmod (user_home, 0777 & ~getdef_num ("UMASK", 022));
-- home_added++;
-+ if (!rflg) /* for system accounts defaults are ignored and we
-+ * do not create a home dir -- gafton */
-+ if (access (user_home, F_OK)) {
-+ /* XXX - create missing parent directories. --marekm */
-+ if (mkdir (user_home, 0)) {
-+ fprintf (stderr,
-+ _
-+ ("%s: cannot create directory %s\n"),
-+ Prog, user_home);
-+ fail_exit (E_HOMEDIR);
-+ }
-+ chown (user_home, user_id, user_gid);
-+ chmod (user_home, 0777 & ~getdef_num ("UMASK", 022));
-+ home_added++;
- #ifdef WITH_AUDIT
-- audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
-+ audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
- "adding home directory", user_name, user_id, 1);
- #endif
-- }
-+ }
- }
-
- /*
Copied: trunk/debian/patches/467_useradd_-r_LSB (from rev 863, trunk/debian/patches/466_useradd_-r_LSB)
More information about the Pkg-shadow-commits
mailing list