From 5371d99e8766f25864ddf20fb0866e57fc0b7991 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Fri, 12 Jun 2015 20:02:30 +0000 Subject: Fix getlogin_r namespace (bug 18527). Various functions in XPG4 bring in references to getlogin_r, which is not in XPG4; this is also a bug for some older POSIX versions which aren't yet covered by the linknamespace tests. This patch fixes this by making getlogin_r into a weak alias for __getlogin_r and using __getlogin_r as needed. Tested for x86_64 and x86 (testsuite, and that disassembly of installed stripped shared libraries is unchanged by the patch). [BZ #18527] * login/getlogin_r.c (getlogin_r): Rename to __getlogin_r and define as weak alias of __getlogin_r. Use libc_hidden_weak. * sysdeps/mach/hurd/getlogin_r.c (getlogin_r): Likewise. * sysdeps/unix/getlogin_r.c (getlogin_r): Likewise. * sysdeps/unix/sysv/linux/getlogin_r.c (getlogin_r): Likewise. * include/unistd.h (__getlogin_r): Declare. Use libc_hidden_proto. * posix/glob.c (glob): Call __getlogin_r instead of getlogin_r. * conform/Makefile (test-xfail-XPG3/glob.h/linknamespace): Remove variable. (test-xfail-XPG3/wordexp.h/linknamespace): Likewise. (test-xfail-XPG4/glob.h/linknamespace): Likewise. (test-xfail-XPG4/wordexp.h/linknamespace): Likewise. --- conform/Makefile | 4 ---- 1 file changed, 4 deletions(-) (limited to 'conform/Makefile') diff --git a/conform/Makefile b/conform/Makefile index 8c11dc41c8..57dbc9225e 100644 --- a/conform/Makefile +++ b/conform/Makefile @@ -345,15 +345,11 @@ test-xfail-XOPEN2K/ndbm.h/linknamespace = yes test-xfail-XOPEN2K8/ndbm.h/linknamespace = yes # Unsorted expected failures. -test-xfail-XPG3/glob.h/linknamespace = yes test-xfail-XPG3/unistd.h/linknamespace = yes -test-xfail-XPG3/wordexp.h/linknamespace = yes test-xfail-XPG4/fmtmsg.h/linknamespace = yes -test-xfail-XPG4/glob.h/linknamespace = yes test-xfail-XPG4/netdb.h/linknamespace = yes test-xfail-XPG4/syslog.h/linknamespace = yes test-xfail-XPG4/unistd.h/linknamespace = yes -test-xfail-XPG4/wordexp.h/linknamespace = yes test-xfail-POSIX/mqueue.h/linknamespace = yes test-xfail-POSIX/semaphore.h/linknamespace = yes test-xfail-UNIX98/fmtmsg.h/linknamespace = yes -- cgit 1.4.1