gnu: hurd: Fix service socket activation.

Fixes <https://issues.guix.gnu.org/77610>.

* gnu/packages/patches/hurd-socket-activation.patch: New patch
* gnu/packages/hurd.scm (hurd): Add it.
* gnu/local.mk: Register it.

Change-Id: Iff7f30099ffeb014aaacdc3a19bd7930795904b6
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Yelninei 2025-05-15 07:51:43 +00:00 committed by Ludovic Courtès
parent 114f0a615f
commit e98153b96c
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
3 changed files with 46 additions and 0 deletions

View file

@ -1593,6 +1593,7 @@ dist_patch_DATA = \
%D%/packages/patches/hurd-64bit.patch \ %D%/packages/patches/hurd-64bit.patch \
%D%/packages/patches/hurd-refcounts-assert.patch \ %D%/packages/patches/hurd-refcounts-assert.patch \
%D%/packages/patches/hurd-rumpdisk-no-hd.patch \ %D%/packages/patches/hurd-rumpdisk-no-hd.patch \
%D%/packages/patches/hurd-socket-activation.patch \
%D%/packages/patches/hurd-startup.patch \ %D%/packages/patches/hurd-startup.patch \
%D%/packages/patches/hwloc-1-test-btrfs.patch \ %D%/packages/patches/hwloc-1-test-btrfs.patch \
%D%/packages/patches/i7z-gcc-10.patch \ %D%/packages/patches/i7z-gcc-10.patch \

View file

@ -319,6 +319,7 @@ Hurd-minimal package which are needed for both glibc and GCC.")
(patches (search-patches "hurd-refcounts-assert.patch" (patches (search-patches "hurd-refcounts-assert.patch"
"hurd-rumpdisk-no-hd.patch" "hurd-rumpdisk-no-hd.patch"
"hurd-startup.patch" "hurd-startup.patch"
"hurd-socket-activation.patch"
"hurd-64bit.patch")))) "hurd-64bit.patch"))))
(version (package-version hurd-headers)) (version (package-version hurd-headers))
(arguments (arguments

View file

@ -0,0 +1,44 @@
From 029ab7d7b38c76ba14c24fcbf526ccef29af9e88 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@gnu.org>
Date: Thu, 8 May 2025 23:11:36 +0200
Subject: pflocal: Do not inherit PFLOCAL_SOCK_NONBLOCK across connect/accept.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Previously, accept would return an O_NONBLOCK socket if the listening
socket was O_NONBLOCK at the time the connection was made. With this
change, accept always returns a socket where O_NONBLOCK is cleared.
---
pflocal/sock.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/pflocal/sock.c b/pflocal/sock.c
index 90c618e..6bc061d 100644
--- a/pflocal/sock.c
+++ b/pflocal/sock.c
@@ -1,6 +1,6 @@
/* Sock functions
- Copyright (C) 1995,96,2000,01,02, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1995,96,2000,01,02, 2005, 2025 Free Software Foundation, Inc.
Written by Miles Bader <miles@gnu.org>
This program is free software; you can redistribute it and/or
@@ -167,8 +167,11 @@ sock_clone (struct sock *template, struct sock **sock)
if (err)
return err;
- /* Copy some properties from TEMPLATE. */
- (*sock)->flags = template->flags & ~PFLOCAL_SOCK_CONNECTED;
+ /* Copy some properties from TEMPLATE. Clear O_NONBLOCK because the socket
+ returned by 'accept' must not inherit O_NONBLOCK from the parent
+ socket. */
+ (*sock)->flags =
+ template->flags & ~(PFLOCAL_SOCK_CONNECTED | PFLOCAL_SOCK_NONBLOCK);
return 0;
}
--
cgit v1.1