mirror of
https://sourceware.org/git/glibc.git
synced 2025-01-03 00:10:10 +00:00
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.
This commit is contained in:
parent
7348824c39
commit
cf06a4e357
12
ChangeLog
12
ChangeLog
@ -1,3 +1,15 @@
|
|||||||
|
2015-05-22 Joseph Myers <joseph@codesourcery.com>
|
||||||
|
|
||||||
|
[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.
|
||||||
|
|
||||||
2015-05-18 Florian Weimer <fweimer@redhat.com>
|
2015-05-18 Florian Weimer <fweimer@redhat.com>
|
||||||
|
|
||||||
* libio/libioP.h (_IO_MEMBER_TYPE, _IO_CAST_FIELD_ACCESS)
|
* libio/libioP.h (_IO_MEMBER_TYPE, _IO_CAST_FIELD_ACCESS)
|
||||||
|
2
NEWS
2
NEWS
@ -18,7 +18,7 @@ Version 2.22
|
|||||||
18030, 18032, 18036, 18038, 18039, 18042, 18043, 18046, 18047, 18049,
|
18030, 18032, 18036, 18038, 18039, 18042, 18043, 18046, 18047, 18049,
|
||||||
18068, 18080, 18093, 18100, 18104, 18110, 18111, 18125, 18128, 18138,
|
18068, 18080, 18093, 18100, 18104, 18110, 18111, 18125, 18128, 18138,
|
||||||
18185, 18196, 18197, 18206, 18210, 18211, 18217, 18220, 18221, 18244,
|
18185, 18196, 18197, 18206, 18210, 18211, 18217, 18220, 18221, 18244,
|
||||||
18247, 18287, 18319, 18333, 18346, 18397, 18409, 18418, 18434.
|
18247, 18287, 18319, 18333, 18346, 18397, 18409, 18418, 18434, 18444.
|
||||||
|
|
||||||
* Cache information can be queried via sysconf() function on s390 e.g. with
|
* Cache information can be queried via sysconf() function on s390 e.g. with
|
||||||
_SC_LEVEL1_ICACHE_SIZE as argument.
|
_SC_LEVEL1_ICACHE_SIZE as argument.
|
||||||
|
@ -395,10 +395,8 @@ test-xfail-XOPEN2K/wordexp.h/linknamespace = yes
|
|||||||
test-xfail-POSIX2008/grp.h/linknamespace = yes
|
test-xfail-POSIX2008/grp.h/linknamespace = yes
|
||||||
test-xfail-POSIX2008/netdb.h/linknamespace = yes
|
test-xfail-POSIX2008/netdb.h/linknamespace = yes
|
||||||
test-xfail-POSIX2008/semaphore.h/linknamespace = yes
|
test-xfail-POSIX2008/semaphore.h/linknamespace = yes
|
||||||
test-xfail-POSIX2008/unistd.h/linknamespace = yes
|
|
||||||
test-xfail-XOPEN2K8/fmtmsg.h/linknamespace = yes
|
test-xfail-XOPEN2K8/fmtmsg.h/linknamespace = yes
|
||||||
test-xfail-XOPEN2K8/grp.h/linknamespace = yes
|
test-xfail-XOPEN2K8/grp.h/linknamespace = yes
|
||||||
test-xfail-XOPEN2K8/netdb.h/linknamespace = yes
|
test-xfail-XOPEN2K8/netdb.h/linknamespace = yes
|
||||||
test-xfail-XOPEN2K8/pwd.h/linknamespace = yes
|
test-xfail-XOPEN2K8/pwd.h/linknamespace = yes
|
||||||
test-xfail-XOPEN2K8/syslog.h/linknamespace = yes
|
test-xfail-XOPEN2K8/syslog.h/linknamespace = yes
|
||||||
test-xfail-XOPEN2K8/unistd.h/linknamespace = yes
|
|
||||||
|
@ -82,6 +82,8 @@ libc_hidden_proto (__strndup)
|
|||||||
libc_hidden_proto (__strerror_r)
|
libc_hidden_proto (__strerror_r)
|
||||||
libc_hidden_proto (__strverscmp)
|
libc_hidden_proto (__strverscmp)
|
||||||
libc_hidden_proto (basename)
|
libc_hidden_proto (basename)
|
||||||
|
extern char *__basename (const char *__filename) __THROW __nonnull ((1));
|
||||||
|
libc_hidden_proto (__basename)
|
||||||
libc_hidden_proto (strcoll)
|
libc_hidden_proto (strcoll)
|
||||||
libc_hidden_proto (__strcoll_l)
|
libc_hidden_proto (__strcoll_l)
|
||||||
libc_hidden_proto (__strxfrm_l)
|
libc_hidden_proto (__strxfrm_l)
|
||||||
|
@ -19,9 +19,11 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
char *
|
char *
|
||||||
basename (const char *filename)
|
__basename (const char *filename)
|
||||||
{
|
{
|
||||||
char *p = strrchr (filename, '/');
|
char *p = strrchr (filename, '/');
|
||||||
return p ? p + 1 : (char *) filename;
|
return p ? p + 1 : (char *) filename;
|
||||||
}
|
}
|
||||||
libc_hidden_def (basename)
|
libc_hidden_def (__basename)
|
||||||
|
weak_alias (__basename, basename)
|
||||||
|
libc_hidden_weak (basename)
|
||||||
|
@ -79,7 +79,7 @@ distinguish_extX (const struct statfs *fsbuf, const char *file, int fd)
|
|||||||
if (n != -1 && n < sizeof (path))
|
if (n != -1 && n < sizeof (path))
|
||||||
{
|
{
|
||||||
path[n] = '\0';
|
path[n] = '\0';
|
||||||
char *base = strdupa (basename (path));
|
char *base = strdupa (__basename (path));
|
||||||
__snprintf (path, sizeof (path), "/sys/fs/ext4/%s", base);
|
__snprintf (path, sizeof (path), "/sys/fs/ext4/%s", base);
|
||||||
|
|
||||||
return __access (path, F_OK) == 0 ? EXT4_LINK_MAX : EXT2_LINK_MAX;
|
return __access (path, F_OK) == 0 ? EXT4_LINK_MAX : EXT2_LINK_MAX;
|
||||||
|
Loading…
Reference in New Issue
Block a user