On Fri, Dec 23, 2011 at 11:11:48AM +0001, Jason McIntyre wrote:
> On Mon, Dec 19, 2011 at 01:53:08PM +0100, Stefan Pettersson wrote:
> > Hi,
> > 
> > just a minor thing. The userdel(8) usage and manual says the -p option
> > only needs the preserve-value when -D is given. However, a "true"
> > value seems to be required regardless:
> > 
> > # userdel -p josefine
> > usage: userdel -D [-p preserve-value]
> >        userdel [-prv] user
> > # grep josefine /etc/master.passwd
> > josefine:$2a$06$DW[...]:1001:10::0:0::/home/josefine:/bin/ksh
> > # userdel -p true josefine
> > # grep josefine /etc/master.passwd
> > josefine:*************:1001:10::0:0::/home/josefine:/sbin/nologin
> > 
> > Not sure whether it's a documentation error or if the code in user.c
> > is at fault. The above is from version 4.9 and I haven't found any
> > changes in CVS since.
> > 
> > Anyway, merry Christmas folks!
> > 
> 
> i think it's a doc error. netbsd made a fix similar to the one below in
> -r1.28. thus i propose the following, which i'll commit if no one
> objects.
> 
> i'd appreciate at least one ok on my change to user.c, since i've no
> idea if i wrapped the line acceptably.

ok krw@

.... Ken

> 
> jmc
> 
> Index: user.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/user/user.c,v
> retrieving revision 1.82
> diff -u -r1.82 user.c
> --- user.c    4 Dec 2011 08:28:35 -0000       1.82
> +++ user.c    23 Dec 2011 11:10:06 -0000
> @@ -1641,7 +1641,8 @@
>       } else if (strcmp(prog, "userdel") == 0) {
>               (void) fprintf(stderr, "usage: %s -D [-p preserve-value]\n",
>                   prog);
> -             (void) fprintf(stderr, "       %s [-prv] user\n", prog);
> +             (void) fprintf(stderr, "       %s [-rv] [-p preserve-value] "
> +                 "user\n", prog);
>  #ifdef EXTENSIONS
>       } else if (strcmp(prog, "userinfo") == 0) {
>               (void) fprintf(stderr, "usage: %s [-e] user\n", prog);
> Index: userdel.8
> ===================================================================
> RCS file: /cvs/src/usr.sbin/user/userdel.8,v
> retrieving revision 1.14
> diff -u -r1.14 userdel.8
> --- userdel.8 3 Sep 2010 11:22:36 -0000       1.14
> +++ userdel.8 23 Dec 2011 11:10:06 -0000
> @@ -42,7 +42,8 @@
>  .Fl D
>  .Op Fl p Ar preserve-value
>  .Nm userdel
> -.Op Fl prv
> +.Op Fl rv
> +.Op Fl p Ar preserve-value
>  .Ar user
>  .Sh DESCRIPTION
>  The
> @@ -84,7 +85,7 @@
>  .Pa /etc/usermgmt.conf ,
>  the following command line options are processed:
>  .Bl -tag -width Ds
> -.It Fl p
> +.It Fl p Ar preserve-value
>  Preserve the user information in the password file,
>  but do not allow the user to login, by switching the
>  password to an

Reply via email to