From owner-freebsd-bugs Sat Aug 23 17:50:05 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id RAA25162 for bugs-outgoing; Sat, 23 Aug 1997 17:50:05 -0700 (PDT) Received: (from gnats@localhost) by hub.freebsd.org (8.8.7/8.8.7) id RAA25156; Sat, 23 Aug 1997 17:50:01 -0700 (PDT) Resent-Date: Sat, 23 Aug 1997 17:50:01 -0700 (PDT) Resent-Message-Id: <199708240050.RAA25156@hub.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@FreeBSD.ORG, alm@mclink.com Received: from mclink.com (mclink.com [207.137.208.2]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id RAA25078 for ; Sat, 23 Aug 1997 17:49:10 -0700 (PDT) Received: (from root@localhost) by mclink.com (8.8.5/8.8.4) id RAA06333; Sat, 23 Aug 1997 17:49:09 -0700 (PDT) Message-Id: <199708240049.RAA06333@mclink.com> Date: Sat, 23 Aug 1997 17:49:09 -0700 (PDT) From: "Andrew L. Moore" Reply-To: alm@mclink.com To: FreeBSD-gnats-submit@FreeBSD.ORG Cc: alm@mclink.com X-Send-Pr-Version: 3.104 Subject: bin/4365: patch for: pw(8) - non-blank `defaultgroup' not accepted Sender: owner-freebsd-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >Number: 4365 >Category: bin >Synopsis: patch for: pw(8) - non-blank `defaultgroup' not accepted >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Aug 23 17:50:01 PDT 1997 >Last-Modified: >Originator: Andrew L. Moore >Organization: >Release: FreeBSD 2.2-STABLE i386 >Environment: all versions of pw(8) through -current (3.0) System: FreeBSD ns.mclink.com 2.2-STABLE FreeBSD 2.2-STABLE #1: Wed May 28 02:06:16 PDT 1997 alm@ns.mclink.com:/u2/home/freebsd/src-2.2/sys/compile/NS i386 >Description: If /etc/pw.conf is set with a valid non-blank `defaultgroup', the command `pw user add foo' still creates a new group per user. Cause: pw_conf.c calls getgrnam(3) with a quoted arg. >How-To-Repeat: # echo "user1:*:100:" >>/etc/group # sed 's/^\(defaultgroup\).*/\1 = "user1"/' /etc/pw.conf >/tmp/foo && > mv /tmp/foo /etc/pw.conf # pw user add foo -N >Fix: unquote(arg) i.e.: diff -u -r1.1.1.1.2.1 pw_conf.c --- pw_conf.c 1996/12/11 00:14:15 1.1.1.1.2.1 +++ pw_conf.c 1997/08/23 23:40:03 @@ -287,7 +287,7 @@ ? (char *) bourne_shell : newstr(q); break; case _UC_DEFAULTGROUP: - config.default_group = (q == NULL || !boolean_val(q, 1) || getgrnam(q) == NULL) + config.default_group = ((q = unquote(q)) == NULL || !boolean_val(q, 1) || getgrnam(q) == NULL) ? NULL : newstr(q); break; case _UC_EXTRAGROUPS: >Audit-Trail: >Unformatted: