From owner-freebsd-pkg@freebsd.org Thu Dec 1 19:46:54 2016 Return-Path: Delivered-To: freebsd-pkg@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 686F4C61CEB for ; Thu, 1 Dec 2016 19:46:54 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from smtp.infracaninophile.co.uk (smtp.infracaninophile.co.uk [81.2.117.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.infracaninophile.co.uk", Issuer "infracaninophile.co.uk" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id ECE43197E for ; Thu, 1 Dec 2016 19:46:53 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from liminal.local (unknown [IPv6:2001:8b0:151:1:1c1d:86a1:a200:b700]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: m.seaman@infracaninophile.co.uk) by smtp.infracaninophile.co.uk (Postfix) with ESMTPSA id 30D022C8A for ; Thu, 1 Dec 2016 19:46:49 +0000 (UTC) Authentication-Results: smtp.infracaninophile.co.uk; dmarc=none header.from=FreeBSD.org Authentication-Results: smtp.infracaninophile.co.uk/30D022C8A; dkim=none; dkim-atps=neutral Subject: Re: Find pkg added users/groups To: freebsd-pkg@freebsd.org References: From: Matthew Seaman Message-ID: <2aed4f8a-50f7-d0f7-35b4-edeabc121197@FreeBSD.org> Date: Thu, 1 Dec 2016 19:46:48 +0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="6uetLepNKeC56flhwqPMFLuEKrc0Acten" X-Spam-Status: No, score=-0.4 required=5.0 tests=BAYES_00,RDNS_NONE, SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on smtp.infracaninophile.co.uk X-BeenThere: freebsd-pkg@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Binary package management and package tools discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 19:46:54 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --6uetLepNKeC56flhwqPMFLuEKrc0Acten Content-Type: multipart/mixed; boundary="0tp2fPVKgePGAwGpAb38MP4gGMNFM1An3"; protected-headers="v1" From: Matthew Seaman To: freebsd-pkg@freebsd.org Message-ID: <2aed4f8a-50f7-d0f7-35b4-edeabc121197@FreeBSD.org> Subject: Re: Find pkg added users/groups References: In-Reply-To: --0tp2fPVKgePGAwGpAb38MP4gGMNFM1An3 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 01/12/2016 17:17, Arthur Chance wrote: > pkg info -l lets me see what files a package adds. Is there any easy wa= y > to see what users and groups (if any) a package adds? >=20 Something like this? % pkg info -Rx trousers | grep -EA 6 'Creating (users|groups)' echo "=3D=3D=3D> Creating groups." if ! ${PW} groupshow _tss >/dev/null 2>&1; then echo "Creating group '_tss' with gid '601'." ${PW} groupadd _tss -g 601 else echo "Using existing group '_tss'." fi echo "=3D=3D=3D> Creating users" if ! ${PW} usershow _tss >/dev/null 2>&1; then echo "Creating user '_tss' with uid '601'." ${PW} useradd _tss -u 601 -g 601 -L daemon -c "TrouSerS user" -d /var/empty -s /usr/sbin/nologin else echo "Using existing user '_tss'." fi (picking a random port that installs a new user and group) I'm afraid there isn't a neat little report that will let you list this information for all of your installed packages in some nicely formatted way -- mostly that's because pkg(8) only sees a pre-install shell script which is what creates the user/group, and not a list of userids to add. Cheers, Matthew --0tp2fPVKgePGAwGpAb38MP4gGMNFM1An3-- --6uetLepNKeC56flhwqPMFLuEKrc0Acten Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQJ8BAEBCgBmBQJYQH4pXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ2NTNBNjhCOTEzQTRFNkNGM0UxRTEzMjZC QjIzQUY1MThFMUE0MDEzAAoJELsjr1GOGkAT3T8QAKPpQpZeH7AGYxx/oPdm56Uk uPtnZ7wEcGBhcGgM6b35gq2fouYYIJ4hxdnsrh7Kt5d7pPvT8DjlXMrujT9wi3qa XdYW9u7L9fGNuf3oThBTD6apaBsc+MDrfAMJHSZtkqkRY3HyKuyDijlCpelJ/4cc ywXSCFVByjfDqcGqyCyzqXRu58aw811X76xIZcNmK6DwpjubUQwF6Kt2rPpXRsDI s35KoHiBDBNV6pQ83AI2e9eTXvPXZGCF9axr98rFTNk12KO441EuBiqDdbul6Rlx 3wMcXhUG1fdNyP20afbhUm8QTSGl0BMuvGoWUjfdBBXIEc6T7k1v26DXk0duDDh0 5IQmsFhQvy23/nneBAk5WkJ7/tsDyHxaY1uiwxBurn2FwiAD993/41/X6y+0NGJJ kFhAadKy5mmJmPQGxX7/Aix6BBXEorVyObwDlPKplwh4pylkNMRzKbYkmkz2mCv7 Ok6m97O+p6m2q9UOSMHLKLb6npJWsAI+u0YB/0vOhfGAcV0YDOxQkUtlr54TZqWQ L2bo+JAFDtwqceJ39PGQcjF4Zo52qz6tZHVwBBXRqXunoqxZJ+tP2ld9UKGTMcT6 iPow1XRUZQbJaLg29K8sdYUgCfcAoEGggcGHcbhKQDRDHdI43vfK+gC91CPXT7Sq 6U9Ragt0qN3M/pvDvZPr =1oH2 -----END PGP SIGNATURE----- --6uetLepNKeC56flhwqPMFLuEKrc0Acten--