diff options
author | vorlon <Unknown> | 2007-08-22 03:43:00 +0000 |
---|---|---|
committer | vorlon <Unknown> | 2007-08-22 03:43:00 +0000 |
commit | 406f2f625618ca54c102b54033034753e2ec4549 (patch) | |
tree | 3a02af08741eec78a24a632570bf825247b71519 | |
parent | 21ebb611d200aeca40362374fc8fb74eef40a13f (diff) | |
download | pam-406f2f625618ca54c102b54033034753e2ec4549.tar.gz pam-406f2f625618ca54c102b54033034753e2ec4549.tar.bz2 pam-406f2f625618ca54c102b54033034753e2ec4549.zip |
Remove unnecessary string copies, which break on the Hurd due to PATH_MAX.
-rw-r--r-- | changelog | 3 | ||||
-rw-r--r-- | patches-applied/024_debian_cracklib_dict_path | 40 |
2 files changed, 41 insertions, 2 deletions
@@ -65,7 +65,8 @@ pam (0.99.7.1-2) UNRELEASED; urgency=low * Patch 024: CRACKLIB_DICTPATH is no longer set in configure.in, so patch pam_cracklib.c instead to use the default dictpath already available from crack.h; and patch configure.in to use AC_CHECK_HEADERS instead - of AC_CHECK_HEADER, so crack.h is actually included. + of AC_CHECK_HEADER, so crack.h is actually included. Also remove + unnecessary string copies, which break on the Hurd due to PATH_MAX. * Patch 038: partially merged/superseded upstream * Patch 061: partially merged upstream * Use ${binary:Version} instead of ${Source-Version} in 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); |