From: GNU Libc Maintainers Date: Thu, 25 Aug 2022 17:16:34 +0000 (+0100) Subject: git-spawni-reauth X-Git-Tag: archive/raspbian/2.34-7+rpi1~1^2^2~73 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=ad63097fd25fa9fb75b67cafcf2ccc467ea2e385;p=glibc.git git-spawni-reauth Committed for 2.36 commit eff158b75dee466ac0c37a17b2165072ee0b7aeb Author: Samuel Thibault Date: Thu May 5 02:14:43 2022 +0200 hurd spawni: Fix reauthenticating closed fds When an fd is closed, the port cell remains, but the port becomes MACH_PORT_NULL, so we have to guard against it. Gbp-Pq: Topic hurd-i386 Gbp-Pq: Name git-spawni-reauth.diff --- diff --git a/sysdeps/mach/hurd/spawni.c b/sysdeps/mach/hurd/spawni.c index 060e389bb..9941ae536 100644 --- a/sysdeps/mach/hurd/spawni.c +++ b/sysdeps/mach/hurd/spawni.c @@ -154,7 +154,7 @@ __spawni (pid_t *pid, const char *file, reauthenticated, or was newly opened on behalf of the child. */ error_t reauthenticate_fd (int fd) { - if (dtable_cells[fd] != NULL) + if (dtable_cells[fd] != NULL && dtable[fd] != MACH_PORT_NULL) { file_t newfile; mach_port_t ref = __mach_reply_port ();