]> git.pld-linux.org Git - packages/shadow.git/blob - shadow-chage_expdays.patch
- do not set ERASECHAR and KILLCHAR in config (assume shadow does the right thing)
[packages/shadow.git] / shadow-chage_expdays.patch
1 diff -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;
6  #endif
7  
8 -#define        EPOCH           "1969-12-31"
9 +#define        EPOCH_SHORT     "12/31/69"
10  
11  /* local function prototypes */
12  static void usage (void);
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 @@
32          */
33  
34         printf (_("Account expires\t\t\t\t\t\t: "));
35 -       if (expdays <= 0) {
36 +       if (expdays == -1) {
37                 printf (_("never\n"));
38         } else {
39                 expires = expdays * SCALE;
40 @@ -422,7 +422,11 @@
41                 case 'E':
42                         Eflg++;
43                         if (!isnum (optarg))
44 -                               expdays = strtoday (optarg);
45 +                                 if (strcmp (optarg, EPOCH_SHORT) == 0)
46 +                                         expdays = -1;
47 +                                 else
48 +                                         expdays = strtoday (optarg);
49 +                                       
50                         else
51                                 expdays = strtol (optarg, 0, 10);
52                         break;
This page took 0.068116 seconds and 3 git commands to generate.