967e600
--- shadow-4.0.17/man/useradd.8.lOption	2006-11-02 18:23:50.000000000 +0100
967e600
+++ shadow-4.0.17/man/useradd.8	2006-11-02 18:23:50.000000000 +0100
045376f
@@ -96,6 +96,9 @@
045376f
 \fB\-m\fR
045376f
 option. The default is to not create the directory and to not copy any files.
045376f
 .TP 3n
045376f
+\fB-l\fR
045376f
+Do not add the user to the last login log file. This is an option added by Red Hat.
045376f
+.TP 3n
045376f
 \fB-n\fR
045376f
 A group having the same name as the user being added to the system will be created by default. This option will turn off this Red Hat Linux specific behavior. When this option is used, users by default will be placed in whatever group is specified in \fI/etc/default/useradd\fR. If no default group is defined, group 1 will be used.
045376f
 .TP 3n
967e600
--- shadow-4.0.17/src/useradd.c.lOption	2006-11-02 18:23:50.000000000 +0100
967e600
+++ shadow-4.0.17/src/useradd.c	2006-11-02 18:26:46.000000000 +0100
045376f
@@ -124,6 +124,7 @@
045376f
     Gflg = 0,			/* secondary group set for new account */
045376f
     kflg = 0,			/* specify a directory to fill new user directory */
045376f
     mflg = 0,			/* create user's home directory if it doesn't exist */
045376f
+    lflg = 0;      		/* do not add user to lastlog database file */
045376f
     Mflg = 0,                   /* do NOT create user's home directory no matter what */
045376f
     nflg = 0,                   /* do NOT create a group having the same name as the user */
045376f
     oflg = 0,			/* permit non-unique user ID to be specified with -u */
045376f
@@ -630,6 +631,7 @@
045376f
 			   "  -K, --key KEY=VALUE		overrides /etc/login.defs defaults\n"
045376f
 			   "  -m, --create-home		create home directory for the new user\n"
045376f
 			   "				account\n"
045376f
+			   "  -l,                       do not add user to lastlog database file\n"
045376f
 			   "  -M,                       do not create user's home directory(overrides /etc/login.defs)\n"
045376f
 			   "  -r,                       create system account\n"
045376f
 			   "  -o, --non-unique		allow create user with duplicate\n"
967e600
@@ -1041,7 +1043,7 @@
045376f
 			{NULL, 0, NULL, '\0'}
045376f
 		};
045376f
 		while ((c =
045376f
-			getopt_long (argc, argv, "b:c:d:De:f:g:G:k:K:mMnrop:s:u:",
045376f
+			getopt_long (argc, argv, "b:c:d:De:f:g:G:k:K:mlMnrop:s:u:",
045376f
 				     long_options, NULL)) != -1) {
045376f
 			switch (c) {
045376f
 			case 'b':
967e600
@@ -1181,6 +1183,9 @@
045376f
 			case 'm':
045376f
 				mflg++;
045376f
 				break;
045376f
+			case 'l':
045376f
+	                        lflg++;
045376f
+                        	break;
045376f
 			case 'o':
045376f
 				oflg++;
045376f
 				break;
967e600
@@ -1549,7 +1554,7 @@
967e600
 	 * no user with this UID exists yet (entries for shared UIDs
967e600
 	 * are left unchanged).  --marekm
045376f
 	 */
967e600
-	if (!getpwuid (user_id)) {
967e600
+	if (!getpwuid (user_id) && !lflg) {
045376f
 		faillog_reset (user_id);
967e600
 		lastlog_reset (user_id);
045376f
 	}