diff options
author | Joseph Myers <joseph@codesourcery.com> | 2015-05-22 17:09:36 +0000 |
---|---|---|
committer | Joseph Myers <joseph@codesourcery.com> | 2015-05-22 17:09:36 +0000 |
commit | cf06a4e3579d834c3330184c4ff127c98bc00fcc (patch) | |
tree | 8021cc34ee92db51ed9075a719e517a0a79458b3 /sysdeps/unix/sysv/linux | |
parent | 7348824c39c45d401f62f724ecad4e3479180578 (diff) | |
download | glibc-cf06a4e3579d834c3330184c4ff127c98bc00fcc.zip glibc-cf06a4e3579d834c3330184c4ff127c98bc00fcc.tar.gz glibc-cf06a4e3579d834c3330184c4ff127c98bc00fcc.tar.bz2 |
Fix pathconf basename namespace (bug 18444).
pathconf (sysdeps/unix/sysv/linux/pathconf.c) uses basename. But
pathconf is in POSIX back to 1990 while basename is only reserved with
external linkage in those standards including XPG functions. This
patch fixes this namespace issue in the usual way, renaming basename
to __basename and making it into a weak alias.
Tested for x86_64 and x86 (testsuite, and that disassembly of
installed shared libraries is unchanged by the patch).
[BZ #18444]
* string/basename.c (basename): Rename to __basename and define as
weak alias of __basename. Use libc_hidden_weak.
* include/string.h (__basename): Declare. Use libc_hidden_proto.
* sysdeps/unix/sysv/linux/pathconf.c (distinguish_extX): Call
__basename instead of basename.
* conform/Makefile (test-xfail-POSIX2008/unistd.h/linknamespace):
Remove variable.
(test-xfail-XOPEN2K8/unistd.h/linknamespace): Likewise.
Diffstat (limited to 'sysdeps/unix/sysv/linux')
-rw-r--r-- | sysdeps/unix/sysv/linux/pathconf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sysdeps/unix/sysv/linux/pathconf.c b/sysdeps/unix/sysv/linux/pathconf.c index e6fd7b5..37f308b 100644 --- a/sysdeps/unix/sysv/linux/pathconf.c +++ b/sysdeps/unix/sysv/linux/pathconf.c @@ -79,7 +79,7 @@ distinguish_extX (const struct statfs *fsbuf, const char *file, int fd) if (n != -1 && n < sizeof (path)) { path[n] = '\0'; - char *base = strdupa (basename (path)); + char *base = strdupa (__basename (path)); __snprintf (path, sizeof (path), "/sys/fs/ext4/%s", base); return __access (path, F_OK) == 0 ? EXT4_LINK_MAX : EXT2_LINK_MAX; |