From owner-freebsd-bugs@FreeBSD.ORG Thu Sep 20 21:10:18 2007 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F8DA16A4CB for ; Thu, 20 Sep 2007 21:10:18 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 920AF13C467 for ; Thu, 20 Sep 2007 21:10:10 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id l8KLA2ne052138 for ; Thu, 20 Sep 2007 21:10:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id l8KLA2MT052129; Thu, 20 Sep 2007 21:10:02 GMT (envelope-from gnats) Resent-Date: Thu, 20 Sep 2007 21:10:02 GMT Resent-Message-Id: <200709202110.l8KLA2MT052129@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Eygene Ryabinkin Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E31C16A41B for ; Thu, 20 Sep 2007 21:04:08 +0000 (UTC) (envelope-from rea-fbsd@codelabs.ru) Received: from pobox.codelabs.ru (pobox.codelabs.ru [144.206.177.45]) by mx1.freebsd.org (Postfix) with ESMTP id 9BE5913C4AC for ; Thu, 20 Sep 2007 21:04:07 +0000 (UTC) (envelope-from rea-fbsd@codelabs.ru) Received: from void.codelabs.ru (void.codelabs.ru [144.206.177.25]) by pobox.codelabs.ru with esmtps (TLSv1:CAMELLIA256-SHA:256) id 1IYR7Y-000InZ-8v; Thu, 20 Sep 2007 22:51:28 +0400 Message-Id: <20070920185127.B05CF1AF41C@void.codelabs.ru> Date: Thu, 20 Sep 2007 22:51:27 +0400 (MSD) From: Eygene Ryabinkin To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: mtm@FreeBSD.org Subject: bin/116487: teach adduser(8) to respect -G flag in the batch mode X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Eygene Ryabinkin List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2007 21:10:19 -0000 >Number: 116487 >Category: bin >Synopsis: teach adduser(8) to respect -G flag in the batch mode >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Sep 20 21:10:01 GMT 2007 >Closed-Date: >Last-Modified: >Originator: Eygene Ryabinkin >Release: FreeBSD 7.0-CURRENT i386 >Organization: Code Labs >Environment: System: FreeBSD XXX 7.0-CURRENT FreeBSD 7.0-CURRENT #10: Wed Sep 12 16:16:49 MSD 2007 root@XXX:/usr/src/sys/i386/compile/XXX i386 >Description: Current adduser(8) does not honor the value of '-G' flag if it is working in the batch mode. This is not good, because one can use batch mode to add a number of users and will want them to be in the same secondary group(s). >How-To-Repeat: Invoke 'adduser -f file-with-account-data -G nogroup' and see that users are added to the passwd, but not to the 'nogroup' group. >Fix: The following patch will cure the situation. I had also clarified the '-G' flag syntax in the man page. A side note: may be it will be better to use comma in the '-G' option value instead of space -- it is just more convinient to type. But this can break POLA and I am not making such change now, so this is just an idea. --- adduser.patch begins here --- diff -urN orig/adduser.8 new/adduser.8 --- orig/adduser.8 2007-09-20 22:37:29.000000000 +0400 +++ new/adduser.8 2007-09-20 22:43:27.000000000 +0400 @@ -212,7 +212,7 @@ .Ar login_group the default. .It Fl G Ar groups -Additional groups. +Space-separated list of additional groups. This option allows the user to specify additional groups to add users to. The user is a member of these groups in addition to their login group. .It Fl h diff -urN orig/adduser.sh new/adduser.sh --- orig/adduser.sh 2007-09-20 22:37:29.000000000 +0400 +++ new/adduser.sh 2007-09-20 22:42:57.000000000 +0400 @@ -598,6 +598,7 @@ get_gecos get_uid get_logingroup + ugroups=`echo "$defaultgroups" | tr ' ' ,` get_class get_shell get_homedir --- adduser.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted: