[Pkg-shadow-commits] r307 - trunk/debian/patches

Nicolas FRANCOIS pkg-shadow-devel@lists.alioth.debian.org
Sun, 26 Jun 2005 23:37:51 +0000


Author: nekral-guest
Date: 2005-06-26 23:37:50 +0000 (Sun, 26 Jun 2005)
New Revision: 307

Added:
   trunk/debian/patches/427_chage_expiry_0
Modified:
   trunk/debian/patches/series
Log:
Add a patch for #78961.


Added: trunk/debian/patches/427_chage_expiry_0
===================================================================
--- trunk/debian/patches/427_chage_expiry_0	2005-06-26 21:41:54 UTC (rev 306)
+++ trunk/debian/patches/427_chage_expiry_0	2005-06-26 23:37:50 UTC (rev 307)
@@ -0,0 +1,53 @@
+Goal: Fix chage display for expiry fields set to 0.
+Fixes: #78961
+
+Status wrt upstream: It should be forwarded to upstream.
+
+Note: On Debian, PAM deals unconsistently with these fields when they are
+      set to 0. See #308229.
+
+Index: shadow-4.0.3/src/chage.c
+===================================================================
+--- shadow-4.0.3.orig/src/chage.c	2005-06-27 00:38:26.000000000 +0200
++++ shadow-4.0.3/src/chage.c	2005-06-27 01:17:01.138559000 +0200
+@@ -260,8 +260,10 @@
+ 	 */
+ 
+ 	printf (_("Last Change:\t\t"));
+-	if (lastday <= 0) {
++	if (lastday < 0) {
+ 		printf (_("Never\n"));
++	} else if (lastday == 0) {
++		printf (_("Password must be changed\n"));
+ 	} else {
+ 		changed = lastday * SCALE;
+ 		print_date (changed);
+@@ -274,7 +276,7 @@
+ 
+ 	printf (_("Password Expires:\t"));
+ 	if (lastday <= 0 || maxdays >= 10000 * (DAY / SCALE)
+-	    || maxdays <= 0) {
++	    || maxdays < 0) {
+ 		printf (_("Never\n"));
+ 	} else {
+ 		expires = changed + maxdays * SCALE;
+@@ -290,8 +292,8 @@
+ 	 */
+ 
+ 	printf (_("Password Inactive:\t"));
+-	if (lastday <= 0 || inactdays <= 0 ||
+-	    maxdays >= 10000 * (DAY / SCALE) || maxdays <= 0) {
++	if (lastday <= 0 || inactdays < 0 ||
++	    maxdays >= 10000 * (DAY / SCALE) || maxdays < 0) {
+ 		printf (_("Never\n"));
+ 	} else {
+ 		expires = changed + (maxdays + inactdays) * SCALE;
+@@ -304,7 +306,7 @@
+ 	 */
+ 
+ 	printf (_("Account Expires:\t"));
+-	if (expdays <= 0) {
++	if (expdays < 0) {
+ 		printf (_("Never\n"));
+ 	} else {
+ 		expires = expdays * SCALE;

Modified: trunk/debian/patches/series
===================================================================
--- trunk/debian/patches/series	2005-06-26 21:41:54 UTC (rev 306)
+++ trunk/debian/patches/series	2005-06-26 23:37:50 UTC (rev 307)
@@ -127,3 +127,4 @@
 425_lastlog_8_sparse
 357_newgrp-stop_cont-proxy
 #426_grpck_group-gshadow_members_consistency
+427_chage_expiry_0