From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id sECHBXwuCmcslgAA62LTzQ:P1 (envelope-from ) for ; Sat, 12 Oct 2024 08:08:28 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id sECHBXwuCmcslgAA62LTzQ (envelope-from ) for ; Sat, 12 Oct 2024 10:08:28 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=m0JRR3GK; dkim=fail ("headers rsa verify failed") header.d=posteo.net header.s=2017 header.b=hCehleIC; dmarc=fail reason="SPF not aligned (strict), DKIM not aligned (strict)" header.from=posteo.net (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1728720507; a=rsa-sha256; cv=none; b=qgs3DegCnKWF5MPKG+vdJ8QW6V+KSRZ1red6k3PJrShKxFpXhcAwa1Nq0yRzRFpiE2QhOw hCsZ6211+ssQZAKU3B8w7dNrr2KBES+oQftdADO9gfVvIKyRTrunfiCYGg9fyObYVW0EcO TNm1E1Epz43lnoXwkVuoYvFujAN8AzT8sHnW2UiwyMlw8N2txxtDzNk4m1HPWh7ASGMMyy xbh0IapKIymhLSAjHQVSNk/6QnS7gxaHzh3QKBwo2Cic/G5wBozIOMZIM5L+05CC/VL8+V HM3Bne4hbIUxuHwyjd4bnL+1hbNx46+J4Ln3B3e1PLYf/oI1WcoW2m1DK2i4OA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=m0JRR3GK; dkim=fail ("headers rsa verify failed") header.d=posteo.net header.s=2017 header.b=hCehleIC; dmarc=fail reason="SPF not aligned (strict), DKIM not aligned (strict)" header.from=posteo.net (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1728720507; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=VDKaxOkA8tU86UAgGWgXl4xD7X2ZnA/fKHdwwvjvBQk=; b=Wx9weLhgLIjBH5BHKZ7eMRtLyLQK/z/MQwARpKWs7ajnzs1wLwdpOk4kIdbatWTCewG3J6 pGpKXMFsCuA+zENjLejTJWGJab2hqjme0m/b8ILq206Ob5doM5snlJj16CSz27SD3QjmUV 9UIWUN++0ziQAjzZIoQ+564ak124wCoWzyRTXANdI7b793Ja+dTJ3xXyi4VRN9EtjyIl2C 408/HM9a5sMiF1R8Y7pT+q5udZVyqYQxp859bwwEjq4zPDk8vcrjQWmXf+9Ke0+tXicWbB ozHMiWF0cmctRKfY/r2Gf/nfuJxzXV/PfzXFq6UwEgeCrMLe5PHofk/Evv99Kw== 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 A13641FE7 for ; Sat, 12 Oct 2024 10:08:27 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1szXAF-0000Y0-Fa; Sat, 12 Oct 2024 04:07:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1szXAC-0000Wy-E8 for guix-patches@gnu.org; Sat, 12 Oct 2024 04:07:48 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1szXAC-00077k-4z for guix-patches@gnu.org; Sat, 12 Oct 2024 04:07:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:Subject; bh=VDKaxOkA8tU86UAgGWgXl4xD7X2ZnA/fKHdwwvjvBQk=; b=m0JRR3GKsLsg+LQjWHfjggA35a/kaXe6DxAXeb8W6FnPvrPvpy4DJHb3hhUAbKU6D+y3vmJc8joHtGcbFbSbawT3RN0yc4poeKZEpW5asfJI5OyFBYNHYC1Gc97a/mlGnv/3AJ+hm23gpByFXkRelt1PSf7Vvnq91aXWIpGWveikfNKvK9U9AbLUiI5hCjW6l0bZ9fNO3JP7k8CMsz4dYtDZlJ1Byaxq4GTpazpsfbr5Ju9iKFTy8LB1lFRLTjP85H+wKptJSx4FFkipUENBJsyF0CEnKz0/8I6js11BS+opkef7AQu+L+zaHntloloAZ6VIYEhXWYpUq44nNmWKgg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1szXAP-0004Al-ST for guix-patches@gnu.org; Sat, 12 Oct 2024 04:08:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#73767] [PATCH] gnu: system: Privilege programs after creating accounts. Resent-From: Dariqq Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 12 Oct 2024 08:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 73767 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 73767@debbugs.gnu.org Cc: Dariqq X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.172872047316019 (code B ref -1); Sat, 12 Oct 2024 08:08:01 +0000 Received: (at submit) by debbugs.gnu.org; 12 Oct 2024 08:07:53 +0000 Received: from localhost ([127.0.0.1]:36219 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1szXAH-0004AI-85 for submit@debbugs.gnu.org; Sat, 12 Oct 2024 04:07:53 -0400 Received: from lists.gnu.org ([209.51.188.17]:39786) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1szXAE-0004AA-R9 for submit@debbugs.gnu.org; Sat, 12 Oct 2024 04:07:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1szXA0-0000W0-Or for guix-patches@gnu.org; Sat, 12 Oct 2024 04:07:36 -0400 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1szX9y-00077I-Gj for guix-patches@gnu.org; Sat, 12 Oct 2024 04:07:36 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 6C2F3240027 for ; Sat, 12 Oct 2024 10:07:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1728720450; bh=dSPoyqwLA88e7U/2SUF0tiEViJVcAR6zPOJO6IElitE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=hCehleIC+c+eqUxN8CV7fcKzIrMJE81uNDxXrs1woJ7m90MoAtMjVu5lHWGFK0Yi7 WUlFdqCZgcz4MKRYuosCSC2ZmVQALYMZDwJhzawos3vimzo2YRtAqYU1fskFQcWwev u3b8xP1e46NTjWaDK41jR5zQ7TnfGmHVBB8Pk6VWHval2DoeFBr8+iRbeIQbSfVSAv NMyMLGJFKIqysVc64IfJE51eJkamgK4dnuaQnmMPsoKCR2F3H9hyi1LORwWMzKe+Fn HhRR8FoaiLmBETMV++qV9mLkHdZTXtbFb7RoyfSNj2CtJRPqZnrYGS4BiKyv8mKjwR woV6MdqlAdYTw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4XQbh173Fgz6tm8; Sat, 12 Oct 2024 10:07:29 +0200 (CEST) From: Dariqq Date: Sat, 12 Oct 2024 07:55:58 +0000 Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=185.67.36.65; envelope-from=dariqq@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -0.31 X-Spam-Score: -0.31 X-Migadu-Queue-Id: A13641FE7 X-Migadu-Scanner: mx12.migadu.com X-TUID: +bQ6j64tcau2 Ensure that users and groups are already created when the privileging script runs. The order these scripts appear in the folded activation-service depends on the order these services are instantiated in the operating-system. Fixes https://issues.guix.gnu.org/73680. * gnu/system.scm (operating-system-default-essential-services): Move privileged-program-service above account-service. (hurd-default-essential-services): Likewise. Change-Id: I662fb1eff42e4088496fccb76e0efbf2b1da096e --- Hi, I tested that this fixes my problem of setting something suid to a new user. For the hurd change i only looked at the final value of activation-service type in hurd-barebones-os and confirmed that '#' is before # (which is the privileging script). I would prefer a solution that also models this dependency to not depend on input order but this might be tricky. gnu/system.scm | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/gnu/system.scm b/gnu/system.scm index 44f93f91d1..c19730b331 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -809,6 +809,11 @@ (define (operating-system-default-essential-services os) %shepherd-root-service (pam-root-service (operating-system-pam-services os)) + ;; Make sure that privileged-programs activation script + ;; runs after accounts are created + (service privileged-program-service-type + (append (operating-system-privileged-programs os) + (operating-system-setuid-programs os))) (account-service (append (operating-system-accounts os) (operating-system-groups os)) (operating-system-skeletons os)) @@ -826,9 +831,6 @@ (define (operating-system-default-essential-services os) (operating-system-environment-variables os)) (service host-name-service-type host-name) procs root-fs - (service privileged-program-service-type - (append (operating-system-privileged-programs os) - (operating-system-setuid-programs os))) (service profile-service-type (operating-system-packages os)) boot-fs non-boot-fs @@ -850,6 +852,11 @@ (define (hurd-default-essential-services os) (service shepherd-root-service-type) (service user-processes-service-type) + ;; Make sure that privileged-programs activation script + ;; runs after accounts are created + (service privileged-program-service-type + (append (operating-system-privileged-programs os) + (operating-system-setuid-programs os))) (account-service (append (operating-system-accounts os) (operating-system-groups os)) (operating-system-skeletons os)) @@ -866,9 +873,6 @@ (define (hurd-default-essential-services os) (list `("hosts" ,hosts-file))) (service hosts-service-type (local-host-entries host-name))) - (service privileged-program-service-type - (append (operating-system-privileged-programs os) - (operating-system-setuid-programs os))) (service profile-service-type (operating-system-packages os))))) (define* (operating-system-services os) base-commit: b8fd792ea267cb920da0651074a533d8abf00488 -- 2.46.0