about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog11
-rw-r--r--crypt/sha256-crypt.c4
-rw-r--r--crypt/sha512-crypt.c4
-rw-r--r--include/stdio.h1
-rw-r--r--stdio-common/Versions2
-rw-r--r--stdio-common/snprintf.c1
6 files changed, 19 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 25e1da152a..49e0ae7fed 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2016-11-16  Joseph Myers  <joseph@codesourcery.com>
+
+	[BZ #20829]
+	* stdio-common/Versions (__snprintf): Add to version
+	GLIBC_PRIVATE.
+	* include/stdio.h (__snprintf): Use libc_hidden_proto.
+	* stdio-common/snprintf.c (__snprintf): Use libc_hidden_def.
+	* crypt/sha256-crypt.c (__sha256_crypt_r): Use __snprintf instead
+	of snprintf.
+	* crypt/sha512-crypt.c (__sha512_crypt_r): Likewise.
+
 2016-11-16  Zack Weinberg  <zackw@panix.com>
 
 	* string/string.h: Remove obsolete comment stating that
diff --git a/crypt/sha256-crypt.c b/crypt/sha256-crypt.c
index ca703dec6d..d768234879 100644
--- a/crypt/sha256-crypt.c
+++ b/crypt/sha256-crypt.c
@@ -319,8 +319,8 @@ __sha256_crypt_r (const char *key, const char *salt, char *buffer, int buflen)
 
   if (rounds_custom)
     {
-      int n = snprintf (cp, MAX (0, buflen), "%s%zu$",
-			sha256_rounds_prefix, rounds);
+      int n = __snprintf (cp, MAX (0, buflen), "%s%zu$",
+			  sha256_rounds_prefix, rounds);
       cp += n;
       buflen -= n;
     }
diff --git a/crypt/sha512-crypt.c b/crypt/sha512-crypt.c
index c42e5b785d..f404c88b20 100644
--- a/crypt/sha512-crypt.c
+++ b/crypt/sha512-crypt.c
@@ -318,8 +318,8 @@ __sha512_crypt_r (const char *key, const char *salt, char *buffer, int buflen)
 
   if (rounds_custom)
     {
-      int n = snprintf (cp, MAX (0, buflen), "%s%zu$",
-			sha512_rounds_prefix, rounds);
+      int n = __snprintf (cp, MAX (0, buflen), "%s%zu$",
+			  sha512_rounds_prefix, rounds);
       cp += n;
       buflen -= n;
     }
diff --git a/include/stdio.h b/include/stdio.h
index 1ffbc40b3d..30e737efc2 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -11,6 +11,7 @@ extern int __fcloseall (void);
 extern int __snprintf (char *__restrict __s, size_t __maxlen,
 		       const char *__restrict __format, ...)
      __attribute__ ((__format__ (__printf__, 3, 4)));
+libc_hidden_proto (__snprintf)
 extern int __vsnprintf (char *__restrict __s, size_t __maxlen,
 			const char *__restrict __format, _G_va_list __arg)
      __attribute__ ((__format__ (__printf__, 3, 0)));
diff --git a/stdio-common/Versions b/stdio-common/Versions
index 06b96f678a..5016f69c20 100644
--- a/stdio-common/Versions
+++ b/stdio-common/Versions
@@ -60,5 +60,7 @@ libc {
   GLIBC_PRIVATE {
     # global variables
     _itoa_lower_digits;
+    # Used in libcrypt.
+    __snprintf;
   }
 }
diff --git a/stdio-common/snprintf.c b/stdio-common/snprintf.c
index a3cc518976..ce7ce06077 100644
--- a/stdio-common/snprintf.c
+++ b/stdio-common/snprintf.c
@@ -35,4 +35,5 @@ __snprintf (char *s, size_t maxlen, const char *format, ...)
 
   return done;
 }
+libc_hidden_def (__snprintf)
 ldbl_weak_alias (__snprintf, snprintf)