diff options
Diffstat (limited to 'patches-applied')
-rw-r--r-- | patches-applied/024_debian_cracklib_dict_path | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/patches-applied/024_debian_cracklib_dict_path b/patches-applied/024_debian_cracklib_dict_path index b0686f80..26cdac76 100644 --- a/patches-applied/024_debian_cracklib_dict_path +++ b/patches-applied/024_debian_cracklib_dict_path @@ -2,12 +2,50 @@ Index: Linux-PAM/modules/pam_cracklib/pam_cracklib.c =================================================================== --- Linux-PAM/modules/pam_cracklib/pam_cracklib.c.orig +++ Linux-PAM/modules/pam_cracklib/pam_cracklib.c +@@ -94,7 +94,7 @@ + int oth_credit; + int use_authtok; + char prompt_type[BUFSIZ]; +- char cracklib_dictpath[PATH_MAX]; ++ char *cracklib_dictpath; + }; + + #define CO_RETRY_TIMES 1 +@@ -159,14 +159,15 @@ + } else if (!strncmp(*argv,"use_authtok",11)) { + opt->use_authtok = 1; + } else if (!strncmp(*argv,"dictpath=",9)) { +- strncpy(opt->cracklib_dictpath, *argv+9, +- sizeof(opt->cracklib_dictpath) - 1); ++ opt->cracklib_dictpath = *argv+9; ++ if (!*(opt->cracklib_dictpath)) { ++ opt->cracklib_dictpath = CRACKLIB_DICTPATH; ++ } + } else { + pam_syslog(pamh,LOG_ERR,"pam_parse: unknown option; %s",*argv); + } + } + opt->prompt_type[sizeof(opt->prompt_type) - 1] = '\0'; +- opt->cracklib_dictpath[sizeof(opt->cracklib_dictpath) - 1] = '\0'; + + return ctrl; + } +@@ -514,8 +515,7 @@ + options.use_authtok = CO_USE_AUTHTOK; + memset(options.prompt_type, 0, BUFSIZ); + strcpy(options.prompt_type,"UNIX"); +- memset(options.cracklib_dictpath, 0, +- sizeof (options.cracklib_dictpath)); ++ options.cracklib_dictpath = CRACKLIB_DICTPATH; + + ctrl = _pam_parse(pamh, &options, argc, argv); + @@ -609,7 +609,7 @@ const char *crack_msg; D(("against cracklib")); - if ((crack_msg = FascistCheck(token1,options.cracklib_dictpath[0] == '\0'?NULL:options.cracklib_dictpath))) { -+ if ((crack_msg = FascistCheck(token1,options.cracklib_dictpath[0] == '\0'?CRACKLIB_DICTPATH:options.cracklib_dictpath))) { ++ if ((crack_msg = FascistCheck(token1,options.cracklib_dictpath))) { if (ctrl & PAM_DEBUG_ARG) pam_syslog(pamh,LOG_DEBUG,"bad password: %s",crack_msg); pam_error(pamh, _("BAD PASSWORD: %s"), crack_msg); |