Configure enables the use the crypt API - if available.
authorAdam Dickmeiss <adam@indexdata.dk>
Thu, 12 May 2005 08:02:46 +0000 (08:02 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Thu, 12 May 2005 08:02:46 +0000 (08:02 +0000)
NEWS
configure.in
util/passwddb.c

diff --git a/NEWS b/NEWS
index a7954a0..aabf39f 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,6 @@
---- 1.3.26 2005/05/04
+--- 1.3.26 2005/05/XX
+
+Configure enables the use the crypt API - if available.
 
 Fixed bug #304: Fuzzy search regExpr-2 did not use proper error distance
 of 1.
index f5e5bed..0ac7da5 100644 (file)
@@ -1,5 +1,5 @@
 dnl Zebra, Index Data Aps, 1995-2005
-dnl $Id: configure.in,v 1.91.2.10 2005-05-04 11:48:13 adam Exp $
+dnl $Id: configure.in,v 1.91.2.11 2005-05-12 08:02:47 adam Exp $
 dnl
 AC_INIT(include/zebraver.h)
 AM_INIT_AUTOMAKE(idzebra,1.3.26)
@@ -81,6 +81,12 @@ dnl
 dnl ------ times
 AC_CHECK_HEADERS(sys/times.h)
 dnl
+dnl ------ crypt
+AC_CHECK_LIB(crypt, crypt)
+if test "$ac_cv_lib_crypt_crypt" = "yes"; then
+       AC_CHECK_HEADERS(crypt.h)
+fi
+dnl
 dnl ------ mkstemp
 AC_CHECK_FUNCS(mkstemp)
 dnl
index 3db6189..9a7db71 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: passwddb.c,v 1.7 2002-08-02 19:26:57 adam Exp $
+/* $Id: passwddb.c,v 1.7.2.1 2005-05-12 08:02:47 adam Exp $
    Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
    Index Data Aps
 
@@ -28,11 +28,7 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include <string.h>
 #include <stdio.h>
 
-#ifndef USE_CRYPT
-#define USE_CRYPT 0
-#endif
-
-#if USE_CRYPT
+#if HAVE_CRYPT_H
 #include <crypt.h>
 #endif
 
@@ -128,7 +124,7 @@ void passwd_db_show (Passwd_db db)
 int passwd_db_auth (Passwd_db db, const char *user, const char *pass)
 {
        struct passwd_entry *pe;
-#if USE_CRYPT
+#if HAVE_CRYPT_H
        char salt[3];
        const char *des_try;
 #endif
@@ -137,7 +133,7 @@ int passwd_db_auth (Passwd_db db, const char *user, const char *pass)
                        break;
        if (!pe)
                return -1;
-#if USE_CRYPT
+#if HAVE_CRYPT_H
        if (strlen (pe->des) < 3)
                return -3;
        if (!pass)