Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Jul 1997 17:13:05 -0400 (EDT)
From:      Keith Mitchell <kmitch@weenix.guru.org>
To:        hackers@freebsd.org
Subject:   Re: Bug in pw? (account/pasword exp dates)
Message-ID:  <199707292113.RAA14306@weenix.guru.org>
In-Reply-To: From kmitch at "Jul 25, 97 08:40:27 am"

next in thread | raw e-mail | index | archive | help
> If I give pw the following command:
> 
> pw useradd tuser -P -c "Test User" -e 901944000 -p 869834290 -m -h 0
> 
> everything seems to work except that the account expiration date and the
> password expiration date are set to the same thing (to the -e param).

I think I found the bug.  In pw_pwdpolicy it tests for a -e instead of the -p.
The following patched seemingly fixed the problem.

Index: pw_user.c
===================================================================
RCS file: /src/cvs/src/usr.sbin/pw/pw_user.c,v
retrieving revision 1.21
diff -c -r1.21 pw_user.c
*** pw_user.c   1997/06/14 00:23:49     1.21
--- pw_user.c   1997/07/29 20:50:16
***************
*** 732,738 ****
  {
        time_t          result = 0;
        time_t          now = time(NULL);
!       struct carg    *arg = getarg(args, 'e');
  
        if (arg != NULL) {
                if ((result = parse_date(now, arg->val)) == now)
--- 732,738 ----
  {
        time_t          result = 0;
        time_t          now = time(NULL);
!       struct carg    *arg = getarg(args, 'p');
  
        if (arg != NULL) {
                if ((result = parse_date(now, arg->val)) == now)

-- 
Keith Mitchell					Head Administrator: acm.vt.edu
Email: kmitch@weenix.guru.org			PGP key available upon request
http://weenix.guru.org/~kmitch 
     Address and URL (c) 1997 Keith Mitchell - All Rights Reserved
   		Unauthorized use or duplication prohibited



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199707292113.RAA14306>