Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 663135 Details for
Bug 886995
open the cracklib dictionary directly to control how to handle errors
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
suggested libpwquality changes
libpwquality-look.patch (text/plain), 2.45 KB, created by
Nalin Dahyabhai
on 2012-12-13 19:03:17 UTC
(
hide
)
Description:
suggested libpwquality changes
Filename:
MIME Type:
Creator:
Nalin Dahyabhai
Created:
2012-12-13 19:03:17 UTC
Size:
2.45 KB
patch
obsolete
>Instead of FascistCheck(), which can exit if there's an error opening >the dictionary, use PWOpen()/FascistLook()/PWClose(), which lets us >handle the error ourselves. FascistLook() was provided but not declared >until cracklib 2.8.21, so we need to provide a prototype for it if the >headers which we have don't declare it. > >--- libpwquality/configure.in >+++ libpwquality/configure.in >@@ -142,13 +142,19 @@ AC_ARG_WITH(pythonsitedir, > AC_SUBST(PYTHONSITEDIR) > > dnl Check for cracklib >-AC_CHECK_HEADERS([crack.h], >- AC_CHECK_LIB([crack], [FascistCheck], LIBCRACK="-lcrack", LIBCRACK="")) >+AC_CHECK_HEADERS([crack.h packer.h], >+ AC_CHECK_LIB([crack], [FascistLook], LIBCRACK="-lcrack", LIBCRACK="")) > if test x$LIBCRACK = x ; then > AC_MSG_ERROR([No or unusable cracklib library]) > fi > AC_SUBST([LIBCRACK]) > >+AC_CHECK_DECLS([FascistLook],,,[ >+ #include <sys/types.h> >+ #include <packer.h> >+ #include <crack.h> >+]) >+ > AC_ARG_WITH([randomdev], AS_HELP_STRING([--with-randomdev=(<path>|yes)],[use specified random device instead of /dev/urandom]), opt_randomdev=$withval) > if test "$opt_randomdev" = yes -o -z "$opt_randomdev"; then > opt_randomdev="/dev/urandom" >--- libpwquality/src/check.c >+++ libpwquality/src/check.c >@@ -10,6 +10,7 @@ > #include <string.h> > #include <ctype.h> > #include <crack.h> >+#include <packer.h> > #include <sys/types.h> > #include <pwd.h> > #include <unistd.h> >@@ -17,6 +18,10 @@ > #include "pwquality.h" > #include "pwqprivate.h" > >+#if !HAVE_DECL_FASCISTLOOK >+char *FascistLook(PWDICT *pwp, char *instring); >+#endif >+ > #ifdef MIN > #undef MIN > #endif >@@ -644,7 +649,8 @@ int > pwquality_check(pwquality_settings_t *pwq, const char *password, > const char *oldpassword, const char *user, void **auxerror) > { >- const char *msg; >+ PWDICT *pw; >+ const char *dict_path, *msg; > int score; > > if (auxerror) >@@ -663,7 +669,15 @@ pwquality_check(pwquality_settings_t *pw > if (score != 0) > return score; > >- msg = FascistCheck(password, pwq->dict_path); >+ dict_path = pwq->dict_path ? pwq->dict_path : GetDefaultCracklibDict(); >+ pw = PWOpen(dict_path, "r"); >+ if (pw == NULL) { >+ if (auxerror) >+ *auxerror = (void *)msg; >+ return PWQ_ERROR_CRACKLIB_CHECK; >+ } >+ msg = FascistLook(pw, password); >+ PWClose(pw); > if (msg) { > if (auxerror) > *auxerror = (void *)msg;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 886995
:
663134
| 663135