about summary refs log tree commit diff
path: root/posix
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2023-11-22 08:38:33 +0100
committerFlorian Weimer <fweimer@redhat.com>2023-11-22 08:38:33 +0100
commit5d7f1bce7d8eea31f4baeb68bcc3124b35acc751 (patch)
treee9a4a7908362d7e08cdb8a2444ce262e2c242f8e /posix
parent780c33920281c5d5cc42a1e578bdc9218e675405 (diff)
downloadglibc-5d7f1bce7d8eea31f4baeb68bcc3124b35acc751.tar.gz
glibc-5d7f1bce7d8eea31f4baeb68bcc3124b35acc751.tar.xz
glibc-5d7f1bce7d8eea31f4baeb68bcc3124b35acc751.zip
posix: Revert the removal of the crypt prototype from <unistd.h>
Many applications still rely on this prototype.  Rebuilds without
this prototype result in an implicit function declaration, which can
introduce security vulnerabilities due to 32-bit pointer truncation.
Diffstat (limited to 'posix')
-rw-r--r--posix/unistd.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/posix/unistd.h b/posix/unistd.h
index 1f9cd8cbf0..5b91ad4aaa 100644
--- a/posix/unistd.h
+++ b/posix/unistd.h
@@ -1150,6 +1150,19 @@ ssize_t copy_file_range (int __infd, __off64_t *__pinoff,
 extern int fdatasync (int __fildes);
 #endif /* Use POSIX199309 */
 
+#ifdef __USE_MISC
+/* One-way hash PHRASE, returning a string suitable for storage in the
+   user database.  SALT selects the one-way function to use, and
+   ensures that no two users' hashes are the same, even if they use
+   the same passphrase.  The return value points to static storage
+   which will be overwritten by the next call to crypt.
+
+   This declaration is deprecated; applications should include
+   <crypt.h> instead.  */
+extern char *crypt (const char *__key, const char *__salt)
+     __THROW __nonnull ((1, 2));
+#endif
+
 #ifdef	__USE_XOPEN
 /* Swab pairs bytes in the first N bytes of the area pointed to by
    FROM and copy the result to TO.  The value of TO must not be in the