1
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
2
Subject: [PATCH] null pathnames shall return ENOENT
4
Here is a patch to fix chdir("") and chroot("") into returning ENOENT as
7
2009-09-13 Samuel Thibault <samuel.thibault@ens-lyon.org>
9
* hurd/hurdchdir.c (_hurd_change_directory_port_from_name):
10
Return ENOENT when name is empty.
11
* sysdeps/mach/hurd/chroot.c (chroot): Return ENOENT when path
15
http://sources.redhat.com/ml/libc-alpha/2009-09/msg00025.html
17
hurd/hurdchdir.c | 6 ++++++
18
sysdeps/mach/hurd/chroot.c | 6 ++++++
19
2 files changed, 12 insertions(+), 0 deletions(-)
21
diff --git a/hurd/hurdchdir.c b/hurd/hurdchdir.c
22
index 5115e4d..b1cc7a5 100644
23
--- a/hurd/hurdchdir.c
24
+++ b/hurd/hurdchdir.c
25
@@ -38,6 +38,12 @@ _hurd_change_directory_port_from_name (struct hurd_port *portcell,
27
if (len >= 2 && name[len - 2] == '/' && name[len - 1] == '.')
31
+ /* Special-case null pathname according to POSIX */
37
char *n = alloca (len + 3);
38
diff --git a/sysdeps/mach/hurd/chroot.c b/sysdeps/mach/hurd/chroot.c
39
index fde0164..cabeb7d 100644
40
--- a/sysdeps/mach/hurd/chroot.c
41
+++ b/sysdeps/mach/hurd/chroot.c
42
@@ -38,6 +38,12 @@ chroot (const char *path)
44
if (len >= 2 && path[len - 2] == '/' && path[len - 1] == '.')
48
+ /* Special-case null pathname according to POSIX */
54
char *n = alloca (len + 3);
55
tg: (0234227..) t/null-pathname (depends on: baseline)