From owner-freebsd-questions@FreeBSD.ORG Wed Mar 25 18:09:29 2015 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A6F90A0C for ; Wed, 25 Mar 2015 18:09:29 +0000 (UTC) Received: from mail-ie0-x230.google.com (mail-ie0-x230.google.com [IPv6:2607:f8b0:4001:c03::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7150FC8C for ; Wed, 25 Mar 2015 18:09:29 +0000 (UTC) Received: by iedfl3 with SMTP id fl3so32021666ied.1 for ; Wed, 25 Mar 2015 11:09:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=WWK1yENfF0ELL6+f7CEVXb7oYRE2zEHPZsQMmYLKmJA=; b=HSh1/v76lAphgF0S79v4KO7L1bCzZF/c96KgQM16ht4mTqT/+lN/hYBTQlO9pt9wjh uIi4DMLeGZmKUUytGo+bwPl0ynguG09ehtLq/Nnc69GwAexXVCO3zvNXfbRJ3G5NG0Ut EVYhBUY7a/8EFGrseKzSMrYJhfE1n9KBD0DFfDZ+w39o9cDiT9rx6ajGsBTsprex6TzY zDQ916gH+8rRP7UEixHNq5C9Byv60NiViHGCeS+BR6MPU78UZ4VfFxMKK1HLD+X2/F30 OmCcdAzzfDSWx8KBlao90WeYnsg/ExXf03SyUsAvxGbmixOkv1J3wVjPVDGM8cNv/LAX VzLw== MIME-Version: 1.0 X-Received: by 10.42.67.19 with SMTP id r19mr8628489ici.30.1427306968819; Wed, 25 Mar 2015 11:09:28 -0700 (PDT) Sender: vrwmiller@gmail.com Received: by 10.64.150.229 with HTTP; Wed, 25 Mar 2015 11:09:28 -0700 (PDT) In-Reply-To: <474FEC65-4E15-4972-A411-E91569B4E2A5@gmail.com> References: <474FEC65-4E15-4972-A411-E91569B4E2A5@gmail.com> Date: Wed, 25 Mar 2015 14:09:28 -0400 X-Google-Sender-Auth: uSrqg3DdKdf_CBsDQUcZRzncNQE Message-ID: Subject: Re: 'pw usermod -G' not removing user from group? From: Rick Miller To: Matthew Pherigo Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: FreeBSD Users X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Mar 2015 18:09:29 -0000 On Wed, Mar 25, 2015 at 11:49 AM, Matthew Pherigo wrote: > Hi all, > > The manpage for pw(8) says this about the -G flag: > > The user's name is added to the group lists in /etc/group, and removed > from any groups not specified in grouplist. > > However, when using this option on 10.1, pw decides to get creative: > > $ sudo id -a test > > uid=1003(test) gid=1003(test) groups=1003(test),0(wheel),69(network) > > $ sudo pw usermod test -G network > > $ sudo id -a test > > uid=1003(test) gid=1003(test) groups=1003(test),0(wheel),69(network) > > This isn't the end of the creative liberties, though. When checking > /etc/group, we find: > > network:*:69:test,test > > pw(8) has added the 'test' user to the network group *twice*. In fact, > when I was checking the /etc/group file, I found this little gem: > > wheel:*:0:root,ansible,matt,matt,matt,test > > That trio of matts is the result of configuration management systems > tripping over this strange behavior. > > Was this introduced in a recent patch? I can't imagine this has been > around for long. Hopefully it's just a doc error! This PR[1] describes the problem. It includes a patch, which apparently didn't make it into 10.1 by the looks of it probably due to a code freeze in preparation for release. [1] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=187189 -- Take care Rick Miller