]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
hurd: Fix fdopendir checking for directory type
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Thu, 28 May 2020 10:13:14 +0000 (10:13 +0000)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Thu, 28 May 2020 10:15:33 +0000 (10:15 +0000)
* sysdeps/mach/hurd/fdopendir.c (__fdopendir): Lookup "./" instead of
"/" that would designate the root of the filesystem.

sysdeps/mach/hurd/fdopendir.c

index f15801f141261357bc0cad6dacb3310995729927..0583cdca0fb11a69b6ec55c5c3411dda7c580d32 100644 (file)
@@ -39,7 +39,7 @@ __fdopendir (int fd)
   /* Ensure that it's a directory.  */
   error_t err = HURD_FD_PORT_USE
     (d, ({
-       file_t dir = __file_name_lookup_under (port, "/",
+       file_t dir = __file_name_lookup_under (port, "./",
                                               O_DIRECTORY | O_NOTRANS, 0);;
        if (dir != MACH_PORT_NULL)
          __mach_port_deallocate (__mach_task_self (), dir);