From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id aBveJchd718xZgAA0tVLHw (envelope-from ) for ; Fri, 01 Jan 2021 17:37:12 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 6KSrIchd71+yfgAAB5/wlQ (envelope-from ) for ; Fri, 01 Jan 2021 17:37:12 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 864FD94011C for ; Fri, 1 Jan 2021 17:37:11 +0000 (UTC) Received: from localhost ([::1]:52362 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kvOMQ-0006nH-4h for larch@yhetil.org; Fri, 01 Jan 2021 12:37:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48860) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kvOMI-0006my-DJ for bug-guix@gnu.org; Fri, 01 Jan 2021 12:37:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:51404) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kvOMI-0008Jd-6D for bug-guix@gnu.org; Fri, 01 Jan 2021 12:37:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kvOMI-00008d-1k for bug-guix@gnu.org; Fri, 01 Jan 2021 12:37:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#45571: Support stable uids and gids for all accounts Resent-From: Danny Milosavljevic Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 01 Jan 2021 17:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45571 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Jason Conroy Received: via spool by 45571-submit@debbugs.gnu.org id=B45571.1609522609512 (code B ref 45571); Fri, 01 Jan 2021 17:37:01 +0000 Received: (at 45571) by debbugs.gnu.org; 1 Jan 2021 17:36:49 +0000 Received: from localhost ([127.0.0.1]:34717 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kvOM5-00008C-0p for submit@debbugs.gnu.org; Fri, 01 Jan 2021 12:36:49 -0500 Received: from dd26836.kasserver.com ([85.13.145.193]:34420) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kvOM2-000082-NC for 45571@debbugs.gnu.org; Fri, 01 Jan 2021 12:36:48 -0500 Received: from localhost (80-110-127-104.cgn.dynamic.surfer.at [80.110.127.104]) by dd26836.kasserver.com (Postfix) with ESMTPSA id E06843363807; Fri, 1 Jan 2021 18:36:43 +0100 (CET) Date: Fri, 1 Jan 2021 18:36:37 +0100 From: Danny Milosavljevic Message-ID: <20210101183637.6ff62412@scratchpost.org> In-Reply-To: References: <20210101154504.28a18674@scratchpost.org> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/iIhj5cxIiZ7J/Hc92CzLmLW"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 45571@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -2.43 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Queue-Id: 864FD94011C X-Spam-Score: -2.43 X-Migadu-Scanner: scn1.migadu.com X-TUID: CnSgLWdHCXJJ --Sig_/iIhj5cxIiZ7J/Hc92CzLmLW Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hi Jason, >Still, I wonder if this could introduce support challenges for packages th= at >incorrectly assume UIDs are 16 bits wide, since they traditionally were th= at >way in UNIX, I don't think that these 16 bit problems are common at all since all the getuid() syscalls I've ever seen, even in traditional UNIXes, have "int" as return value--and nowadays that's at least 32 bits; and also because UNIX configuration is usually in text files, which would read and store the stuff using "%d". That said, it's possible that it could happen in some seriously strange configurations (I doubt it). > and since other Linux distros still seem to prefer small UIDs in > their packaging. By comparison, my earlier idea of declaring static UIDs/= GIDs > in the operating-system is decidedly less elegant, but it avoids this par= ticular > risk.=20 If we did something like that, I would prefer for guix services to just spe= cify a fixed UID/GID for each of the entries in gnu/services/*.scm. We can even reuse existing system uids and gids that have been statically allocated already by FreeBSD and Debian and be even uid/gid compatible to those. For example, change Guix to do (similarly for all Guix services using user accounts): diff --git a/gnu/services/monitoring.scm b/gnu/services/monitoring.scm index 5123a8c441..45d3f4ad17 100644 --- a/gnu/services/monitoring.scm +++ b/gnu/services/monitoring.scm @@ -71,6 +71,7 @@ =20 (define %darkstat-accounts (list (user-account + (uid 4711) (name "darkstat") (group "darkstat") (system? #t) @@ -78,6 +79,7 @@ (home-directory "/var/lib/darkstat") (shell (file-append shadow "/sbin/nologin"))) (user-group + (id 4711) (name "darkstat") (system? #t)))) And other constants for other user names. Or use hashes. Whichever. The point is that the ids are deterministic--not necessarily that we need to use hashes. The advantage of using a hash is t= hat we don't need a central registry and this problem will be out of our life o= nce and for all. Anyway, as a workaround for your immediate problem, I suggest to preserve /etc/passwd, /etc/group and /etc/shadow--present entries in those will be preferred by Guix to even its own configuration. (I'm not sure whether tha= t's currently easy to do with guix system container, however) --Sig_/iIhj5cxIiZ7J/Hc92CzLmLW Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAl/vXaUACgkQ5xo1VCww uqV4twf/SE9DMqS+8viTnEak25kEV7V5xCU7eRyiBDqI1XyrXuL55Si03mkCrmbI gbP0EC7/qR4JDyapRyoAlVif4Z0R9zgVD4jBxDi/8Sz7+mjnvwj1KfMxCIeQhbqg FcGiO5smE1yQHupNXWkTW04dzqzgl3FP0vQtAcAHht1z3Hc0REHfhNJ/aYu6GbyQ YdcPh7qBL9gY1B1CY2Ap0pdoFF4pFEDUYCg3lW4VWKwCngmCD+D0mifxevXLAjix b9Z/lh+4nkQJvzoHssZJLFGHdhsLBXyvR5ok+7bWM0er0z1+ChYoAsVhCOTQVM13 8lSeASGEFMcrt7X5bqL71f6WSwKn8g== =SB/f -----END PGP SIGNATURE----- --Sig_/iIhj5cxIiZ7J/Hc92CzLmLW--