From owner-freebsd-ports@freebsd.org Sun Mar 27 19:02:07 2016 Return-Path: Delivered-To: freebsd-ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05AF6ADF20E for ; Sun, 27 Mar 2016 19:02:07 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (wonkity.com [67.158.26.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "wonkity.com", Issuer "wonkity.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C8B9514EB for ; Sun, 27 Mar 2016 19:02:06 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.15.2/8.15.2) with ESMTPS id u2RJ22Cc087305 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 27 Mar 2016 13:02:02 -0600 (MDT) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.15.2/8.15.2/Submit) with ESMTP id u2RJ22Xi087302; Sun, 27 Mar 2016 13:02:02 -0600 (MDT) (envelope-from wblock@wonkity.com) Date: Sun, 27 Mar 2016 13:02:02 -0600 (MDT) From: Warren Block To: "Janky Jay, III" cc: freebsd-ports@freebsd.org, Torfinn Ingolfsen , leres@ee.lbl.gov Subject: Re: devel/arduino - bad advice given in pkg-message In-Reply-To: <56F71D44.1080302@unfs.us> Message-ID: References: <56F55A84.6080000@unfs.us> <56F71D44.1080302@unfs.us> User-Agent: Alpine 2.20 (BSF 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (wonkity.com [127.0.0.1]); Sun, 27 Mar 2016 13:02:02 -0600 (MDT) X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Mar 2016 19:02:07 -0000 On Sat, 26 Mar 2016, Janky Jay, III wrote: > Hi Torfinn, > > On 03/25/2016 10:20 AM, Torfinn Ingolfsen wrote: >> On Fri, Mar 25, 2016 at 4:34 PM, Janky Jay, III >> wrote: >>> >>> While your solution is not incorrect, your assumption on the >>> proposed/given solution from the port is. The '-G' switch appends >>> the given group to your users already given groups. So, if a user >>> belongs to groups admin,wheel,test and you run the suggested "pw" >>> command from the port, your user will now be in groups >>> admin,wheel,test,dialer. It's the '-g' (lower-case) switch you >>> want to avoid... >>> >> >> If you read the man page, I think you will find that it is your >> assumption about what the '-G' switch does which is incorrect. >> Quote: "-G grouplist" "Set additional group memberships for an >> account. grouplist is a comma, space or tab-separated list of >> group names or group numbers. The user's name is added to the >> group lists in /etc/group, and removed from any groups not >> specified in grouplist." >> >> Please note the part which says "and removed from any groups not >> specified in grouplist" >> > > Ah yes! You are correct! For some reason I was mixing my "pw usermod" > and Linux "usermod" (where you use the -aG to append). My fault > entirely. Continue with your correct request for the update of the > false information. *fades into background* For what it's worth, I wrote that message, and (try to) always test things like that to make sure they work. It seems I missed that, though. The way those options are explained in pw(8) is misleading. Apparently "additional" was used in the sense of "all groups that are not the primary group", not in the sensing of adding groups. Here is the current version (rewrapped): -G grouplist Set additional group memberships for an account. grouplist is a comma, space or tab-separated list of group names or group numbers. The user's name is added to the group lists in /etc/group, and removed from any groups not specified in grouplist. Note: a user should not be added to their primary group with grouplist. Also, group membership changes do not take effect for current user login sessions, requiring the user to reconnect to be affected by the changes. Here is how I propose to rewrite that: -G grouplist Set secondary group memberships for an account. grouplist is a comma, space, or tab-separated list of group names or group numbers. /etc/group is modified to include the user's name in the groups specified in grouplist. The user's name is removed from all groups not specified. Group membership changes do not take effect for current user login sessions, requiring the user to reconnect to be affected by the changes. Note: do not add a user to their primary group with grouplist. Feedback welcome.