]> git.pld-linux.org Git - packages/shadow.git/blob - shadow-chage_expdays.patch
880ebbaff211da63b13a16f3c2218854922665e8
[packages/shadow.git] / shadow-chage_expdays.patch
1 --- shadow-4.0.6/src/chage.c    2004-11-18 21:36:19.617616944 +0100
2 +++ shadow-4.0.16/src/chage.c   2006-06-08 00:30:20.837211299 +0300
3 @@ -84,7 +84,7 @@
4  extern int sp_dbm_mode;
5  #endif
6  
7 -#define        EPOCH           "1969-12-31"
8 +#define        EPOCH_SHORT     "12/31/69"
9  
10  /* local function prototypes */
11  static void usage (void);
12 @@ -168,7 +168,7 @@
13         change_field (buf, sizeof buf,
14                       _("Last Password Change (YYYY-MM-DD)"));
15  
16 -       if (strcmp (buf, EPOCH) == 0)
17 +       if (strcmp (buf, EPOCH_SHORT) == 0)
18                 lastday = -1;
19         else if ((lastday = strtoday (buf)) == -1)
20                 return 0;
21 @@ -190,7 +190,7 @@
22         change_field (buf, sizeof buf,
23                       _("Account Expiration Date (YYYY-MM-DD)"));
24  
25 -       if (strcmp (buf, EPOCH) == 0)
26 +       if (strcmp (buf, EPOCH_SHORT) == 0)
27                 expdays = -1;
28         else if ((expdays = strtoday (buf)) == -1)
29                 return 0;
30 @@ -274,7 +274,7 @@
31          * password expiring or not.
32          */
33         printf (_("Account expires\t\t\t\t\t\t: "));
34 -       if (expdays < 0) {
35 +       if (expdays == -1) {
36                 printf (_("never\n"));
37         } else {
38                 expires = expdays * SCALE;
39 @@ -403,7 +403,10 @@
40                         case 'E':
41                                 Eflg++;
42                                 if (!isnum (optarg))
43 -                                       expdays = strtoday (optarg);
44 +                                       if (strcmp (optarg, EPOCH_SHORT) == 0)
45 +                                               expdays = -1;
46 +                                       else
47 +                                               expdays = strtoday (optarg);
48                                 else
49                                         expdays = strtol (optarg, 0, 10);
50                                 break;
This page took 0.03292 seconds and 2 git commands to generate.