diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/pam_unix/bigcrypt.c | 8 | ||||
-rw-r--r-- | modules/pam_unix/bigcrypt.h | 1 | ||||
-rw-r--r-- | modules/pam_unix/bigcrypt_main.c | 2 | ||||
-rw-r--r-- | modules/pam_unix/pam_unix_passwd.c | 3 | ||||
-rw-r--r-- | modules/pam_unix/support.c | 9 |
5 files changed, 13 insertions, 10 deletions
diff --git a/modules/pam_unix/bigcrypt.c b/modules/pam_unix/bigcrypt.c index 6b73f3d2..d825bc71 100644 --- a/modules/pam_unix/bigcrypt.c +++ b/modules/pam_unix/bigcrypt.c @@ -24,12 +24,16 @@ * Andy Phillips <atp@mssl.ucl.ac.uk> */ +#include "config.h" + #include <string.h> #include <stdlib.h> #include <security/_pam_macros.h> +#ifdef HAVE_CRYPT_H +#include <crypt.h> +#endif -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/modules/pam_unix/bigcrypt.h b/modules/pam_unix/bigcrypt.h new file mode 100644 index 00000000..a66a96e6 --- /dev/null +++ b/modules/pam_unix/bigcrypt.h @@ -0,0 +1 @@ +extern char *bigcrypt(const char *key, const char *salt); diff --git a/modules/pam_unix/bigcrypt_main.c b/modules/pam_unix/bigcrypt_main.c index 70819072..fab212d9 100644 --- a/modules/pam_unix/bigcrypt_main.c +++ b/modules/pam_unix/bigcrypt_main.c @@ -1,7 +1,7 @@ #include <stdio.h> #include <string.h> -extern const char *bigcrypt(const char *password, const char *salt); +#include "bigcrypt.h" int main(int argc, char **argv) diff --git a/modules/pam_unix/pam_unix_passwd.c b/modules/pam_unix/pam_unix_passwd.c index fb96063e..a9d40281 100644 --- a/modules/pam_unix/pam_unix_passwd.c +++ b/modules/pam_unix/pam_unix_passwd.c @@ -84,6 +84,7 @@ static security_context_t prev_context=NULL; #include "yppasswd.h" #include "md5.h" #include "support.h" +#include "bigcrypt.h" #if !((__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 1)) extern int getrpcport(const char *host, unsigned long prognum, @@ -99,8 +100,6 @@ extern int getrpcport(const char *host, unsigned long prognum, # include "./lckpwdf.-c" #endif -extern char *bigcrypt(const char *key, const char *salt); - /* How it works: Gets in username (has to be done) from the calling program diff --git a/modules/pam_unix/support.c b/modules/pam_unix/support.c index cb89eb31..2dc49b80 100644 --- a/modules/pam_unix/support.c +++ b/modules/pam_unix/support.c @@ -28,14 +28,13 @@ #include "md5.h" #include "support.h" +#include "bigcrypt.h" #ifdef WITH_SELINUX #include <selinux/selinux.h> #define SELINUX_ENABLED is_selinux_enabled()>0 #else #define SELINUX_ENABLED 0 #endif -extern char *crypt(const char *key, const char *salt); -extern char *bigcrypt(const char *key, const char *salt); /* this is a front-end for module-application conversations */ @@ -527,12 +526,12 @@ static int _unix_run_helper_binary(pam_handle_t *pamh, const char *passwd, } /* exec binary helper */ - args[0] = x_strdup(CHKPWD_HELPER); + args[0] = strdup(CHKPWD_HELPER); args[1] = x_strdup(user); if (off(UNIX__NONULL, ctrl)) { /* this means we've succeeded */ - args[2]=x_strdup("nullok"); + args[2]=strdup("nullok"); } else { - args[2]=x_strdup("nonull"); + args[2]=strdup("nonull"); } execve(CHKPWD_HELPER, args, envp); |