Relevant BUGIDs:
authorThorsten Kukuk <kukuk@thkukuk.de>
Thu, 15 Jun 2006 21:09:49 +0000 (21:09 +0000)
committerThorsten Kukuk <kukuk@thkukuk.de>
Thu, 15 Jun 2006 21:09:49 +0000 (21:09 +0000)
Purpose of commit: cleanup

Commit summary:
---------------

Put bigcrypt prototype in own header instead of an external declaration
in every single file calling bigcrypt:

2006-06-15  Thorsten Kukuk  <kukuk@thkukuk.de>

        * modules/pam_unix/bigcrypt.h: New.
        * modules/pam_unix/Makefile.am: Add bigcrypt.h.
        * modules/pam_unix/bigcrypt.c: Include bigcrypt.h.
        * modules/pam_unix/support.c: Include bigcrypt.h, remove
        own prototype.
        * modules/pam_unix/bigcrypt_main.c: Include bigcrypt.h, remove
        own prototype.
        * modules/pam_unix/pam_unix_passwd.c: Include bigcrypt.h, remove
        own prototype.

ChangeLog
modules/pam_unix/bigcrypt.c
modules/pam_unix/bigcrypt.h [new file with mode: 0644]
modules/pam_unix/bigcrypt_main.c
modules/pam_unix/pam_unix_passwd.c
modules/pam_unix/support.c

index 5ec2a09fbec3099ee9e4c466b90dd120d9b041cf..b3a9c6f5b327cae86b06dd50280ab8ca14f68e9d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2006-06-15  Thorsten Kukuk  <kukuk@thkukuk.de>
 
+       * modules/pam_unix/bigcrypt.h: New.
+       * modules/pam_unix/Makefile.am: Add bigcrypt.h.
+       * modules/pam_unix/bigcrypt.c: Include bigcrypt.h.
+       * modules/pam_unix/support.c: Include bigcrypt.h, remove
+       own prototype.
+       * modules/pam_unix/bigcrypt_main.c: Include bigcrypt.h, remove
+       own prototype.
+       * modules/pam_unix/pam_unix_passwd.c: Include bigcrypt.h, remove
+       own prototype.
+
        * modules/pam_time/pam_time.c (logic_member): Remove unused
        variable len.
 
index 6b73f3d254e9455059148f8b900d115d0dda5e67..d825bc714722348ee38a30e1a18962241fdcfb2a 100644 (file)
  * 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 (file)
index 0000000..a66a96e
--- /dev/null
@@ -0,0 +1 @@
+extern char *bigcrypt(const char *key, const char *salt);
index 708190725b079ee257477f9f0a31d485a7004fe0..fab212d901ba7038660e17c483780516d9f60f8b 100644 (file)
@@ -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)
index fb96063e0f14df143b1f99c252f296403879e0a6..a9d40281c3f31616a100914bc2b3442a54034745 100644 (file)
@@ -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
index cb89eb31c72b8096486a0a6aa1e242ba7c5f42de..2dc49b801d7e849d06f0a14233e5d0384050d1e1 100644 (file)
 
 #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);