[Pkg-shadow-commits] r1491 - in upstream/trunk: . man src

nekral-guest at alioth.debian.org nekral-guest at alioth.debian.org
Wed Dec 26 10:15:21 UTC 2007


Author: nekral-guest
Date: 2007-12-26 10:15:20 +0000 (Wed, 26 Dec 2007)
New Revision: 1491

Modified:
   upstream/trunk/ChangeLog
   upstream/trunk/NEWS
   upstream/trunk/man/useradd.8.xml
   upstream/trunk/src/useradd.c
Log:
Add option -l to avoid adding the user to the lastlog and faillog databases

Fix the release numbers for the current NEWS entries.


Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog	2007-12-26 10:13:57 UTC (rev 1490)
+++ upstream/trunk/ChangeLog	2007-12-26 10:15:20 UTC (rev 1491)
@@ -1,5 +1,10 @@
 2007-12-26  Nicolas François  <nicolas.francois at centraliens.net>
 
+	* NEWS, src/useradd.c, man/useradd.8.xml: Add option -l to avoid adding
+	the user to the lastlog and faillog databases.
+
+2007-12-26  Nicolas François  <nicolas.francois at centraliens.net>
+
 	* src/useradd.c, src/groupadd.c: NO_GETPWENT is no more supported. Remove
 	associated chunks of code.
 

Modified: upstream/trunk/NEWS
===================================================================
--- upstream/trunk/NEWS	2007-12-26 10:13:57 UTC (rev 1490)
+++ upstream/trunk/NEWS	2007-12-26 10:15:20 UTC (rev 1491)
@@ -1,10 +1,12 @@
 $Id$
 
-shadow-4.0.18.2 -> shadow-4.1.0						UNRELEASED
+shadow-4.1.0 -> shadow-4.1.1						UNRELEASED
 
 *** general:
 - packaging
-  Do not install the shadow library per default.
+  * Do not install the shadow library per default.
+- useradd
+  * New option -l to avoid adding the user to the lastlog and faillog databases.
 
 shadow-4.0.18.2 -> shadow-4.1.0						09-12-2008
 

Modified: upstream/trunk/man/useradd.8.xml
===================================================================
--- upstream/trunk/man/useradd.8.xml	2007-12-26 10:13:57 UTC (rev 1490)
+++ upstream/trunk/man/useradd.8.xml	2007-12-26 10:15:20 UTC (rev 1491)
@@ -226,6 +226,19 @@
 	</listitem>
       </varlistentry>
       <varlistentry>
+	<term><option>-l</option></term>
+	<listitem>
+	  <para>
+	    Do not add the user to the lastlog and faillog databases.
+	  </para>
+	  <para>
+	    By default, the user's entries in the lastlog and faillog
+	    databases are resetted to avoid reusing the entry from a previously
+	    deleted user.
+	  </para>
+	</listitem>
+      </varlistentry>
+      <varlistentry>
 	<term>
 	  <option>-o</option>, <option>--non-unique</option>
 	</term>

Modified: upstream/trunk/src/useradd.c
===================================================================
--- upstream/trunk/src/useradd.c	2007-12-26 10:13:57 UTC (rev 1490)
+++ upstream/trunk/src/useradd.c	2007-12-26 10:15:20 UTC (rev 1491)
@@ -123,6 +123,7 @@
     gflg = 0,			/* primary group ID for new account */
     Gflg = 0,			/* secondary group set for new account */
     kflg = 0,			/* specify a directory to fill new user directory */
+    lflg = 0,			/* do not add user to lastlog database file */
     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 */
@@ -630,6 +631,8 @@
 			   "  -h, --help                    display this help message and exit\n"
 			   "  -k, --skel SKEL_DIR           specify an alternative skel directory\n"
 			   "  -K, --key KEY=VALUE           overrides /etc/login.defs defaults\n"
+			   "  -l,                           do not add the user to the lastlog and\n"
+			   "                                faillog databases\n"
 			   "  -m, --create-home             create home directory for the new user\n"
 			   "                                account\n"
 			   "  -o, --non-unique              allow create user with duplicate\n"
@@ -974,7 +977,7 @@
 			{NULL, 0, NULL, '\0'}
 		};
 		while ((c =
-			getopt_long (argc, argv, "b:c:d:De:f:g:G:k:K:mMop:s:u:",
+			getopt_long (argc, argv, "b:c:d:De:f:g:G:k:K:lmMop:s:u:",
 				     long_options, NULL)) != -1) {
 			switch (c) {
 			case 'b':
@@ -1108,6 +1111,9 @@
 				if (putdef_str (optarg, cp) < 0)
 					exit (E_BAD_ARG);
 				break;
+			case 'l':
+				lflg++;
+				break;
 			case 'm':
 				mflg++;
 				break;
@@ -1468,7 +1474,7 @@
 	 * are left unchanged).  --marekm
 	 */
 	/* local, no need for xgetpwuid */
-	if (!getpwuid (user_id)) {
+	if ((!lflg) && (getpwuid (user_id) == NULL)) {
 		faillog_reset (user_id);
 		lastlog_reset (user_id);
 	}




More information about the Pkg-shadow-commits mailing list