From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 6CB83138334 for ; Thu, 6 Jun 2019 05:02:49 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 84C19E08DD; Thu, 6 Jun 2019 05:02:45 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 39DB3E08D3 for ; Thu, 6 Jun 2019 05:02:45 +0000 (UTC) Received: from pomiot (d202-252.icpnet.pl [109.173.202.252]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: mgorny) by smtp.gentoo.org (Postfix) with ESMTPSA id E931B3457DB; Thu, 6 Jun 2019 05:02:42 +0000 (UTC) Message-ID: Subject: Re: [gentoo-dev] [PATCH v2 6/9] acct-{group,user}.eclass: WIP eclasses to maintain users/groups From: =?UTF-8?Q?Micha=C5=82_G=C3=B3rny?= To: gentoo-dev@lists.gentoo.org Date: Thu, 06 Jun 2019 07:02:38 +0200 In-Reply-To: <7abcd69f-cee8-0acd-db7a-c88268902e17@gentoo.org> References: <20190605091257.12127-1-mgorny@gentoo.org> <20190605091257.12127-7-mgorny@gentoo.org> <7abcd69f-cee8-0acd-db7a-c88268902e17@gentoo.org> Organization: Gentoo Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-A5YsDlwNunAAYNihbCHB" User-Agent: Evolution 3.30.5 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 X-Archives-Salt: 2c3e9691-a444-4675-8106-a08be05f1967 X-Archives-Hash: 0f439396afd8c4cfc4f093259c69f1c1 --=-A5YsDlwNunAAYNihbCHB Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 2019-06-05 at 17:14 -0400, Michael Orlitzky wrote: > On 6/5/19 5:12 AM, Micha=C5=82 G=C3=B3rny wrote: > > + > > + # check for ACCT_USER_ID collisions early > > + if [[ -n ${ACCT_USER_ENFORCE_ID} ]]; then > > + local pwd=3D$(egetent passwd "${ACCT_USER_ID}") > > + if [[ -n ${pwd} ]]; then > > + eerror "The required UID is already taken by another user." > > + eerror " UID: ${ACCT_USER_ID} (needed for ${PN})" > > + eerror " current user: ${pwd}" > > + die "UID ${ACCT_USER_ID} taken already" > > + fi > > + fi > > +} >=20 > If we set ACCT_USER_ENFORCE_ID=3Dtrue in ftp-0.ebuild and then "emerge > acct-user/ftp" again, the second one dies with >=20 > * The required UID is already taken by another user. > * UID: 21 (needed for ftp) >=20 > This prevents "emerge -e @world" from working, and would prevent an > upgrade to ftp-1.ebuild in the future. >=20 > We could augment the checks to ignore the existing user/group if its > name agrees with the one we're trying to create, but now I'm having deja > vu. I think this is another reason why I decided to go with a dummy file > installed under /var/lib to catch collisions: the PM will necessarily > ignore collisions from the same package. Good catch. Let's see what others have to say. If we're going to check for username patches, we'd need another user.eclass portability knob. --=20 Best regards, Micha=C5=82 G=C3=B3rny --=-A5YsDlwNunAAYNihbCHB Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQGTBAABCgB9FiEEx2qEUJQJjSjMiybFY5ra4jKeJA4FAlz4nm9fFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEM3 NkE4NDUwOTQwOThEMjhDQzhCMjZDNTYzOUFEQUUyMzI5RTI0MEUACgkQY5ra4jKe JA5BpAgAjGUgbuNWxfOA/BlP3KoaXX9XZdHs/Y40AtU6xnV2pNyk7pXXPDuF7LLK v2Aszvz3OmFQH1npiIHjIk+SeMnKWm26NWTx1ihdcC1o4dkcbhi395G6YG3PSvWC aGu9D75UVwonn+SQuR6MGhBzpDTQZbG2bX+cR92swJIgd2l4vjOGw0TTbl3eqtJm NV24hp1UXYf4or0IFr2mcG3jyg0VleiVw8a5SFJWOThSXxf58R3dm+4Saf2ek+Cb NStC6kMiiQpC/79B27SLLKlBuflC4L53LCOyvWdjnvhza2S++D0+1x42kUJdFBwT qjCt990BGz85oXBnPNANEv0DFfniiA== =ElaM -----END PGP SIGNATURE----- --=-A5YsDlwNunAAYNihbCHB--