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

nekral-guest at alioth.debian.org nekral-guest at alioth.debian.org
Sat Nov 17 16:40:39 UTC 2007


Author: nekral-guest
Date: 2007-11-17 16:40:39 +0000 (Sat, 17 Nov 2007)
New Revision: 1370

Modified:
   upstream/trunk/ChangeLog
   upstream/trunk/man/passwd.1.xml
   upstream/trunk/src/passwd.c
Log:
-l/-u options: edit the shadow account expiry field *in addition* to
editing the password field.  Debian patch 494_passwd_lock.


Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog	2007-11-17 16:33:33 UTC (rev 1369)
+++ upstream/trunk/ChangeLog	2007-11-17 16:40:39 UTC (rev 1370)
@@ -1,5 +1,11 @@
 2007-11-17  Nicolas François  <nicolas.francois at centraliens.net>
 
+	* src/passwd.c, man/passwd.1.xml: -l/-u options: edit the
+	shadow account expiry field *in addition* to editing the password
+	field.  Debian patch 494_passwd_lock.
+
+2007-11-17  Nicolas François  <nicolas.francois at centraliens.net>
+
 	* src/newgrp.c: Do not request a password when a user uses newgrp
 	to switch to her primary group.
 	Debian patch 497_newgrp_primary_group.

Modified: upstream/trunk/man/passwd.1.xml
===================================================================
--- upstream/trunk/man/passwd.1.xml	2007-11-17 16:33:33 UTC (rev 1369)
+++ upstream/trunk/man/passwd.1.xml	2007-11-17 16:40:39 UTC (rev 1370)
@@ -214,7 +214,8 @@
 	<listitem>
 	  <para>
 	    Lock the named account. This option disables an account by changing
-	    the password to a value which matches no possible encrypted value.
+	    the password to a value which matches no possible encrypted value,
+	    and by setting the account expiry field to 1.
 	  </para>
 	</listitem>
       </varlistentry>
@@ -275,7 +276,8 @@
 	  <para>
 	    Unlock the named account. This option re-enables an account by
 	    changing the password back to its previous value (to value before
-	    using <option>-l</option> option).
+	    using <option>-l</option> option), and by resetting the account
+	    expiry field.
 	  </para>
 	</listitem>
       </varlistentry>

Modified: upstream/trunk/src/passwd.c
===================================================================
--- upstream/trunk/src/passwd.c	2007-11-17 16:33:33 UTC (rev 1369)
+++ upstream/trunk/src/passwd.c	2007-11-17 16:40:39 UTC (rev 1370)
@@ -531,6 +531,15 @@
 		nsp->sp_inact = (inact * DAY) / SCALE;
 	if (do_update_age)
 		nsp->sp_lstchg = time ((time_t *) 0) / SCALE;
+	if (lflg) {
+		/* Set the account expiry field to 1.
+		 * Some PAM implementation consider zero as a non expired
+		 * account.
+		 */
+		nsp->sp_expire = 1;
+	}
+	if (uflg)
+		nsp->sp_expire = -1;
 
 	/*
 	 * Force change on next login, like SunOS 4.x passwd -e or Solaris




More information about the Pkg-shadow-commits mailing list