From owner-freebsd-bugs@FreeBSD.ORG Tue Oct 23 20:50:01 2012 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 49CD8FCB for ; Tue, 23 Oct 2012 20:50:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.FreeBSD.org [8.8.178.135]) by mx1.freebsd.org (Postfix) with ESMTP id 31F928FC14 for ; Tue, 23 Oct 2012 20:50:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q9NKo0V7026556 for ; Tue, 23 Oct 2012 20:50:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q9NKo0cK026555; Tue, 23 Oct 2012 20:50:00 GMT (envelope-from gnats) Date: Tue, 23 Oct 2012 20:50:00 GMT Message-Id: <201210232050.q9NKo0cK026555@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Jeff Lawson Subject: Re: misc/172965: pw useradd does not allow -g "" X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Jeff Lawson List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Oct 2012 20:50:01 -0000 The following reply was made to PR misc/172965; it has been noted by GNATS. From: Jeff Lawson To: J B Cc: bug-followup@freebsd.org Subject: Re: misc/172965: pw useradd does not allow -g "" Date: Tue, 23 Oct 2012 15:42:43 -0500 --047d7b10cc4fd2ec9804ccc00461 Content-Type: text/plain; charset=UTF-8 Yes, I agree that "" is currently impossible by the current version of "pw". However, attached is a diff to /usr/src/usr.sbin/pw/pw_user.c that implements the change I am proposing to allow such a one-time override. For example: # pw useradd moo4 # pw useradd -D -g "nobody" # pw useradd moo5 # pw useradd moo6 -g "" # grep moo /etc/passwd moo4:*:8005:8005:User &:/home/moo4:/bin/sh moo5:*:8006:65534:User &:/home/moo5:/bin/sh moo6:*:8007:8007:User &:/home/moo6:/bin/sh In effect, -g "" acts as if there is no default set by -D -g. --047d7b10cc4fd2ec9804ccc00461 Content-Type: application/octet-stream; name="pw_user.c.diff" Content-Disposition: attachment; filename="pw_user.c.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_h8nh70u00 ZGlmZiAtLWdpdCBhL3B3X3VzZXIuYy5vcmlnIGIvcHdfdXNlci5jCmluZGV4IDhlMmZhM2IuLjIw OTEyNTMgMTAwNjQ0Ci0tLSBhL3B3X3VzZXIuYy5vcmlnCisrKyBiL3B3X3VzZXIuYwpAQCAtODYy LDggKzg2MiwxMSBAQCBwd19naWRwb2xpY3koc3RydWN0IHVzZXJjb25mICogY25mLCBzdHJ1Y3Qg Y2FyZ3MgKiBhcmdzLCBjaGFyICpuYW0sIGdpZF90IHByZWZlcgogCiAJLyoKIAkgKiBJZiBubyBh cmcgZ2l2ZW4sIHNlZSBpZiBkZWZhdWx0IGNhbiBoZWxwIG91dAorCSAqIHVubGVzcyB0aGUgdXNl ciBleHBsaWNpdGx5IHNwZWNpZmllZCBhIGJsYW5rIHN0cmluZy4KIAkgKi8KLQlpZiAoYV9naWQg PT0gTlVMTCAmJiBjbmYtPmRlZmF1bHRfZ3JvdXAgJiYgKmNuZi0+ZGVmYXVsdF9ncm91cCkKKwlp ZiAoYV9naWQgIT0gTlVMTCAmJiAhKmFfZ2lkLT52YWwpCisJCWFfZ2lkID0gTlVMTDsKKwllbHNl IGlmIChhX2dpZCA9PSBOVUxMICYmIGNuZi0+ZGVmYXVsdF9ncm91cCAmJiAqY25mLT5kZWZhdWx0 X2dyb3VwKQogCQlhX2dpZCA9IGFkZGFyZyhhcmdzLCAnZycsIGNuZi0+ZGVmYXVsdF9ncm91cCk7 CiAKIAkvKgo= --047d7b10cc4fd2ec9804ccc00461--