Description: add missing includes and disable conflicting crypt_r()
 Nothing uses crypt_r() externally, it should use the glibc one; so disable
 the conflicting prototype in the internal header.
Author: Steve Langasek <steve.langasek@canonical.com>
Bug-Debian: https://bugs.debian.org/1067259
Last-Update: 2024-04-10
Forwarded: no

Index: jabberd2-2.7.0/storage/authreg_sqlite.c
===================================================================
--- jabberd2-2.7.0.orig/storage/authreg_sqlite.c
+++ jabberd2-2.7.0/storage/authreg_sqlite.c
@@ -32,6 +32,7 @@
 #define _XOPEN_SOURCE 500
 #include "c2s.h"
 #include <sqlite3.h>
+#include <crypt.h>
 
 /* Windows does not have the crypt() function, let's take DES_crypt from OpenSSL instead */
 #if defined(HAVE_OPENSSL_CRYPTO_H) && defined(_WIN32)
Index: jabberd2-2.7.0/storage/authreg_pgsql.c
===================================================================
--- jabberd2-2.7.0.orig/storage/authreg_pgsql.c
+++ jabberd2-2.7.0/storage/authreg_pgsql.c
@@ -32,6 +32,7 @@
 #else
 #ifdef HAVE_CRYPT
 #include <unistd.h>
+#include <crypt.h>
 #endif
 #endif
 
Index: jabberd2-2.7.0/storage/authreg_ldapfull.c
===================================================================
--- jabberd2-2.7.0.orig/storage/authreg_ldapfull.c
+++ jabberd2-2.7.0/storage/authreg_ldapfull.c
@@ -35,6 +35,7 @@
 #ifdef STORAGE_LDAP
 #ifdef HAVE_CRYPT
 #include <unistd.h>
+#include <crypt.h>
 #endif
 
 #ifdef HAVE_SSL
Index: jabberd2-2.7.0/util/crypt_blowfish.c
===================================================================
--- jabberd2-2.7.0.orig/util/crypt_blowfish.c
+++ jabberd2-2.7.0/util/crypt_blowfish.c
@@ -54,6 +54,8 @@
 /* Just to make sure the prototypes match the actual definitions */
 #include "crypt_blowfish.h"
 
+char *crypt_r(__const char *key, __const char *setting, void *data);
+
 #if defined(__i386__) || defined(__x86_64__) || defined(__alpha__) || defined(__hppa__)
 #define BF_SCALE			1
 #else
Index: jabberd2-2.7.0/util/crypt_blowfish.h
===================================================================
--- jabberd2-2.7.0.orig/util/crypt_blowfish.h
+++ jabberd2-2.7.0/util/crypt_blowfish.h
@@ -23,7 +23,6 @@
 #endif
 
 extern char *bcrypt(__const char *key, __const char *setting);
-extern char *crypt_r(__const char *key, __const char *setting, void *data);
 
 #ifndef __SKIP_OW
 extern char *crypt_rn(__const char *key, __const char *setting,
Index: jabberd2-2.7.0/storage/authreg_mysql.c
===================================================================
--- jabberd2-2.7.0.orig/storage/authreg_mysql.c
+++ jabberd2-2.7.0/storage/authreg_mysql.c
@@ -35,6 +35,7 @@
 #else
 #ifdef HAVE_CRYPT
 #include <unistd.h>
+#include <crypt.h>
 #endif
 #endif
 
