From: Alejandro Colomar Date: Mon, 30 Oct 2023 11:53:37 +0000 (+0100) Subject: Remove FascistHistory() and FascistHistoryPw() calls X-Git-Tag: 4.15.0-rc1~128 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=43b4e5a6c41f5c43cad18810f9229e40e8c4a57e;p=thirdparty%2Fshadow.git Remove FascistHistory() and FascistHistoryPw() calls 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: Cc: Mike Frysinger Acked-by: Michael Vetter Signed-off-by: Alejandro Colomar --- diff --git a/configure.ac b/configure.ac index 2c8cca3fc..5c8c77647 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/lib/obscure.c b/lib/obscure.c index ccffb71db..4070d4e4d 100644 --- a/lib/obscure.c +++ b/lib/obscure.c @@ -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 } diff --git a/src/passwd.c b/src/passwd.c index 676086195..a4f493209 100644 --- a/src/passwd.c +++ b/src/passwd.c @@ -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; }