From owner-freebsd-bugs Tue Aug 8 14: 0:10 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 7516637B745 for ; Tue, 8 Aug 2000 14:00:05 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id OAA84199; Tue, 8 Aug 2000 14:00:05 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: by hub.freebsd.org (Postfix, from userid 32767) id BD8CC37BD09; Tue, 8 Aug 2000 13:59:09 -0700 (PDT) Message-Id: <20000808205909.BD8CC37BD09@hub.freebsd.org> Date: Tue, 8 Aug 2000 13:59:09 -0700 (PDT) From: celeste.copeland@usi.net To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: bin/20489: pw problems: -w random not working correctly for useradd and usermod Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >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