]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
hurd: Fix looking up /dev/tty/ (BZ 34070)
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Tue, 14 Apr 2026 22:39:16 +0000 (00:39 +0200)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Tue, 14 Apr 2026 22:41:31 +0000 (00:41 +0200)
We need to keep the heading / to properly get an ENOTDIR, and set
file_name rather than change the retryname content.

Also, *result is normally used for the startdir.

hurd/lookup-retry.c

index 94ff0e32224d8134328e73382c6e005bd3c71d1e..2a5ea16cbaa1e5b3119a184d3840276e6aee1875 100644 (file)
@@ -323,9 +323,12 @@ __hurd_file_name_lookup_retry (error_t (*use_init_port)
                    err = opentty (result);
                    goto out;
                  case '/':
-                   if (err = opentty (&startdir))
+                   if (*result != MACH_PORT_NULL)
+                     __mach_port_deallocate (__mach_task_self (), *result);
+                   if (err = opentty (result))
                      goto out;
-                   memmove (retryname, &retryname[4], strlen(retryname + 4) + 1);
+                   startdir = *result;
+                   file_name = &retryname[3];
                    break;
                  default:
                    goto bad_magic;