]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
Remove FascistHistory() and FascistHistoryPw() calls
authorAlejandro Colomar <alx@kernel.org>
Mon, 30 Oct 2023 11:53:37 +0000 (12:53 +0100)
committerSerge Hallyn <serge@hallyn.com>
Sun, 26 Nov 2023 03:24:38 +0000 (21:24 -0600)
These functions don't seem to exist anymore.  I can't find them in
Debian, nor in a web search.  They probably were functions from an
ancient implementation of cracklib that doesn't exist anymore.

$ git remote -v
origin git@github.com:cracklib/cracklib.git (fetch)
origin git@github.com:cracklib/cracklib.git (push)
$ grep -rni fascisthistory
$ git log --grep FascistHistory
$ git log -S FascistHistory

Closes: <https://codesearch.debian.net/search?q=FascistHistory&literal=1>
Cc: Mike Frysinger <vapier@gentoo.org>
Acked-by: Michael Vetter <jubalh@iodoru.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
configure.ac
lib/obscure.c
src/passwd.c

index 2c8cca3fca55463aa3f9d5161c287bff4868c33f..5c8c77647e64a52a2100dafb8086db2901fbe576 100644 (file)
@@ -526,10 +526,6 @@ if test "$with_libcrack" = "yes"; then
        echo "checking cracklib flavour, don't be surprised by the results"
        AC_CHECK_LIB(crack, FascistCheck,
                [LIBCRACK=-lcrack AC_DEFINE(HAVE_LIBCRACK, 1, [Defined if you have libcrack.])])
-       AC_CHECK_LIB(crack, FascistHistory,
-               AC_DEFINE(HAVE_LIBCRACK_HIST, 1, [Defined if you have the ts&szs cracklib.]))
-       AC_CHECK_LIB(crack, FascistHistoryPw,
-               AC_DEFINE(HAVE_LIBCRACK_PW, 1, [Defined if it includes *Pw functions.]))
 fi
 
 if test "$with_btrfs" != "no"; then
index ccffb71db1ae4a779420848e2d548148236deb98..4070d4e4dbd2ab694bcb9fa32ddfa8fec89c5cc1 100644 (file)
@@ -100,11 +100,7 @@ static /*@observer@*//*@null@*/const char *password_check (
 #ifdef HAVE_LIBCRACK
        char *dictpath;
 
-#ifdef HAVE_LIBCRACK_PW
-       char *FascistCheckPw ();
-#else
        char *FascistCheck ();
-#endif
 #endif
 
        if (strcmp (new, old) == 0) {
@@ -133,11 +129,7 @@ static /*@observer@*//*@null@*/const char *password_check (
 
                dictpath = getdef_str ("CRACKLIB_DICTPATH");
                if (NULL != dictpath) {
-#ifdef HAVE_LIBCRACK_PW
-                       msg = FascistCheckPw (new, dictpath, pwdp);
-#else
                        msg = FascistCheck (new, dictpath);
-#endif
                }
 #endif
        }
index 6760861958230dc4980a4cf0690cd9b565cf7867..a4f493209aa82c707f33d99b46487512ce0b4789 100644 (file)
@@ -114,7 +114,6 @@ static bool do_update_pwd = false;
 /* local function prototypes */
 NORETURN static void usage (int);
 
-static bool reuse (const char *, const struct passwd *);
 static int new_password (const struct passwd *);
 
 static void check_password (const struct passwd *, const struct spwd *);
@@ -163,27 +162,6 @@ usage (int status)
        exit (status);
 }
 
-static bool reuse (const char *pass, const struct passwd *pw)
-{
-#ifdef HAVE_LIBCRACK_HIST
-       const char *reason;
-
-#ifdef HAVE_LIBCRACK_PW
-       const char *FascistHistoryPw (const char *, const struct passwd *);
-
-       reason = FascistHistory (pass, pw);
-#else                          /* !HAVE_LIBCRACK_PW */
-       const char *FascistHistory (const char *, int);
-
-       reason = FascistHistory (pass, pw->pw_uid);
-#endif                         /* !HAVE_LIBCRACK_PW */
-       if (NULL != reason) {
-               (void) printf (_("Bad password: %s.  "), reason);
-               return true;
-       }
-#endif                         /* HAVE_LIBCRACK_HIST */
-       return false;
-}
 
 /*
  * new_password - validate old password and replace with new (both old and
@@ -202,10 +180,6 @@ static int new_password (const struct passwd *pw)
        int pass_max_len = -1;
        const char *method;
 
-#ifdef HAVE_LIBCRACK_HIST
-       int HistUpdate (const char *, const char *);
-#endif                         /* HAVE_LIBCRACK_HIST */
-
        /*
         * Authenticate the user. The user will be prompted for their own
         * password.
@@ -306,7 +280,7 @@ static int new_password (const struct passwd *pw)
                STRTCPY(pass, cp);
                erase_pass (cp);
 
-               if (!amroot && (!obscure (orig, pass, pw) || reuse (pass, pw))) {
+               if (!amroot && !obscure(orig, pass, pw)) {
                        (void) puts (_("Try again."));
                        continue;
                }
@@ -317,7 +291,7 @@ static int new_password (const struct passwd *pw)
                 * --marekm
                 */
                if (amroot && !warned && getdef_bool ("PASS_ALWAYS_WARN")
-                   && (!obscure (orig, pass, pw) || reuse (pass, pw))) {
+                   && !obscure(orig, pass, pw)) {
                        (void) puts (_("\nWarning: weak password (enter it again to use it anyway)."));
                        warned = true;
                        continue;
@@ -357,9 +331,6 @@ static int new_password (const struct passwd *pw)
                return -1;
        }
 
-#ifdef HAVE_LIBCRACK_HIST
-       HistUpdate (pw->pw_name, crypt_passwd);
-#endif                         /* HAVE_LIBCRACK_HIST */
        STRTCPY(crypt_passwd, cp);
        return 0;
 }