1
0
mirror of https://sourceware.org/git/glibc.git synced 2026-01-06 11:51:29 +03:00

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.
This commit is contained in:
Samuel Thibault
2022-05-05 02:14:43 +02:00
parent c1b68685d4
commit eff158b75d

View File

@@ -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 ();