From 52af2aa829f0e4c536af1a1bc4b0a9772304c7f0 Mon Sep 17 00:00:00 2001 From: nekral-guest Date: Sun, 28 Oct 2007 17:07:45 +0000 Subject: [PATCH] Update for 4.0.18.2. Simplification of the patch. Prefer maintainability to indentation. --- debian/patches/467_useradd_-r_LSB | 67 +++++++++---------------------- 1 file changed, 19 insertions(+), 48 deletions(-) diff --git a/debian/patches/467_useradd_-r_LSB b/debian/patches/467_useradd_-r_LSB index b695374d..a9636f21 100644 --- a/debian/patches/467_useradd_-r_LSB +++ b/debian/patches/467_useradd_-r_LSB @@ -6,10 +6,10 @@ 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.18.1/src/useradd.c +Index: shadow-4.0.18.2/src/useradd.c =================================================================== ---- shadow-4.0.18.1.orig/src/useradd.c 2006-09-17 12:18:01.140062412 +0200 -+++ shadow-4.0.18.1/src/useradd.c 2006-09-17 12:18:05.004093135 +0200 +--- shadow-4.0.18.2.orig/src/useradd.c 2007-10-28 17:20:37.000000000 +0100 ++++ shadow-4.0.18.2/src/useradd.c 2007-10-28 18:04:50.000000000 +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 */ @@ -18,7 +18,7 @@ Index: shadow-4.0.18.1/src/useradd.c sflg = 0, /* shell program for new account */ uflg = 0; /* specify user ID for new account */ -@@ -638,6 +639,7 @@ +@@ -639,6 +640,7 @@ " (non-unique) UID\n" " -p, --password PASSWORD use encrypted password for the new user\n" " account\n" @@ -26,7 +26,7 @@ Index: shadow-4.0.18.1/src/useradd.c " -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" "\n")); -@@ -686,11 +688,19 @@ +@@ -687,11 +689,19 @@ spent->sp_namp = (char *) user_name; spent->sp_pwdp = (char *) user_pass; spent->sp_lstchg = time ((time_t *) 0) / SCALE; @@ -51,7 +51,7 @@ Index: shadow-4.0.18.1/src/useradd.c spent->sp_flag = -1; } -@@ -838,8 +848,13 @@ +@@ -839,8 +849,13 @@ const struct passwd *pwd; uid_t uid_min, uid_max; @@ -67,7 +67,7 @@ Index: shadow-4.0.18.1/src/useradd.c /* * Start with some UID value if the user didn't provide us with -@@ -1018,12 +1033,13 @@ +@@ -1019,12 +1034,13 @@ {"create-home", no_argument, NULL, 'm'}, {"non-unique", no_argument, NULL, 'o'}, {"password", required_argument, NULL, 'p'}, @@ -82,7 +82,7 @@ Index: shadow-4.0.18.1/src/useradd.c long_options, NULL)) != -1) { switch (c) { case 'b': -@@ -1177,6 +1193,9 @@ +@@ -1178,6 +1194,9 @@ } user_pass = optarg; break; @@ -92,49 +92,20 @@ Index: shadow-4.0.18.1/src/useradd.c case 's': if (!VALID (optarg) || (optarg[0] -@@ -1569,24 +1588,27 @@ +@@ -1570,6 +1589,8 @@ */ 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", GETDEF_DEFAULT_UMASK)); -- home_added++; --#ifdef WITH_AUDIT -- audit_logger (AUDIT_USER_CHAUTHTOK, Prog, -- "adding home directory", user_name, user_id, 1); --#endif -- } -+ 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", GETDEF_DEFAULT_UMASK)); -+ home_added++; -+ #ifdef WITH_AUDIT -+ audit_logger (AUDIT_USER_CHAUTHTOK, Prog, -+ "adding home directory", user_name, user_id, 1); -+ #endif -+ } -+ } ++ 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)) { +@@ -1593,6 +1614,7 @@ + "adding home directory", user_name, user_id, 1); + #endif + } ++ } } /*