GNU bug report logs - #65221
[PATCH 0/2] Fix EXTRA-PORTS edge cases

Previous Next

Package: guix-patches;

Reported by: ulfvonbelow <striness <at> tilde.club>

Date: Fri, 11 Aug 2023 09:05:02 UTC

Severity: normal

Tags: patch

Full log


View this message in rfc822 format

From: ulfvonbelow <striness <at> tilde.club>
To: 65221 <at> debbugs.gnu.org
Cc: ulfvonbelow <striness <at> tilde.club>
Subject: [bug#65221] [PATCH 4/6] service: honor EXTRA-PORTS regardless of log-port and log-file.
Date: Fri, 18 Aug 2023 15:22:37 -0500
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





This bug report was last modified 1 year and 304 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.