diff options
Diffstat (limited to 'libc/sysdeps/unix/sysv/linux')
-rw-r--r-- | libc/sysdeps/unix/sysv/linux/configure | 2 | ||||
-rw-r--r-- | libc/sysdeps/unix/sysv/linux/configure.ac (renamed from libc/sysdeps/unix/sysv/linux/configure.in) | 0 | ||||
-rw-r--r-- | libc/sysdeps/unix/sysv/linux/powerpc/configure | 2 | ||||
-rw-r--r-- | libc/sysdeps/unix/sysv/linux/powerpc/configure.ac (renamed from libc/sysdeps/unix/sysv/linux/powerpc/configure.in) | 0 | ||||
-rw-r--r-- | libc/sysdeps/unix/sysv/linux/shm_open.c | 14 |
5 files changed, 10 insertions, 8 deletions
diff --git a/libc/sysdeps/unix/sysv/linux/configure b/libc/sysdeps/unix/sysv/linux/configure index 88fab5662..84dfbb87d 100644 --- a/libc/sysdeps/unix/sysv/linux/configure +++ b/libc/sysdeps/unix/sysv/linux/configure @@ -1,4 +1,4 @@ -# This file is generated from configure.in by Autoconf. DO NOT EDIT! +# This file is generated from configure.ac by Autoconf. DO NOT EDIT! # Local configure fragment for sysdeps/unix/sysv/linux. # Don't bother trying to generate any glue code to be compatible with the diff --git a/libc/sysdeps/unix/sysv/linux/configure.in b/libc/sysdeps/unix/sysv/linux/configure.ac index 5e5902d8e..5e5902d8e 100644 --- a/libc/sysdeps/unix/sysv/linux/configure.in +++ b/libc/sysdeps/unix/sysv/linux/configure.ac diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/configure b/libc/sysdeps/unix/sysv/linux/powerpc/configure index 7df7e481f..50e3639be 100644 --- a/libc/sysdeps/unix/sysv/linux/powerpc/configure +++ b/libc/sysdeps/unix/sysv/linux/powerpc/configure @@ -1,4 +1,4 @@ -# This file is generated from configure.in by Autoconf. DO NOT EDIT! +# This file is generated from configure.ac by Autoconf. DO NOT EDIT! # Local configure fragment for sysdeps/unix/sysv/linux/powerpc/. diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/configure.in b/libc/sysdeps/unix/sysv/linux/powerpc/configure.ac index 1768ab1f9..1768ab1f9 100644 --- a/libc/sysdeps/unix/sysv/linux/powerpc/configure.in +++ b/libc/sysdeps/unix/sysv/linux/powerpc/configure.ac diff --git a/libc/sysdeps/unix/sysv/linux/shm_open.c b/libc/sysdeps/unix/sysv/linux/shm_open.c index 41d93155a..482b49cfe 100644 --- a/libc/sysdeps/unix/sysv/linux/shm_open.c +++ b/libc/sysdeps/unix/sysv/linux/shm_open.c @@ -148,14 +148,15 @@ shm_open (const char *name, int oflag, mode_t mode) while (name[0] == '/') ++name; - if (name[0] == '\0') + namelen = strlen (name); + + /* Validate the filename. */ + if (name[0] == '\0' || namelen > NAME_MAX || strchr (name, '/') == NULL) { - /* The name "/" is not supported. */ __set_errno (EINVAL); return -1; } - namelen = strlen (name); fname = (char *) alloca (mountpoint.dirlen + namelen + 1); __mempcpy (__mempcpy (fname, mountpoint.dir, mountpoint.dirlen), name, namelen + 1); @@ -237,14 +238,15 @@ shm_unlink (const char *name) while (name[0] == '/') ++name; - if (name[0] == '\0') + namelen = strlen (name); + + /* Validate the filename. */ + if (name[0] == '\0' || namelen > NAME_MAX || strchr (name, '/') == NULL) { - /* The name "/" is not supported. */ __set_errno (ENOENT); return -1; } - namelen = strlen (name); fname = (char *) alloca (mountpoint.dirlen + namelen + 1); __mempcpy (__mempcpy (fname, mountpoint.dir, mountpoint.dirlen), name, namelen + 1); |