From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id ABz0HIHT32Tw9wAASxT56A (envelope-from ) for ; Fri, 18 Aug 2023 22:24:33 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id iICoHIHT32SxTQEA9RJhRA (envelope-from ) for ; Fri, 18 Aug 2023 22:24:33 +0200 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 505AB51B4A for ; Fri, 18 Aug 2023 22:24:33 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=tilde.club header.s=mail header.b=Oc3Fb9fv; 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"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=tilde.club (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1692390273; a=rsa-sha256; cv=none; b=KofzzuR5bZCDfYUwjlThlWpKgbXeb+4jTS8sKKIzlXFoMLYxN03R9S3KEpVUdyH8hwR9zC LeBLVrZ7YL+vNO4tGYy4u+/r3sRbvjwZH9+BOFjrFaEsTi191nW/F8WDcREaB+C5/8SGpe OzcaTOwXPLmyWRfVbmlRLiNVIcOsKwfxzrTXcCkMQSZ41M2URmwxQcRaSxNO4DVDkilONz 6o+50qsZPTMPEaEyXji/o5K9sYh459yUQtV0zNxdcOR6S+z75wqfMq4VjNAwXLe2IHMj27 VMk+nKK/tv62JGtDr+qBFYQSmqXvbJQAgPW8fC6rYV0WQuO3NR4UGqy7lNf+hw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=tilde.club header.s=mail header.b=Oc3Fb9fv; 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"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=tilde.club (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1692390273; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=GMz2WKfikP0v1FvkFsvbnY7YkgSaTFu90RbfXUZY9Eo=; b=aSnbLA93aHJqV/nM41LHvfFNRNHhpwrXrjMXr7oXUQ7f2UfX+JaPCKYUqiPioXjvdyyqOq sX/YJwIHwQNfJEzs7YryFTMEAXR9o0Qw29LzmEDBshfY3TkxUedE5++keu0SWvpZlOK1IX P2g2QgSWugBLNqpDKzjYM+iEhGea/E7gimKOenQbppNWENe6KQUDEyKztzECO3XEfLVyqy VykVCvjxwS23tF6cKbkeVKnYmAyry7ELQ4+1mdwFYnEAxKMVU0JnBZRIuu5ObXYPgWJ8TV tH363WyA2nuX5THFbaPQYV9iDp6LAGVcvZdMC22QIqrWTOZDjVNsf/4UGvLtTA== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qX60p-0008S7-Oo; Fri, 18 Aug 2023 16:24:03 -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 1qX60o-0008R9-NC for guix-patches@gnu.org; Fri, 18 Aug 2023 16:24:02 -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 1qX60o-0008Ft-FI for guix-patches@gnu.org; Fri, 18 Aug 2023 16:24:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qX60p-0006fK-1d for guix-patches@gnu.org; Fri, 18 Aug 2023 16:24:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#65221] [PATCH 4/6] service: honor EXTRA-PORTS regardless of log-port and log-file. Resent-From: ulfvonbelow Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 18 Aug 2023 20:24:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65221 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 65221@debbugs.gnu.org Cc: ulfvonbelow Received: via spool by 65221-submit@debbugs.gnu.org id=B65221.169239020825535 (code B ref 65221); Fri, 18 Aug 2023 20:24:03 +0000 Received: (at 65221) by debbugs.gnu.org; 18 Aug 2023 20:23:28 +0000 Received: from localhost ([127.0.0.1]:48890 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qX60G-0006dm-I6 for submit@debbugs.gnu.org; Fri, 18 Aug 2023 16:23:28 -0400 Received: from tilde.club ([2607:5300:204:4340::114]:42482 ident=postfix) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qX60F-0006df-BH for 65221@debbugs.gnu.org; Fri, 18 Aug 2023 16:23:27 -0400 Received: by tilde.club (Postfix, from userid 5378) id 5BAD12250B9BD; Fri, 18 Aug 2023 20:23:26 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 tilde.club 5BAD12250B9BD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tilde.club; s=mail; t=1692390206; bh=3rHs921OPchPGGiUp/5LSeroI6rTTXbVTIfdaf0X9S4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Oc3Fb9fvKg16A5ha2ggqgbRV4F+llMgXBck6nXxpOiwcIa104tVZINo5qE67b4at8 TRUn9btiFuYDCrU/HjN9lDymxqTuAyZOxtivvtsAJW+D60c5oTxO3pF3BhNvh0Dmib eN2pg8nlnJvjvImrJC3VWR96jVe4Knmnrvq7W280= From: ulfvonbelow Date: Fri, 18 Aug 2023 15:22:37 -0500 Message-Id: <20230818202239.21177-4-striness@tilde.club> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230818202239.21177-1-striness@tilde.club> References: <20230818202239.21177-1-striness@tilde.club> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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-Scanner: mx0.migadu.com X-Spam-Score: -3.59 X-Migadu-Queue-Id: 505AB51B4A X-Migadu-Spam-Score: -3.59 X-TUID: 8lpzT66d7OxT EXTRA-PORTS is only honored when either LOG-PORT or LOG-FILE is passed. I have no idea why this is the case, it isn't documented anywhere, and it isn't intuitive. * modules/shepherd/service.scm (exec-command): Move preserve-ports call outside of condition. --- modules/shepherd/service.scm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/shepherd/service.scm b/modules/shepherd/service.scm index 68993ac..e816cd1 100644 --- a/modules/shepherd/service.scm +++ b/modules/shepherd/service.scm @@ -1581,11 +1581,7 @@ false." #o640) (fileno log-port)) 1) - (dup2 1 2) - - ;; Make EXTRA-PORTS available starting from file descriptor 3. - ;; This clears their FD_CLOEXEC flag. - (reconfigure-fds extra-ports 3)) + (dup2 1 2)) (lambda (key . args) (when log-file @@ -1594,6 +1590,10 @@ false." (print-exception (current-error-port) #f key args) (primitive-exit 1)))) + ;; Make EXTRA-PORTS available starting from file descriptor 3. + ;; This clears their FD_CLOEXEC flag. + (reconfigure-fds extra-ports 3) + ;; setgid must be done *before* setuid, otherwise the user will ;; likely no longer have permissions to setgid. (when group -- 2.40.1