]> git.pld-linux.org Git - packages/shadow.git/blame - shadow-chage_expdays.patch
- remove getspnam.3 and shadow.3 which are in glibc-devel
[packages/shadow.git] / shadow-chage_expdays.patch
CommitLineData
60286d9a 1diff -urN shadow-4.0.6.orig/src/chage.c shadow-4.0.6/src/chage.c
2--- shadow-4.0.6.orig/src/chage.c 2004-11-18 15:47:10.970295408 +0100
3+++ shadow-4.0.6/src/chage.c 2004-11-18 21:36:19.617616944 +0100
4@@ -84,7 +84,7 @@
5 extern int sp_dbm_mode;
883d7600 6 #endif
d6ecb3f3 7
60286d9a 8-#define EPOCH "1969-12-31"
9+#define EPOCH_SHORT "12/31/69"
d6ecb3f3 10
883d7600 11 /* local function prototypes */
12 static void usage (void);
60286d9a 13@@ -168,7 +168,7 @@
14 change_field (buf, sizeof buf,
15 _("Last Password Change (YYYY-MM-DD)"));
16
17- if (strcmp (buf, EPOCH) == 0)
18+ if (strcmp (buf, EPOCH_SHORT) == 0)
19 lastday = -1;
20 else if ((lastday = strtoday (buf)) == -1)
21 return 0;
22@@ -190,7 +190,7 @@
23 change_field (buf, sizeof buf,
24 _("Account Expiration Date (YYYY-MM-DD)"));
25
26- if (strcmp (buf, EPOCH) == 0)
27+ if (strcmp (buf, EPOCH_SHORT) == 0)
28 expdays = -1;
29 else if ((expdays = strtoday (buf)) == -1)
30 return 0;
31@@ -279,7 +279,7 @@
650a2b39 32 */
33
60286d9a 34 printf (_("Account expires\t\t\t\t\t\t: "));
650a2b39 35- if (expdays <= 0) {
36+ if (expdays == -1) {
60286d9a 37 printf (_("never\n"));
650a2b39 38 } else {
39 expires = expdays * SCALE;
60286d9a 40@@ -422,7 +422,11 @@
883d7600 41 case 'E':
42 Eflg++;
43 if (!isnum (optarg))
44- expdays = strtoday (optarg);
60286d9a 45+ if (strcmp (optarg, EPOCH_SHORT) == 0)
46+ expdays = -1;
47+ else
48+ expdays = strtoday (optarg);
49+
883d7600 50 else
51 expdays = strtol (optarg, 0, 10);
52 break;
This page took 0.053569 seconds and 4 git commands to generate.