r283: removing --with-cracklib after discussion with abartklet @ sambaXP
authorGerald Carter <jerry@samba.org>
Mon, 19 Apr 2004 17:05:31 +0000 (17:05 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:51:16 +0000 (10:51 -0500)
source/configure.in
source/param/loadparm.c
source/smbd/chgpasswd.c
source/tests/crack.c [deleted file]

index c19a9361b225b19746296640ccf4803ef7c293ac..a03b37dd77b7019c27b651d88a86a83e2123663f 100644 (file)
@@ -3000,63 +3000,6 @@ fi
 fi
 
 
-dictpath="/usr/lib/cracklib_dict"
-with_cracklib=yes
-###############################################
-# test for where we get FaciestCheck from
-AC_MSG_CHECKING(where to use cracklib from (default=$dictpath))
-AC_ARG_WITH(cracklib,
-[  --with-cracklib[=DIR]     Look for cracklib dictionary in this location ],
-[  case "$withval" in
-  yes)
-    AC_MSG_RESULT(${dictpath})
-    ;;
-  no)
-    AC_MSG_RESULT(no)
-      dictpath=""
-    ;;
-  *)
-      dictpath="$withval"
-    AC_MSG_RESULT(${dictpath})
-    ;;
-  esac ],
-  dictpath=""
-  AC_MSG_RESULT(no)
-)
-
-if test x$dictpath != x""; then
-     AC_SEARCH_LIBS(FascistCheck, [crack],
-                    [test "$ac_cv_search_crack" = "none required" || samba_cv_found_crack="yes"
-                    AC_DEFINE(HAVE_CRACK,1,[Whether the system has the FaciestCheck function from cracklib])])
-
-     crack_saved_libs=$LIBS;
-
-     if test x$samba_cv_found_crack=x"yes"; then
-        AC_SEARCH_LIBS(CRACKLIB_DICTPATH, [crypt],
-            AC_DEFINE(HAVE_CRACKLIB_DICTPATH, 1, [Whether we have given a CRACKLIB_DICTPATH in our headers])
-        )
-
-       AC_DEFINE_UNQUOTED(SAMBA_CRACKLIB_DICTPATH, "$dictpath", [Where the cracklib dictionay is])
-        AC_MSG_CHECKING(Whether we have a working cracklib)
-        AC_TRY_RUN([
-               #include "${srcdir-.}/tests/crack.c"],
-              AC_MSG_RESULT(yes)
-              AC_DEFINE(HAVE_WORKING_CRACKLIB,1,[Whether we have a working cracklib])
-             AUTH_LIBS="-lcrack $AUTH_LIBS",
-
-              AC_MSG_RESULT(no)
-             AC_MSG_WARN(cracklib exists - but does not function correctly),
-
-              AC_MSG_RESULT(no)
-             AC_MSG_WARN(cannot test-run when cross-compiling)
-             )
-    else
-        AC_MSG_CHECKING(Whether we have cracklib)
-        AC_MSG_RESULT(no)
-    fi
-    LIBS=$crack_saved_libs
-fi
-
 ########################################################################################
 ##
 ## TESTS FOR SAM BACKENDS.  KEEP THESE GROUPED TOGETHER
index edd1bc0be78202c25f539b7b8b4f74a669f7b33b..e47fc3ebad821ded744dd32bf1f4623d24d73b96 100644 (file)
@@ -214,7 +214,6 @@ typedef struct
        int change_notify_timeout;
        int map_to_guest;
        int min_passwd_length;
-       BOOL use_cracklib;
        int oplock_break_wait_time;
        int winbind_cache_time;
        int iLockSpinCount;
@@ -790,7 +789,6 @@ static struct parm_struct parm_table[] = {
        {"hosts equiv", P_STRING, P_GLOBAL, &Globals.szHostsEquiv, NULL, NULL, FLAG_ADVANCED}, 
        {"min passwd length", P_INTEGER, P_GLOBAL, &Globals.min_passwd_length, NULL, NULL, FLAG_ADVANCED}, 
        {"min password length", P_INTEGER, P_GLOBAL, &Globals.min_passwd_length, NULL, NULL, FLAG_ADVANCED}, 
-       {"use cracklib", P_BOOL, P_GLOBAL, &Globals.use_cracklib, NULL, NULL, FLAG_ADVANCED}, 
        {"map to guest", P_ENUM, P_GLOBAL, &Globals.map_to_guest, NULL, enum_map_to_guest, FLAG_ADVANCED}, 
        {"null passwords", P_BOOL, P_GLOBAL, &Globals.bNullPasswords, NULL, NULL, FLAG_ADVANCED}, 
        {"obey pam restrictions", P_BOOL, P_GLOBAL, &Globals.bObeyPamRestrictions, NULL, NULL, FLAG_ADVANCED}, 
@@ -1437,7 +1435,6 @@ static void init_globals(void)
 
        Globals.map_to_guest = 0;       /* By Default, "Never" */
        Globals.min_passwd_length = MINPASSWDLENGTH;    /* By Default, 5. */
-       Globals.use_cracklib = False; 
        Globals.oplock_break_wait_time = 0;     /* By Default, 0 msecs. */
        Globals.enhanced_browsing = True; 
        Globals.iLockSpinCount = 3; /* Try 3 times. */
@@ -1787,7 +1784,6 @@ FN_GLOBAL_INTEGER(lp_machine_password_timeout, &Globals.machine_password_timeout
 FN_GLOBAL_INTEGER(lp_change_notify_timeout, &Globals.change_notify_timeout)
 FN_GLOBAL_INTEGER(lp_map_to_guest, &Globals.map_to_guest)
 FN_GLOBAL_INTEGER(lp_min_passwd_length, &Globals.min_passwd_length)
-FN_GLOBAL_BOOL(lp_use_cracklib, &Globals.use_cracklib)
 FN_GLOBAL_INTEGER(lp_oplock_break_wait_time, &Globals.oplock_break_wait_time)
 FN_GLOBAL_INTEGER(lp_lock_spin_count, &Globals.iLockSpinCount)
 FN_GLOBAL_INTEGER(lp_lock_sleep_time, &Globals.iLockSpinTime)
index d928445d94e6d8e389e8f3ae306be878b7040756..ca13a167fb0670df6ab8ae43413fd1ed8b95e353 100644 (file)
 
 #include "includes.h"
 
-#ifdef HAVE_WORKING_CRACKLIB
-#include <crack.h>
-
-#ifndef HAVE_CRACKLIB_DICTPATH
-#ifndef CRACKLIB_DICTPATH
-#define CRACKLIB_DICTPATH SAMBA_CRACKLIB_DICTPATH
-#endif
-#endif
-#endif
-
 extern struct passdb_ops pdb_ops;
 
 static NTSTATUS check_oem_password(const char *user,
@@ -985,43 +975,6 @@ NTSTATUS change_oem_password(SAM_ACCOUNT *hnd, char *old_passwd, char *new_passw
                DEBUG(1, ("check_oem_password: Username does not exist in system !?!\n"));
        }
 
-#ifdef HAVE_WORKING_CRACKLIB
-       if (pass) {
-               /* if we can, become the user to overcome internal cracklib sillyness */
-               if (!push_sec_ctx())
-                       return NT_STATUS_UNSUCCESSFUL;
-               
-               set_sec_ctx(pass->pw_uid, pass->pw_gid, 0, NULL, NULL);
-               set_re_uid();
-       }
-
-       if (lp_use_cracklib()) {
-               const char *crack_check_reason;
-               DEBUG(4, ("change_oem_password: Checking password for user [%s]"
-                         " against cracklib. \n", pdb_get_username(hnd)));
-               DEBUGADD(4, ("If this is your last message, then something is "
-                            "wrong with cracklib, it might be missing it's "
-                            "dictionaries at %s\n", 
-                            CRACKLIB_DICTPATH));
-               dbgflush();
-
-               crack_check_reason = FascistCheck(new_passwd, (char *)CRACKLIB_DICTPATH);
-               if (crack_check_reason) {
-                       DEBUG(1, ("Password Change: user [%s], "
-                                 "New password failed cracklib test - %s\n",
-                         pdb_get_username(hnd), crack_check_reason));
-                       
-                       /* get back to where we should be */
-                       if (pass)
-                               pop_sec_ctx();
-                       return NT_STATUS_PASSWORD_RESTRICTION;
-               }
-       }
-
-       if (pass)
-               pop_sec_ctx();
-#endif
-
        /*
         * If unix password sync was requested, attempt to change
         * the /etc/passwd database first. Return failure if this cannot
diff --git a/source/tests/crack.c b/source/tests/crack.c
deleted file mode 100644 (file)
index 36119b3..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <crack.h>
-
-#ifndef HAVE_CRACKLIB_DICTPATH
-#ifndef CRACKLIB_DICTPATH
-#define CRACKLIB_DICTPATH SAMBA_CRACKLIB_DICTPATH
-#endif
-#endif
-
-int main(int argc, char **argv) {
-       FascistCheck("Foo", CRACKLIB_DICTPATH);
-       return 0;
-}