From eb1fae6a450b3cce5a75c1ed1a734520c56a6457 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Wed, 17 Jun 2015 20:14:18 +0000 Subject: Fix getpass fflush_unlocked namespace (bug 18540). The getpass function (XPG3 / XPG4 / UNIX98) calls fflush_unlocked (not in any of those standards). This patch fixes this by making fflush_unlocked into a weak alias for __fflush_unlocked and calling __fflush_unlocked from getpass. Tested for x86_64 and x86 (testsuite, and that disassembly of installed stripped shared libraries is unchanged by the patch). [BZ #18540] * libio/iofflush.c [!_IO_MTSAFE_IO] (__fflush_unlocked): Define as strong alias of _IO_fflush. Use libc_hidden_def. * libio/iofflush_u.c (fflush_unlocked): Rename to __fflush_unlocked and define as weak alias of __fflush_unlocked. Use libc_hidden_weak. * include/stdio.h (__fflush_unlocked): Declare. Use libc_hidden_proto. * misc/getpass.c (getpass): Call __fflush_unlocked instead of fflush_unlocked. * conform/Makefile (test-xfail-UNIX98/unistd.h/linknamespace): Remove variable. --- misc/getpass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'misc/getpass.c') diff --git a/misc/getpass.c b/misc/getpass.c index 36796db..dcaff38 100644 --- a/misc/getpass.c +++ b/misc/getpass.c @@ -91,7 +91,7 @@ getpass (prompt) /* Write the prompt. */ __fxprintf (out, "%s", prompt); - fflush_unlocked (out); + __fflush_unlocked (out); /* Read the password. */ nread = __getline (&buf, &bufsize, in); -- cgit v1.1