diff options
author | Timo Weingärtner <timo@tiwe.de> | 2013-05-10 21:27:56 +0200 |
---|---|---|
committer | Timo Weingärtner <timo@tiwe.de> | 2013-05-12 18:44:18 +0200 |
commit | 88dd2b1a22cd06fc401a8ddadd41114cebe159d5 (patch) | |
tree | 8f5e911e36bf06ef96ae33d1b76f61f350baceb6 | |
parent | 138c589dd4cdf68659bfa643e5659fa1200f6081 (diff) | |
download | libpam-pwdfile-88dd2b1a22cd06fc401a8ddadd41114cebe159d5.tar.gz |
include proper headers for crypt()
this also prepares for crypt_r()
-rw-r--r-- | bigcrypt.c | 5 | ||||
-rw-r--r-- | bigcrypt.h | 1 | ||||
-rw-r--r-- | pam_pwdfile.c | 15 |
3 files changed, 17 insertions, 4 deletions
@@ -24,10 +24,11 @@ * Andy Phillips <atp@mssl.ucl.ac.uk> */ +#define _XOPEN_SOURCE +#include <unistd.h> #include <string.h> -char *crypt(const char *key, const char *salt); -char *bigcrypt(const char *key, const char *salt); +#include "bigcrypt.h" /* * Max cleartext password length in segments of 8 characters this diff --git a/bigcrypt.h b/bigcrypt.h new file mode 100644 index 0000000..a66a96e --- /dev/null +++ b/bigcrypt.h @@ -0,0 +1 @@ +extern char *bigcrypt(const char *key, const char *salt); diff --git a/pam_pwdfile.c b/pam_pwdfile.c index 80cd893..34ce78d 100644 --- a/pam_pwdfile.c +++ b/pam_pwdfile.c @@ -42,6 +42,18 @@ * OF THE POSSIBILITY OF SUCH DAMAGE. */ +#ifdef USE_CRYPT_R +#define _GNU_SOURCE +#include <crypt.h> +#else +#ifndef _XOPEN_SOURCE +#define _XOPEN_SOURCE 700 +#endif +#ifndef _BSD_SOURCE +#define _BSD_SOURCE +#endif +#endif + #include <features.h> #include <syslog.h> #include <stdio.h> @@ -62,8 +74,7 @@ #include <security/pam_ext.h> #include "md5.h" -extern char *crypt(const char *key, const char *salt); -extern char *bigcrypt(const char *key, const char *salt); +#include "bigcrypt.h" #define CRYPTED_DESPWD_LEN 13 #define CRYPTED_MD5PWD_LEN 34 |