Skip site navigation (1)Skip section navigation (2)
Date:      Tue,  8 Aug 2000 13:59:09 -0700 (PDT)
From:      celeste.copeland@usi.net
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   bin/20489: pw problems: -w random not working correctly for useradd and usermod
Message-ID:  <20000808205909.BD8CC37BD09@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         20489
>Category:       bin
>Synopsis:       pw problems: -w random not working correctly for useradd and usermod
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Aug 08 14:00:01 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Celeste Copeland
>Release:        4.0
>Organization:
USinternetworking, Inc.
>Environment:
FreeBSD spongebob.usi.net 4.0-RELEASE FreeBSD 4.0-RELEASE #0: Mon Mar 20 22:50:22 GMT 2000     root@monster.cdrom.com:/usr/src/sys/compile/GENERIC  i386
>Description:
The section of code dealing with generating random passwords (-w option) appears to be in the wrong place in the code.  The fix for the -w problem (which Jonathan Bresler and myself came up with) is below.  I am working on a fix for the -m issue.  We need pw fixed for a contract which BSDi has with our company.  Jordan Hubbard (jkh@freebsd.org) is the engineer for this project. 
>How-To-Repeat:
/usr/sbin/pw useradd test1 -c "Test User 1" -d /home/test1 -m -s /bin/sh -w random
/usr/sbin/pw usermod test1 -w random
Does not generate a random password.
>Fix:
# diff pw_user.c.orig pw_user.c
269a270
> /*  CEC/jmb  
272a274
> */
292a295,301
>         /*  CEC/jmb */
>         if ((mode == M_ADD || mode == M_UPDATE) && (arg = getarg(args, 'w')) != NULL) {  
>                 cnf->default_password = boolean_val(arg->val, cnf->default_password);
>         }
> 
> 
> 
583a593,599
> 
>       /* CEC/jmb */
>       if ( mode==M_UPDATE && (arg = getarg(args, 'w')) != NULL && getarg(args, 'h') == NULL) {  
>               pwd->pw_passwd = pw_password(cnf, args, pwd->pw_name);
>               edited = 1;
>       }


>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




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