Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 Dec 2016 19:46:48 +0000
From:      Matthew Seaman <matthew@FreeBSD.org>
To:        freebsd-pkg@freebsd.org
Subject:   Re: Find pkg added users/groups
Message-ID:  <2aed4f8a-50f7-d0f7-35b4-edeabc121197@FreeBSD.org>
In-Reply-To: <f2ff9cbd-7590-71ee-d857-9e25d0c1c3e3@qeng-ho.org>
References:  <f2ff9cbd-7590-71ee-d857-9e25d0c1c3e3@qeng-ho.org>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--6uetLepNKeC56flhwqPMFLuEKrc0Acten
Content-Type: multipart/mixed; boundary="0tp2fPVKgePGAwGpAb38MP4gGMNFM1An3";
 protected-headers="v1"
From: Matthew Seaman <matthew@FreeBSD.org>
To: freebsd-pkg@freebsd.org
Message-ID: <2aed4f8a-50f7-d0f7-35b4-edeabc121197@FreeBSD.org>
Subject: Re: Find pkg added users/groups
References: <f2ff9cbd-7590-71ee-d857-9e25d0c1c3e3@qeng-ho.org>
In-Reply-To: <f2ff9cbd-7590-71ee-d857-9e25d0c1c3e3@qeng-ho.org>

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2aed4f8a-50f7-d0f7-35b4-edeabc121197>