1*bf6873c5SCy Schubert User-Visible pam-krb5 Changes 2*bf6873c5SCy Schubert 3*bf6873c5SCy Schubertpam-krb5 4.11 (2021-10-17) 4*bf6873c5SCy Schubert 5*bf6873c5SCy Schubert Properly support calling pam_end with PAM_DATA_SILENT by not deleting 6*bf6873c5SCy Schubert the underlying ticket cache. This flag is used when the application 7*bf6873c5SCy Schubert is closing the PAM session after a fork to free memory resources, but 8*bf6873c5SCy Schubert doesn't intend to free resources external to the process because 9*bf6873c5SCy Schubert another process may still depend on them. Thanks to Andrew G. Morgan 10*bf6873c5SCy Schubert for the report. (GitHub #21) 11*bf6873c5SCy Schubert 12*bf6873c5SCy Schubert Stop attempting to guess the correct PAM module installation path on 13*bf6873c5SCy Schubert Linux systems when --prefix is set to /usr and instead document that 14*bf6873c5SCy Schubert --libdir will probably need to be set explicitly. The previous logic 15*bf6873c5SCy Schubert is now broken on Debian usrmerge systems and the guesswork seems too 16*bf6873c5SCy Schubert fragile to maintain. 17*bf6873c5SCy Schubert 18*bf6873c5SCy Schubert Update to rra-c-util 10.0: 19*bf6873c5SCy Schubert 20*bf6873c5SCy Schubert * Support Autoconf 2.71 without warnings. 21*bf6873c5SCy Schubert * Tests written in Perl now require Perl 5.10 or later. 22*bf6873c5SCy Schubert 23*bf6873c5SCy Schubertpam-krb5 4.10 (2021-03-20) 24*bf6873c5SCy Schubert 25*bf6873c5SCy Schubert When re-retrieving the authenticated principal from the current cache, 26*bf6873c5SCy Schubert ensure the stored principal in the authentication context is always 27*bf6873c5SCy Schubert either valid or NULL. Otherwise, a failure of krb5_cc_get_principal 28*bf6873c5SCy Schubert could result in a double free. Thanks to Michael Muehle for the 29*bf6873c5SCy Schubert report. 30*bf6873c5SCy Schubert 31*bf6873c5SCy Schubert Update to rra-c-util 9.0: 32*bf6873c5SCy Schubert 33*bf6873c5SCy Schubert * Check that at least one Kerberos header file was found and works. 34*bf6873c5SCy Schubert * Use AS_ECHO in all Autoconf macros in preference to echo. 35*bf6873c5SCy Schubert * Fix portability of reallocarray on NetBSD systems. 36*bf6873c5SCy Schubert * Stop providing a replacement for a broken snprintf. 37*bf6873c5SCy Schubert 38*bf6873c5SCy Schubert Update to C TAP Harness 4.7: 39*bf6873c5SCy Schubert 40*bf6873c5SCy Schubert * Fix warnings with GCC 10. 41*bf6873c5SCy Schubert 42*bf6873c5SCy Schubertpam-krb5 4.9 (2020-03-30) 43*bf6873c5SCy Schubert 44*bf6873c5SCy Schubert SECURITY: All previous versions of this module could overflow the 45*bf6873c5SCy Schubert buffer provided by the underlying Kerberos library for the response to 46*bf6873c5SCy Schubert a prompt by writing a single nul character past the end of the buffer. 47*bf6873c5SCy Schubert (CVE-2020-10595) 48*bf6873c5SCy Schubert 49*bf6873c5SCy Schubert Support use_pkinit with MIT Kerberos. (Debian Bug#871699) 50*bf6873c5SCy Schubert 51*bf6873c5SCy Schubert Reject passwords as long or longer than PAM_MAX_RESP_SIZE (normally 52*bf6873c5SCy Schubert 512 octets), since extremely long passwords can be used for a denial 53*bf6873c5SCy Schubert of service attack via the Kerberos string to key function. Thanks to 54*bf6873c5SCy Schubert Florian Best for pointing out this issue and suggesting a good fix. 55*bf6873c5SCy Schubert 56*bf6873c5SCy Schubert Use explicit_bzero instead of memset, where available, to overwrite 57*bf6873c5SCy Schubert the memory used by PAM responses before freeing. This reduces the 58*bf6873c5SCy Schubert lifetime of passwords and other secrets in memory. 59*bf6873c5SCy Schubert 60*bf6873c5SCy Schubert Return more accurate errors from the Kerberos prompter function if it 61*bf6873c5SCy Schubert was unable to prompt for the password. This may translate into better 62*bf6873c5SCy Schubert debug log messages and, in some situations, returning the slightly 63*bf6873c5SCy Schubert more accurate PAM_AUTHINFO_UNAVAIL instead of PAM_AUTH_ERR. 64*bf6873c5SCy Schubert 65*bf6873c5SCy Schubert Fix an edge-case memory leak in pam_chauthtok when prompting for a new 66*bf6873c5SCy Schubert password for an ignored user. 67*bf6873c5SCy Schubert 68*bf6873c5SCy Schubert Ensure the module/basic test will run properly when the system 69*bf6873c5SCy Schubert krb5.conf file does not specify a default realm. Reported by TBK. 70*bf6873c5SCy Schubert 71*bf6873c5SCy Schubert Update to rra-c-util 8.2: 72*bf6873c5SCy Schubert 73*bf6873c5SCy Schubert * Fix support for configuring the test suite with a krb5.conf file. 74*bf6873c5SCy Schubert * Drop support for Perl 5.6. 75*bf6873c5SCy Schubert * Reformat all C source using clang-format 10. 76*bf6873c5SCy Schubert * Remove bogus snprintf tests. 77*bf6873c5SCy Schubert * Fix misplaced va_end in the pam-util putil_log_failure function. 78*bf6873c5SCy Schubert * Skip checking for krb5-config on the path if a prefix was given. 79*bf6873c5SCy Schubert * Add SPDX-License-Identifier headers to all substantial source files. 80*bf6873c5SCy Schubert 81*bf6873c5SCy Schubert Update to C TAP Harness 4.6: 82*bf6873c5SCy Schubert 83*bf6873c5SCy Schubert * Fixed malloc error checking in bstrndup. 84*bf6873c5SCy Schubert * Fix (harmless) allocation error in runtests driver. 85*bf6873c5SCy Schubert * Add support for valgrind testing via test list options. 86*bf6873c5SCy Schubert * Report test failures as left and right, not wanted and seen. 87*bf6873c5SCy Schubert * Fix is_string comparisons involving NULL pointers and "(null)". 88*bf6873c5SCy Schubert * Add SPDX-License-Identifier headers to all substantial source files. 89*bf6873c5SCy Schubert 90*bf6873c5SCy Schubertpam-krb5 4.8 (2017-12-30) 91*bf6873c5SCy Schubert 92*bf6873c5SCy Schubert When verifying that an expired password can still be used to get 93*bf6873c5SCy Schubert kadmin/changepw credentials, correctly set the credential options for 94*bf6873c5SCy Schubert getting password change credentials, not for getting initial 95*bf6873c5SCy Schubert credentials. This should fix password change issues when, for 96*bf6873c5SCy Schubert example, krb5.conf requests that all tickets be proxiable but 97*bf6873c5SCy Schubert kadmin/changepw doesn't allow proxiable credentials. Thanks to 98*bf6873c5SCy Schubert Florian Best for the bug report. 99*bf6873c5SCy Schubert 100*bf6873c5SCy Schubert When built against recent versions of Heimdal with richer status codes 101*bf6873c5SCy Schubert from PKINIT attempts, report to the user the reason for a PKINIT 102*bf6873c5SCy Schubert failure. Based on work by Henry Jacques. 103*bf6873c5SCy Schubert 104*bf6873c5SCy Schubert Document the test suite configuration files required to run the PKINIT 105*bf6873c5SCy Schubert tests. 106*bf6873c5SCy Schubert 107*bf6873c5SCy Schubert Fix expired password tests to work with Heimdal 7.0.1 and later. 108*bf6873c5SCy Schubert 109*bf6873c5SCy Schubert Better document that the default Kerberos library ticket cache 110*bf6873c5SCy Schubert location is not used (and why), and how to set configuration 111*bf6873c5SCy Schubert parameters in krb5.conf. Thanks, Matthew Gabeler-Lee. (Debian 112*bf6873c5SCy Schubert Bug#872943) 113*bf6873c5SCy Schubert 114*bf6873c5SCy Schubert Compile cleanly under GCC 7 and Clang warnings and Clang's static 115*bf6873c5SCy Schubert analyzer. 116*bf6873c5SCy Schubert 117*bf6873c5SCy Schubert Rename the script to bootstrap from a Git checkout to bootstrap, 118*bf6873c5SCy Schubert matching the emerging consensus in the Autoconf world. 119*bf6873c5SCy Schubert 120*bf6873c5SCy Schubert Update to rra-c-util 7.0: 121*bf6873c5SCy Schubert 122*bf6873c5SCy Schubert * Fix new warnings in GCC 7. 123*bf6873c5SCy Schubert * Support a warning build under Clang. 124*bf6873c5SCy Schubert * Avoid zero-length allocations in reallocarray and vector. 125*bf6873c5SCy Schubert * Probe for warning flags instead of hard-coding a list. 126*bf6873c5SCy Schubert * New test for obsolete URLs and email addresses. 127*bf6873c5SCy Schubert * Remove unused portable replacements for strlcpy and strlcat. 128*bf6873c5SCy Schubert * Use C_TAP_SOURCE and C_TAP_BUILD environment variables in tests. 129*bf6873c5SCy Schubert * Fix portability defines for anonymous principal strings. 130*bf6873c5SCy Schubert * Clear errno on pam_modutil_getpwnam to improve other testing. 131*bf6873c5SCy Schubert * Add portability defines for macOS's PAM implementation. 132*bf6873c5SCy Schubert * Add new Autoconf macro to probe for pam_strerror const usage. 133*bf6873c5SCy Schubert * Support Solaris 10's included Kerberos. 134*bf6873c5SCy Schubert 135*bf6873c5SCy Schubert Update to C TAP Harness 4.2: 136*bf6873c5SCy Schubert 137*bf6873c5SCy Schubert * Avoid zero-length allocations in breallocarray. 138*bf6873c5SCy Schubert * Add is_blob and is_bool functions. 139*bf6873c5SCy Schubert * Use C_TAP_SOURCE and C_TAP_BUILD environment variables in tests. 140*bf6873c5SCy Schubert * Fix segfault in runtests with an empty test list. 141*bf6873c5SCy Schubert * Display verbose test results with -v or C_TAP_VERBOSE. 142*bf6873c5SCy Schubert * Test infrastructure builds cleanly with Clang warnings. 143*bf6873c5SCy Schubert 144*bf6873c5SCy Schubertpam-krb5 4.7 (2014-12-25) 145*bf6873c5SCy Schubert 146*bf6873c5SCy Schubert Add a no_update_user option that disables the normal update of the 147*bf6873c5SCy Schubert PAM_USER PAM variable after canonicalization of the username. When 148*bf6873c5SCy Schubert this is set, pam-krb5 will not convert full principal names to local 149*bf6873c5SCy Schubert usernames where possible for the rest of the PAM stack. 150*bf6873c5SCy Schubert 151*bf6873c5SCy Schubert Suppress spurious password prompt from Heimdal when authenticating 152*bf6873c5SCy Schubert with PKINIT. 153*bf6873c5SCy Schubert 154*bf6873c5SCy Schubert Map unknown realm errors from the Kerberos libraries to the PAM error 155*bf6873c5SCy Schubert code PAM_AUTHINFO_UNAVAIL instead of PAM_AUTH_ERR. 156*bf6873c5SCy Schubert 157*bf6873c5SCy Schubert Treat an KRB5_GET_IN_TKT_LOOP error as an incorrect password. Heimdal 158*bf6873c5SCy Schubert KDCs sometimes return it, and Heimdal kinit treats it this way. 159*bf6873c5SCy Schubert Similarly, treat a KRB5_BAD_ENCTYPE error as an incorrect password, 160*bf6873c5SCy Schubert since this error is returned by a Heimdal 1.6-rc2 KDC for incorrect 161*bf6873c5SCy Schubert preauth from a MIT Kerberos 1.12.1 client. 162*bf6873c5SCy Schubert 163*bf6873c5SCy Schubert Add the version number at which each module option was added with its 164*bf6873c5SCy Schubert current meaning to the documentatation. 165*bf6873c5SCy Schubert 166*bf6873c5SCy Schubert Update to rra-c-util 5.6: 167*bf6873c5SCy Schubert 168*bf6873c5SCy Schubert * Suppress warnings from Kerberos headers in non-system paths. 169*bf6873c5SCy Schubert * Fix probing for Heimdal's libroken to work with older versions. 170*bf6873c5SCy Schubert * Fix Kerberos header detection if root or include paths are given. 171*bf6873c5SCy Schubert * Pass --deps to krb5-config in the non-reduced-dependencies case. 172*bf6873c5SCy Schubert * Provide a reallocarray replacement for platforms without it. 173*bf6873c5SCy Schubert * Use reallocarray where appropriate. 174*bf6873c5SCy Schubert * Drop checks for NULL before freeing pointers. 175*bf6873c5SCy Schubert * Drop explicit pointer initialization to NULL and rely on calloc. 176*bf6873c5SCy Schubert * Check the return status of snprintf and vsnprintf properly. 177*bf6873c5SCy Schubert * Preserve errno if snprintf fails in vasprintf replacement. 178*bf6873c5SCy Schubert * Suppress a dummy symbol in the client library that could leak. 179*bf6873c5SCy Schubert * Fix syntax errors when building with a C++ compiler. 180*bf6873c5SCy Schubert * Avoid test suite failures where tested functions are macros. 181*bf6873c5SCy Schubert 182*bf6873c5SCy Schubert Update to C TAP Harness 3.2: 183*bf6873c5SCy Schubert 184*bf6873c5SCy Schubert * Reopen standard input to /dev/null when running a test list. 185*bf6873c5SCy Schubert * Don't leak extraneous file descriptors to tests. 186*bf6873c5SCy Schubert * Suppress lazy plans and test summaries if the test failed with bail. 187*bf6873c5SCy Schubert * bail and sysbail now exit with status 255 to match Test::More. 188*bf6873c5SCy Schubert * runtests now treats the command line as a list of tests by default. 189*bf6873c5SCy Schubert * The full test executable path can now be passed to runtests -o. 190*bf6873c5SCy Schubert * Improved harness output for tests with lazy plans. 191*bf6873c5SCy Schubert * Improved harness output to a terminal for some abort cases. 192*bf6873c5SCy Schubert * Flush harness output after each test even when not on a terminal. 193*bf6873c5SCy Schubert 194*bf6873c5SCy Schubertpam-krb5 4.6 (2012-06-02) 195*bf6873c5SCy Schubert 196*bf6873c5SCy Schubert Add an anon_fast option that attempts anonymous authentication 197*bf6873c5SCy Schubert (generally implemented via anonymous PKINIT inside the Kerberos 198*bf6873c5SCy Schubert library) and then, if successful, uses those credentials for FAST 199*bf6873c5SCy Schubert armor. If fast_ccache and anon_fast are both specified, anonymous 200*bf6873c5SCy Schubert authentication will be used as a fallback if the specified FAST ticket 201*bf6873c5SCy Schubert cache doesn't exist. Based on patches from Yair Yarom. 202*bf6873c5SCy Schubert 203*bf6873c5SCy Schubert Add a user_realm option to only set the realm for unqualified user 204*bf6873c5SCy Schubert principals. This differs from the existing realm option in that realm 205*bf6873c5SCy Schubert also changes the default realm for authorization decisions and for 206*bf6873c5SCy Schubert verification of credentials. Update the realm option documentation to 207*bf6873c5SCy Schubert clarify the differences and remove incorrect information. Patch from 208*bf6873c5SCy Schubert Roland C. Dowdeswell. 209*bf6873c5SCy Schubert 210*bf6873c5SCy Schubert Add a no_prompt option to suppress the PAM module's prompt for the 211*bf6873c5SCy Schubert user's password and defer all prompting to the Kerberos library. This 212*bf6873c5SCy Schubert allows the Kerberos library to have complete control of the prompting 213*bf6873c5SCy Schubert process, which may be desirable if authentication mechanisms other 214*bf6873c5SCy Schubert than password are in use. Be aware that, with this option set, the 215*bf6873c5SCy Schubert PAM module has no control over the contents of the prompt and cannot 216*bf6873c5SCy Schubert store the user's password in the PAM data. Based on a patch by Yair 217*bf6873c5SCy Schubert Yarom. 218*bf6873c5SCy Schubert 219*bf6873c5SCy Schubert Add a silent option to force the module to behave as if the 220*bf6873c5SCy Schubert application had passed in PAM_SILENT and suppress text messages and 221*bf6873c5SCy Schubert errors from the Kerberos library. Patch from Yair Yarom. 222*bf6873c5SCy Schubert 223*bf6873c5SCy Schubert Add preliminary support for Kerberos trace logging via a trace option 224*bf6873c5SCy Schubert that enables trace logging if supported by the underlying Kerberos 225*bf6873c5SCy Schubert library. The option takes as an argument the file name to which to 226*bf6873c5SCy Schubert log trace output. This option does not yet work with any released 227*bf6873c5SCy Schubert version of Kerberos, but may work with the next release of MIT 228*bf6873c5SCy Schubert Kerberos. 229*bf6873c5SCy Schubert 230*bf6873c5SCy Schubert MIT Kerberos does not add a colon and space to its password prompts, 231*bf6873c5SCy Schubert but Heimdal does. pam-krb5 previously unconditionally added a colon 232*bf6873c5SCy Schubert and space, resulting in doubled colons with Heimdal. Work around this 233*bf6873c5SCy Schubert inconsistency by not adding the colon and space if already present. 234*bf6873c5SCy Schubert 235*bf6873c5SCy Schubert Fix alt_auth_map support to preserve the realm of the authentication 236*bf6873c5SCy Schubert identity when forming the alternate authentication principal, matching 237*bf6873c5SCy Schubert the documentation. 238*bf6873c5SCy Schubert 239*bf6873c5SCy Schubert Document that the alt_auth_map format may contain a realm to force all 240*bf6873c5SCy Schubert mapped principals to be in that realm. In that case, don't add the 241*bf6873c5SCy Schubert realm of the authentication identity. Note that this can be used as a 242*bf6873c5SCy Schubert simple way to attempt authentication in an alternate realm first and 243*bf6873c5SCy Schubert then fall back to the local realm, although any complex attempt at 244*bf6873c5SCy Schubert authentication in multiple realms should instead run the module 245*bf6873c5SCy Schubert multiple times with different realm settings. 246*bf6873c5SCy Schubert 247*bf6873c5SCy Schubert Avoid a NULL pointer dereference if krb5_init_context fails. 248*bf6873c5SCy Schubert 249*bf6873c5SCy Schubert Fix initialization of time values in the module configuration on 250*bf6873c5SCy Schubert platforms (like S/390X) where krb5_deltat is not equivalent to long. 251*bf6873c5SCy Schubert 252*bf6873c5SCy Schubert Close a memory leak when search_k5login is set but the user has no 253*bf6873c5SCy Schubert .k5login file. 254*bf6873c5SCy Schubert 255*bf6873c5SCy Schubert Close several memory leaks in alt_auth_map support. 256*bf6873c5SCy Schubert 257*bf6873c5SCy Schubert Suppress bogus error messages about unknown option for the realm 258*bf6873c5SCy Schubert option. The option was being parsed and honored despite the error. 259*bf6873c5SCy Schubert 260*bf6873c5SCy Schubert Retry authentication under try_first_pass on several other errors in 261*bf6873c5SCy Schubert addition to decrypt integrity check errors to handle a wider array of 262*bf6873c5SCy Schubert possible "password incorrect" error messages from the KDC. 263*bf6873c5SCy Schubert 264*bf6873c5SCy Schubert Update to rra-c-util 4.4: 265*bf6873c5SCy Schubert 266*bf6873c5SCy Schubert * Replacement strndup now works with non-nul-terminated strings. 267*bf6873c5SCy Schubert * New Kerberos test setup that simplifies writing tests. 268*bf6873c5SCy Schubert * Add -D_FORTIFY_SOURCE=2 to the make warnings flags. 269*bf6873c5SCy Schubert * Use --deps flag to krb5-config by default. 270*bf6873c5SCy Schubert * Suppress __alloc_size__ attribute with older versions of gcc. 271*bf6873c5SCy Schubert * Suppress attribute warnings for non-gcc compilers. 272*bf6873c5SCy Schubert 273*bf6873c5SCy Schubert Update to C TAP Harness 1.12: 274*bf6873c5SCy Schubert 275*bf6873c5SCy Schubert * Add bstrndup to the basic C TAP library. 276*bf6873c5SCy Schubert * Only use feature-test macros when requested or built with gcc -ansi. 277*bf6873c5SCy Schubert * New tests/tap/macros.h header with some common definitions. 278*bf6873c5SCy Schubert * Drop is_double from the C TAP library to avoid requiring -lm. 279*bf6873c5SCy Schubert * Avoid using local in the shell libtap.sh library. 280*bf6873c5SCy Schubert 281*bf6873c5SCy Schubertpam-krb5 4.5 (2011-12-24) 282*bf6873c5SCy Schubert 283*bf6873c5SCy Schubert Suppress the notice that the password is being changed because it's 284*bf6873c5SCy Schubert expired if force_first_pass or use_first_pass is set in the password 285*bf6873c5SCy Schubert stack, indicating that it's stacked with another module that's also 286*bf6873c5SCy Schubert doing password changes. This is arguable, but without this change the 287*bf6873c5SCy Schubert notification message of why the password is being changed shows up 288*bf6873c5SCy Schubert confusingly in the middle of the password change interaction. Based 289*bf6873c5SCy Schubert on a patch by William Yang. 290*bf6873c5SCy Schubert 291*bf6873c5SCy Schubert Some old versions of Heimdal (0.7.2 in OpenBSD 4.9, specifically) 292*bf6873c5SCy Schubert reportedly return KRB5KDC_ERR_KEY_EXP for accounts with expired 293*bf6873c5SCy Schubert keys even if the supplied password is wrong. Work around this by 294*bf6873c5SCy Schubert confirming that the PAM module can obtain tickets for kadmin/changepw 295*bf6873c5SCy Schubert before returning a password expiration error instead of an invalid 296*bf6873c5SCy Schubert password error. Based on a patch by William Yang. 297*bf6873c5SCy Schubert 298*bf6873c5SCy Schubert The location of the temporary root-owned ticket cache created during 299*bf6873c5SCy Schubert the authentication process is now also controlled by the ccache_dir 300*bf6873c5SCy Schubert option (but not the ccache option) rather than forced to be in /tmp. 301*bf6873c5SCy Schubert This will allow system administrators to configure an alternative 302*bf6873c5SCy Schubert cache directory so that pam-krb5 can continue working when /tmp is 303*bf6873c5SCy Schubert full. 304*bf6873c5SCy Schubert 305*bf6873c5SCy Schubert Report more specific errors in syslog if authorization checks (such as 306*bf6873c5SCy Schubert .k5login checks) fail. 307*bf6873c5SCy Schubert 308*bf6873c5SCy Schubert Pass a NULL principal to krb5_set_password with MIT client libraries 309*bf6873c5SCy Schubert to prefer the older change password protocol for compatibility with 310*bf6873c5SCy Schubert older KDCs. This is not necessary on Heimdal since Heimdal's 311*bf6873c5SCy Schubert krb5_set_password tries both protocols. 312*bf6873c5SCy Schubert 313*bf6873c5SCy Schubert Improve logging and authorization checks when defer_pwchange is set 314*bf6873c5SCy Schubert and a user authenticates with an expired password. 315*bf6873c5SCy Schubert 316*bf6873c5SCy Schubert When probing for Kerberos libraries, always add any supplemental 317*bf6873c5SCy Schubert libraries found to that point to the link command. This will fix 318*bf6873c5SCy Schubert configure failures on platforms without working transitive shared 319*bf6873c5SCy Schubert library dependencies. 320*bf6873c5SCy Schubert 321*bf6873c5SCy Schubert Close some memory leaks where unparsed Kerberos principal names were 322*bf6873c5SCy Schubert never freed. 323*bf6873c5SCy Schubert 324*bf6873c5SCy Schubert Restructure the code to work with OpenPAM's default PAM build 325*bf6873c5SCy Schubert machinery, which exports a struct containing module entry points 326*bf6873c5SCy Schubert rather than public pam_sm_* functions. Thanks to Fredrik Pettai for 327*bf6873c5SCy Schubert the information. 328*bf6873c5SCy Schubert 329*bf6873c5SCy Schubert In debug logging, report symbolic names for PAM flags on PAM function 330*bf6873c5SCy Schubert entry rather than the numeric PAM flags. This helps with automated 331*bf6873c5SCy Schubert testing and with debugging PAM problems on different operating 332*bf6873c5SCy Schubert systems. 333*bf6873c5SCy Schubert 334*bf6873c5SCy Schubert Include <krb5/krb5.h> if <krb5.h> is missing, which permits finding 335*bf6873c5SCy Schubert the header file on NetBSD systems. Thanks to Fredrik Pettai for the 336*bf6873c5SCy Schubert report. 337*bf6873c5SCy Schubert 338*bf6873c5SCy Schubert Replace the Kerberos compatibility layer with equivalent but 339*bf6873c5SCy Schubert better-structured code from rra-c-util 4.0. 340*bf6873c5SCy Schubert 341*bf6873c5SCy Schubert Avoid krb5-config and use manual library probing if --with-krb5-lib or 342*bf6873c5SCy Schubert --with-krb5-include were given to configure. This avoids having to 343*bf6873c5SCy Schubert point configure at a nonexistent krb5-config to override its results. 344*bf6873c5SCy Schubert 345*bf6873c5SCy Schubert Use PATH_KRB5_CONFIG instead of KRB5_CONFIG to locate krb5-config in 346*bf6873c5SCy Schubert configure, to avoid a conflict with the variable used by the Kerberos 347*bf6873c5SCy Schubert libraries to find krb5.conf. 348*bf6873c5SCy Schubert 349*bf6873c5SCy Schubert Change references to Kerberos v5 to just Kerberos in the 350*bf6873c5SCy Schubert documentation. Kerberos v5 has been the default version of Kerberos 351*bf6873c5SCy Schubert for over ten years now. 352*bf6873c5SCy Schubert 353*bf6873c5SCy Schubert Update to rra-c-util 4.0: 354*bf6873c5SCy Schubert 355*bf6873c5SCy Schubert * Add notices to all files copied over from rra-c-util. 356*bf6873c5SCy Schubert * Include strings.h for additional POSIX functions where found. 357*bf6873c5SCy Schubert * Fix detection of whether PAM uses const on FreeBSD. 358*bf6873c5SCy Schubert * Update warning flags for make warnings for GCC 4.6.1. 359*bf6873c5SCy Schubert * Limit symbol exports even on systems without GNU ld. 360*bf6873c5SCy Schubert * Fix replacement mkstemp to use long long where available. 361*bf6873c5SCy Schubert * Improve stripping of /usr/include from krb5-config results. 362*bf6873c5SCy Schubert * Use issetugid where available, not the misnamed issetuidgid. 363*bf6873c5SCy Schubert 364*bf6873c5SCy Schubert Update to C TAP Harness 1.9: 365*bf6873c5SCy Schubert 366*bf6873c5SCy Schubert * Add bmalloc, bcalloc, brealloc, and bstrdup TAP library functions. 367*bf6873c5SCy Schubert * Fix runtests to honor -s even if BUILD and -b aren't given. 368*bf6873c5SCy Schubert * Add test_tmpdir and test_tmpdir_free to TAP library. 369*bf6873c5SCy Schubert * runtests now frees all allocated resources on exit. 370*bf6873c5SCy Schubert 371*bf6873c5SCy Schubertpam-krb5 4.4 (2010-12-31) 372*bf6873c5SCy Schubert 373*bf6873c5SCy Schubert Do not prompt for a password when try_pkinit is set and the module is 374*bf6873c5SCy Schubert built against MIT Kerberos. This fixes a spurious password prompt 375*bf6873c5SCy Schubert introduced in 4.1, but partly reintroduces the bug fixed in 4.1 where 376*bf6873c5SCy Schubert the user's password is not saved in the PAM data if the authentication 377*bf6873c5SCy Schubert falls back to password when PKINIT fails. This requires more work 378*bf6873c5SCy Schubert to fix and will be addressed in a subsequent release. Thanks to 379*bf6873c5SCy Schubert Бранко Мајић (Branko Majic) for the report. 380*bf6873c5SCy Schubert 381*bf6873c5SCy Schubert Reorganize the configuration section of the pam_krb5 man page to 382*bf6873c5SCy Schubert divide the many PAM module options into sections. 383*bf6873c5SCy Schubert 384*bf6873c5SCy Schubert When probing for <ibm_svc/krb5_svc.h> (part of AIX's bundled Kerberos 385*bf6873c5SCy Schubert implementation), include <krb5.h> before attempting to include that 386*bf6873c5SCy Schubert header to quiet confusing Autoconf warnings. Reported by Wilfried 387*bf6873c5SCy Schubert Weiss. 388*bf6873c5SCy Schubert 389*bf6873c5SCy Schubert Update to rra-c-util 3.0: 390*bf6873c5SCy Schubert 391*bf6873c5SCy Schubert * Fix compilation of the replacement snprintf for old systems. 392*bf6873c5SCy Schubert * Look for krb5-config in /usr/kerberos/bin for Red Hat systems. 393*bf6873c5SCy Schubert * Fix compilation with OpenBSD's Heimdal without separate libroken. 394*bf6873c5SCy Schubert 395*bf6873c5SCy Schubertpam-krb5 4.3 (2010-06-09) 396*bf6873c5SCy Schubert 397*bf6873c5SCy Schubert Add a fast_ccache option that, if set, points to a Kerberos ticket 398*bf6873c5SCy Schubert cache used for Flexible Authentication Secure Tunneling (FAST) to 399*bf6873c5SCy Schubert protect the authentication. FAST is a mechanism to protect Kerberos 400*bf6873c5SCy Schubert against password guessing attacks and provide other security 401*bf6873c5SCy Schubert improvements. This option is only available when built against 402*bf6873c5SCy Schubert Kerberos libraries with FAST support (currently only MIT Kerberos 1.7 403*bf6873c5SCy Schubert or later). Patch from Sam Hartman. 404*bf6873c5SCy Schubert 405*bf6873c5SCy Schubert Fix error in freeing a previous alt_auth_map setting when parsing 406*bf6873c5SCy Schubert configuration options. Patch from Sam Hartman. 407*bf6873c5SCy Schubert 408*bf6873c5SCy Schubert Fix the linker flags for Solaris with the native compiler. Thanks, 409*bf6873c5SCy Schubert Kevin Sumner. 410*bf6873c5SCy Schubert 411*bf6873c5SCy Schubertpam-krb5 4.2 (2009-11-25) 412*bf6873c5SCy Schubert 413*bf6873c5SCy Schubert Add a new fail_pwchange option, which suppresses password changes for 414*bf6873c5SCy Schubert expired passwords and treats expired passwords the same as incorrect 415*bf6873c5SCy Schubert passwords. 416*bf6873c5SCy Schubert 417*bf6873c5SCy Schubert Include all the new header files from the portability code so that 418*bf6873c5SCy Schubert it will actually compile on non-Linux platforms. 419*bf6873c5SCy Schubert 420*bf6873c5SCy Schubertpam-krb5 4.1 (2009-11-20) 421*bf6873c5SCy Schubert 422*bf6873c5SCy Schubert Return PAM_SUCCESS, not PAM_USER_UNKNOWN, for ignored users in 423*bf6873c5SCy Schubert pam_setcred. It's safe to return success when doing nothing in 424*bf6873c5SCy Schubert pam_setcred because the stack has already been frozen after the 425*bf6873c5SCy Schubert authentication step, and returning an error causes the stack to fail 426*bf6873c5SCy Schubert on some other Linux PAM implementations. Thanks, Ian Ward Comfort. 427*bf6873c5SCy Schubert 428*bf6873c5SCy Schubert In the second pass through the password group, prompt for the new 429*bf6873c5SCy Schubert password and store it in the PAM data even if the user is being 430*bf6873c5SCy Schubert ignored. This is required to allow this module to be stacked with 431*bf6873c5SCy Schubert another module that uses use_authtok. Without this behavior, the 432*bf6873c5SCy Schubert second module won't be able to work for any ignored user since it will 433*bf6873c5SCy Schubert see no saved password and use_authtok will reject the password change. 434*bf6873c5SCy Schubert 435*bf6873c5SCy Schubert Fix return status from pam_sm_acct_mgmt if we were unable to retrieve 436*bf6873c5SCy Schubert PAM_USER. 437*bf6873c5SCy Schubert 438*bf6873c5SCy Schubert Log successful authentications to syslog with priority LOG_INFO, 439*bf6873c5SCy Schubert including the Kerberos principal used for authentication. 440*bf6873c5SCy Schubert 441*bf6873c5SCy Schubert Log failed authentication to syslog with priority LOG_NOTICE, 442*bf6873c5SCy Schubert including roughly the same additional information that the Linux PAM 443*bf6873c5SCy Schubert pam_unix logs by default. 444*bf6873c5SCy Schubert 445*bf6873c5SCy Schubert Use pam_syslog for logging where available. This means pam-krb5 log 446*bf6873c5SCy Schubert messages will look like all other log messages for Linux PAM modules 447*bf6873c5SCy Schubert on Linux. Change the format of log messages on all platforms to 448*bf6873c5SCy Schubert hopefully be somewhat clearer. 449*bf6873c5SCy Schubert 450*bf6873c5SCy Schubert Rationalize logging. The module should now follow the recommendations 451*bf6873c5SCy Schubert of the Linux PAM Module Writers' Guide for log levels. More errors 452*bf6873c5SCy Schubert are logged at LOG_ERR instead of LOG_DEBUG, and system resource errors 453*bf6873c5SCy Schubert are now logged at LOG_CRIT instead of LOG_ERR. 454*bf6873c5SCy Schubert 455*bf6873c5SCy Schubert Add additional error and debug logging in places where significant 456*bf6873c5SCy Schubert actions or failures may happen without previously being logged. Also 457*bf6873c5SCy Schubert add failure information from PAM or Kerberos libraries to messages 458*bf6873c5SCy Schubert where appropriate. 459*bf6873c5SCy Schubert 460*bf6873c5SCy Schubert Add replacement snprintf, vsnprintf, and mkstemp functions for 461*bf6873c5SCy Schubert pointless portability to ancient systems. 462*bf6873c5SCy Schubert 463*bf6873c5SCy Schubertpam-krb5 4.0 (2009-11-13) 464*bf6873c5SCy Schubert 465*bf6873c5SCy Schubert UPGRADE WARNING: If you were using pam_krb5 with the use_authtok 466*bf6873c5SCy Schubert parameter in the password group, you will need to add use_first_pass 467*bf6873c5SCy Schubert to your configuration to keep the same behavior. See below for 468*bf6873c5SCy Schubert details. 469*bf6873c5SCy Schubert 470*bf6873c5SCy Schubert UPGRADE WARNING: If you used the use_authtok parameter in the 471*bf6873c5SCy Schubert authentication group, you should change it to force_first_pass. 472*bf6873c5SCy Schubert 473*bf6873c5SCy Schubert Previous versions of this module incorrectly implemented the standard 474*bf6873c5SCy Schubert use_authtok parameter. use_authtok applies only to the password group 475*bf6873c5SCy Schubert and says to use the new password stored in the PAM data rather than 476*bf6873c5SCy Schubert prompting for a new password. It doesn't imply anything about where 477*bf6873c5SCy Schubert to obtain the old password, but it was implemented as requiring both 478*bf6873c5SCy Schubert the old and new password be in the PAM stack already. This doesn't 479*bf6873c5SCy Schubert work when stacked with pam_cracklib. Change use_authtok to have the 480*bf6873c5SCy Schubert correct meaning, which means that password group configurations may 481*bf6873c5SCy Schubert need to add use_first_pass to use_authtok to get the desired behavior. 482*bf6873c5SCy Schubert 483*bf6873c5SCy Schubert use_first_pass and try_first_pass no longer affect how the new 484*bf6873c5SCy Schubert password is obtained during password changes. To use a password 485*bf6873c5SCy Schubert obtained by a previous module, use use_authtok instead. 486*bf6873c5SCy Schubert 487*bf6873c5SCy Schubert A new option, force_first_pass, is now supported for both the 488*bf6873c5SCy Schubert authentication and password groups. It tells the module to always get 489*bf6873c5SCy Schubert the user's current password from the PAM data and fail without 490*bf6873c5SCy Schubert prompting if it isn't already set. This is the meaning that 491*bf6873c5SCy Schubert use_authtok previously had for the current password. 492*bf6873c5SCy Schubert 493*bf6873c5SCy Schubert use_authtok no longer has any meaning for the authentication stack. 494*bf6873c5SCy Schubert Use force_first_pass instead, which does the same as use_authtok used 495*bf6873c5SCy Schubert to do. use_authtok will be temporarily converted to force_first_pass 496*bf6873c5SCy Schubert in the authentication group and log a diagnostic, but this will be 497*bf6873c5SCy Schubert removed in the future. 498*bf6873c5SCy Schubert 499*bf6873c5SCy Schubert Stop returning PAM_IGNORE from pam_setcred if the user is ignored or 500*bf6873c5SCy Schubert didn't log in via Kerberos and instead return PAM_USER_UNKNOWN. This 501*bf6873c5SCy Schubert fixes problems with the Linux PAM library where returning PAM_IGNORE 502*bf6873c5SCy Schubert would cause pam_setcred to fail even if other modules succeeded. 503*bf6873c5SCy Schubert Since pam_authenticate never returned PAM_IGNORE, this change should 504*bf6873c5SCy Schubert not cause any differences in behavior. 505*bf6873c5SCy Schubert 506*bf6873c5SCy Schubert Do not use issetugid on Solaris to determine when to avoid refreshing 507*bf6873c5SCy Schubert the ticket cache named in KRB5CCNAME during pam_setcred. Instead, 508*bf6873c5SCy Schubert compare effective and real UID and GID and permit KRB5CCNAME to be 509*bf6873c5SCy Schubert trusted if they match. This allows setuid screensavers on Solaris to 510*bf6873c5SCy Schubert refresh ticket caches and makes behavior on Solaris match other 511*bf6873c5SCy Schubert platforms. Using issetugid is arguably safer since it protects 512*bf6873c5SCy Schubert programs that switch users via setuid to a user other than the calling 513*bf6873c5SCy Schubert user but still should not trust the original environment, but such 514*bf6873c5SCy Schubert programs are rare in the PAM context and should not be calling 515*bf6873c5SCy Schubert pam_setcred anyway unless the calling user is permitted to generally 516*bf6873c5SCy Schubert act as the target user. Thanks, William Yang. 517*bf6873c5SCy Schubert 518*bf6873c5SCy Schubert Do the same logging in pam_sm_open_session and pam_sm_close_session as 519*bf6873c5SCy Schubert we do with the other functions. This will mean pam_sm_open_session 520*bf6873c5SCy Schubert calls will be logged as pam_sm_open_session, not as pam_sm_setcred as 521*bf6873c5SCy Schubert before. 522*bf6873c5SCy Schubert 523*bf6873c5SCy Schubert pam-krb5 is now built using Automake and Libtool to bring it more in 524*bf6873c5SCy Schubert line with other software packages. This means that it now relies on 525*bf6873c5SCy Schubert Libtool to know how to generate a loadable module rather than 526*bf6873c5SCy Schubert hand-configured linker rules. This may improve portability on some 527*bf6873c5SCy Schubert platforms and may hurt it on other platforms. 528*bf6873c5SCy Schubert 529*bf6873c5SCy Schubert If configured with a prefix of /usr on Linux, use /lib, /lib32, or 530*bf6873c5SCy Schubert /lib64 as an installation path based on the size of an integer in the 531*bf6873c5SCy Schubert compilation environment rather than based on known 64-bit Linux 532*bf6873c5SCy Schubert variants. 533*bf6873c5SCy Schubert 534*bf6873c5SCy Schubert Update to rra-c-util 2.0: 535*bf6873c5SCy Schubert 536*bf6873c5SCy Schubert * Sanity-check the results of krb5-config before proceeding. 537*bf6873c5SCy Schubert * Fall back on manual probing if krb5-config results don't work. 538*bf6873c5SCy Schubert * Don't break if the user clobbers CPPFLAGS at build time. 539*bf6873c5SCy Schubert 540*bf6873c5SCy Schubertpam-krb5 3.15 (2009-07-21) 541*bf6873c5SCy Schubert 542*bf6873c5SCy Schubert Fix a segfault (null pointer dereference) if pam-krb5 is configured 543*bf6873c5SCy Schubert with use_first_pass or use_authtok and there is no password stored in 544*bf6873c5SCy Schubert the PAM stack. Thanks to Jonathan Guthrie for the bug report. 545*bf6873c5SCy Schubert 546*bf6873c5SCy Schubertpam-krb5 3.14 (2009-07-18) 547*bf6873c5SCy Schubert 548*bf6873c5SCy Schubert Return PAM_IGNORE instead of PAM_PERM_DENIED from pam_chauthtok for 549*bf6873c5SCy Schubert ignored users. This allows making the Kerberos PAM module mandatory 550*bf6873c5SCy Schubert for password changes and still falling back to other PAM modules for 551*bf6873c5SCy Schubert ignored users. Thanks, Steve Langasek. 552*bf6873c5SCy Schubert 553*bf6873c5SCy Schubert Always treat the empty password as an authentication failure rather 554*bf6873c5SCy Schubert than passing it to the Kerberos libraries. The Kerberos libraries 555*bf6873c5SCy Schubert may treat it as equivalent to no password and prompt for a password 556*bf6873c5SCy Schubert without our knowledge, leading to the user authenticating with a 557*bf6873c5SCy Schubert different password than the one stored in the PAM stack. This could 558*bf6873c5SCy Schubert cause unexpected problems with some PAM configurations. It's safer 559*bf6873c5SCy Schubert to make the assumption that the empty password is always invalid and 560*bf6873c5SCy Schubert reject it outside of the Kerberos libraries. Thanks, Sanjay Sha. 561*bf6873c5SCy Schubert 562*bf6873c5SCy Schubert Fix error handling if ticket cache initialization fails. 563*bf6873c5SCy Schubert Authentication will still fail, but this avoids a segfault from a 564*bf6873c5SCy Schubert double-free of the ticket cache structure. The most common cause of 565*bf6873c5SCy Schubert this problem was having the attempt to initialize the ticket cache 566*bf6873c5SCy Schubert be blocked by AppArmor. Thanks to Alex Mauer for the report. 567*bf6873c5SCy Schubert 568*bf6873c5SCy Schubert Call krb5_free_error_string correctly, fixing a portability issue 569*bf6873c5SCy Schubert when building against Heimdal. Thanks, Andrew Drake. 570*bf6873c5SCy Schubert 571*bf6873c5SCy Schubert Work around a deficiency in pam_putenv on FreeBSD 7.2 that doesn't 572*bf6873c5SCy Schubert allow deleting environment variables, only setting them to empty 573*bf6873c5SCy Schubert values. Thanks, Andrew Elble. 574*bf6873c5SCy Schubert 575*bf6873c5SCy Schubertpam-krb5 3.13 (2009-02-11) 576*bf6873c5SCy Schubert 577*bf6873c5SCy Schubert SECURITY: When built against MIT Kerberos, if pam_krb5 is called in a 578*bf6873c5SCy Schubert setuid context (effective UID or GID doesn't match the real UID or 579*bf6873c5SCy Schubert GID), use krb5_init_secure_context instead of krb5_init_context. This 580*bf6873c5SCy Schubert ignores environment variable settings for the local Kerberos 581*bf6873c5SCy Schubert configuration and keytab. Previous versions could allow a local 582*bf6873c5SCy Schubert attacker to point a setuid program that used PAM authentication at a 583*bf6873c5SCy Schubert different Kerberos configuration under the attacker's control, 584*bf6873c5SCy Schubert possibly resulting in privilege escalation. Heimdal handles this 585*bf6873c5SCy Schubert logic within the Kerberos libraries and therefore was not affected. 586*bf6873c5SCy Schubert (CVE-2009-0360) 587*bf6873c5SCy Schubert 588*bf6873c5SCy Schubert SECURITY: Disable pam_setcred(PAM_REINITIALIZE_CREDS) for setuid 589*bf6873c5SCy Schubert applications. If pam_krb5 detects this call in a setuid context, it 590*bf6873c5SCy Schubert now logs an error and returns success without doing anything. Solaris 591*bf6873c5SCy Schubert su calls pam_setcred with that option rather than PAM_ESTABLISH_CREDS 592*bf6873c5SCy Schubert after authentication and without wiping the environment, leading 593*bf6873c5SCy Schubert previous versions of pam_krb5 to trust the KRB5CCNAME environment 594*bf6873c5SCy Schubert variable for the ticket cache location. This permitted an attacker to 595*bf6873c5SCy Schubert use previous versions of pam_krb5 to overwrite arbitrary files with 596*bf6873c5SCy Schubert Kerberos credential caches that were left owned by the attacker. 597*bf6873c5SCy Schubert Setuid screen lock programs may also be affected. Discovered by Derek 598*bf6873c5SCy Schubert Chan and reported by Steven Luo. Thanks to Sam Hartman and Jeffrey 599*bf6873c5SCy Schubert Hutzelman for additional analysis. (CVE-2009-0361) 600*bf6873c5SCy Schubert 601*bf6873c5SCy Schubert If a prefix of /usr is requested at configure time, install the PAM 602*bf6873c5SCy Schubert module into /lib/security or /lib64/security on Linux, matching the 603*bf6873c5SCy Schubert standard Linux-PAM module location. Use lib64 instead of lib on 604*bf6873c5SCy Schubert 64-bit SPARC, PowerPC, and S390 Linux as well as x86_64. Patch from 605*bf6873c5SCy Schubert Peter Breitenlohner. 606*bf6873c5SCy Schubert 607*bf6873c5SCy Schubert Fix a build problem when builddir != srcdir introduced in 3.11. Patch 608*bf6873c5SCy Schubert from Peter Breitenlohner. 609*bf6873c5SCy Schubert 610*bf6873c5SCy Schubert Add support for the old Heimdal krb5_get_error_string interface. 611*bf6873c5SCy Schubert Thanks, Chaskiel Grundman. 612*bf6873c5SCy Schubert 613*bf6873c5SCy Schubert Add --with-krb5-include and --with-krb5-lib configure options to allow 614*bf6873c5SCy Schubert more specific setting of paths if necessary. 615*bf6873c5SCy Schubert 616*bf6873c5SCy Schubert If krb5-config isn't available, attempt to determine if the library 617*bf6873c5SCy Schubert directory for the Kerberos libraries is lib32 or lib64 instead of lib 618*bf6873c5SCy Schubert and set LDFLAGS accordingly. Based on an idea from the CMU Autoconf 619*bf6873c5SCy Schubert macros. 620*bf6873c5SCy Schubert 621*bf6873c5SCy Schubertpam-krb5 3.12 (2008-11-13) 622*bf6873c5SCy Schubert 623*bf6873c5SCy Schubert Add alt_auth_map configuration option, which allows mapping of 624*bf6873c5SCy Schubert usernames to alternative Kerberos principals, useful primarily for 625*bf6873c5SCy Schubert using particular instances for access to a given PAM-authenticated 626*bf6873c5SCy Schubert service. Also added force_alt_auth and only_alt_auth options to 627*bf6873c5SCy Schubert control when alternative Kerberos principals are used. Patch from 628*bf6873c5SCy Schubert Booker Bense. 629*bf6873c5SCy Schubert 630*bf6873c5SCy Schubert Fix incorrect error handling for bad .k5login ownership when 631*bf6873c5SCy Schubert search_k5login is set, leading to a NULL pointer dereference and a 632*bf6873c5SCy Schubert segfault. Thanks, Andrew Deason. 633*bf6873c5SCy Schubert 634*bf6873c5SCy Schubert Fix double-free of the ticket cache structure if creation of the 635*bf6873c5SCy Schubert ticket cache in the session module fails. Thanks, Jens Jorgensen. 636*bf6873c5SCy Schubert 637*bf6873c5SCy Schubert Log all syslog messages to LOG_AUTHPRIV, or LOG_AUTH if the system 638*bf6873c5SCy Schubert doesn't define LOG_AUTHPRIV. Thanks, Mark Painter. 639*bf6873c5SCy Schubert 640*bf6873c5SCy Schubert Fix portability to AIX's bundled Kerberos. Thanks, Markus Moeller. 641*bf6873c5SCy Schubert 642*bf6873c5SCy Schubert When debugging is enabled, log an exit status of PAM_IGNORE as ignore 643*bf6873c5SCy Schubert rather than failure. 644*bf6873c5SCy Schubert 645*bf6873c5SCy Schubert Document that pam-krb5 must be listed in the session group as well as 646*bf6873c5SCy Schubert the auth group for interactive logins or OpenSSH won't set up the 647*bf6873c5SCy Schubert user's credential cache properly. 648*bf6873c5SCy Schubert 649*bf6873c5SCy Schubert Document adding ignore=ignore to complex [] action configuration for 650*bf6873c5SCy Schubert the session and account groups since the module now returns PAM_IGNORE 651*bf6873c5SCy Schubert instead of PAM_SUCCESS for accounts that didn't use Kerberos. 652*bf6873c5SCy Schubert 653*bf6873c5SCy Schubertpam-krb5 3.11 (2008-07-10) 654*bf6873c5SCy Schubert 655*bf6873c5SCy Schubert pam_setcred, pam_open_session, and pam_acct_mgmt now return PAM_IGNORE 656*bf6873c5SCy Schubert for ignored users or non-Kerberos logins rather than PAM_SUCCESS. 657*bf6873c5SCy Schubert This return code tells the PAM library to continue as if the module 658*bf6873c5SCy Schubert were not present in the configuration and allows sufficient to be 659*bf6873c5SCy Schubert meaningful for pam-krb5 in account and session groups. 660*bf6873c5SCy Schubert pam_authenticate continues to return failure for ignored users; 661*bf6873c5SCy Schubert PAM_IGNORE would arguably be more correct, but increases the risk of 662*bf6873c5SCy Schubert security holes through incorrect configuration. 663*bf6873c5SCy Schubert 664*bf6873c5SCy Schubert Support correct password expiration handling according to the PAM 665*bf6873c5SCy Schubert standard (returning success from pam_authenticate and an error from 666*bf6873c5SCy Schubert pam_acct_mgmt and completing the authentication after pam_chauthotk). 667*bf6873c5SCy Schubert This is not the default since it opens security holes with broken 668*bf6873c5SCy Schubert applications that don't call pam_acct_mgmt or ignore its exit status. 669*bf6873c5SCy Schubert To enable it, set the PAM option defer_pwchange for applications known 670*bf6873c5SCy Schubert to make the correct PAM calls and check return codes. 671*bf6873c5SCy Schubert 672*bf6873c5SCy Schubert Add a new option to attempt change of expired passwords during 673*bf6873c5SCy Schubert pam_authenticate if Kerberos authentication returns a password expired 674*bf6873c5SCy Schubert error. Normally, the Kerberos library will do this for you, but some 675*bf6873c5SCy Schubert Kerberos libraries (notably Solaris) disable that code. This option 676*bf6873c5SCy Schubert allows simulation of the normal Kerberos library behavior on those 677*bf6873c5SCy Schubert platforms. 678*bf6873c5SCy Schubert 679*bf6873c5SCy Schubert Work around an apparent Heimdal bug when krb5_free_cred_contents is 680*bf6873c5SCy Schubert called on an all-zero credential structure. It's not clear what's 681*bf6873c5SCy Schubert going on here and the Heimdal code looks correct, but avoiding the 682*bf6873c5SCy Schubert call fixes the problem. 683*bf6873c5SCy Schubert 684*bf6873c5SCy Schubert Warn if more than one of use_authtok, use_first_pass, and 685*bf6873c5SCy Schubert try_first_pass is set and use the strongest of the one set. 686*bf6873c5SCy Schubert 687*bf6873c5SCy Schubert Remove the workaround for versions of MIT Kerberos that didn't 688*bf6873c5SCy Schubert initialize a krb5_get_init_creds_opt structure on opt_alloc. This bug 689*bf6873c5SCy Schubert was only present in early versions of 1.6; the correct fix is to 690*bf6873c5SCy Schubert upgrade. 691*bf6873c5SCy Schubert 692*bf6873c5SCy Schubert Add an additional header check for AIX's bundled Kerberos. 693*bf6873c5SCy Schubert 694*bf6873c5SCy Schubert If KRB5_CONFIG was explicitly set in the environment, don't use a 695*bf6873c5SCy Schubert different krb5-config based on --with-krb5. If krb5-config isn't 696*bf6873c5SCy Schubert executable, don't use it. This allows one to force library probing by 697*bf6873c5SCy Schubert setting KRB5_CONFIG to point to a nonexistent file. 698*bf6873c5SCy Schubert 699*bf6873c5SCy Schubert Sanity-check the results of krb5-config before proceeding and error 700*bf6873c5SCy Schubert out in configure if they don't work. 701*bf6873c5SCy Schubert 702*bf6873c5SCy Schubert For Kerberos libraries without krb5-config, also check for networking 703*bf6873c5SCy Schubert libraries (-lsocket and friends) before checking for Kerberos 704*bf6873c5SCy Schubert libraries in case shared library dependencies are broken. 705*bf6873c5SCy Schubert 706*bf6873c5SCy Schubert Fix Autoconf syntax error when probing for libkrb5support. Thanks, 707*bf6873c5SCy Schubert Mike Garrison. 708*bf6873c5SCy Schubert 709*bf6873c5SCy Schubert Set an explicit visibility of hidden for all internal functions at 710*bf6873c5SCy Schubert compile time if gcc is used to permit better optimization. Hide all 711*bf6873c5SCy Schubert functions except the official interfaces using a version script on 712*bf6873c5SCy Schubert Linux. This protects against leaking symbols into the application 713*bf6873c5SCy Schubert namespace and provides some mild optimization benefit. 714*bf6873c5SCy Schubert 715*bf6873c5SCy Schubert Fix the probing of PAM headers for const on Mac OS X. This will 716*bf6873c5SCy Schubert suppress some harmless compiler warnings there. Thanks, Markus 717*bf6873c5SCy Schubert Moeller. 718*bf6873c5SCy Schubert 719*bf6873c5SCy Schubertpam-krb5 3.10 (2007-12-28) 720*bf6873c5SCy Schubert 721*bf6873c5SCy Schubert The workaround for krb5_get_init_creds_opt_alloc problems in MIT 722*bf6873c5SCy Schubert Kerberos 1.6 broke PKINIT support with Heimdal. Only apply that 723*bf6873c5SCy Schubert workaround when building against the MIT Kerberos libraries. Thanks 724*bf6873c5SCy Schubert to Jaakko Pero for the detailed report. 725*bf6873c5SCy Schubert 726*bf6873c5SCy Schubert If no_ccache is set, always exit successfully from pam_setcred or 727*bf6873c5SCy Schubert pam_open_session, even if we couldn't retrieve module data. Thanks, 728*bf6873c5SCy Schubert Markus Moeller. 729*bf6873c5SCy Schubert 730*bf6873c5SCy Schubert When keytab is set, properly handle failure to create a keytab cursor 731*bf6873c5SCy Schubert and don't assume that the cursor is valid. Thanks, Markus Moeller. 732*bf6873c5SCy Schubert 733*bf6873c5SCy Schubert Define _ALL_SOURCE on AIX to get prototypes for snprintf. 734*bf6873c5SCy Schubert 735*bf6873c5SCy Schubert Add additional portability glue and Autoconf probes to support 736*bf6873c5SCy Schubert building against the version of Kerberos bundled with AIX. Support 737*bf6873c5SCy Schubert for this should be considered alpha in this release. Thanks to Markus 738*bf6873c5SCy Schubert Moeller for the initial patch. 739*bf6873c5SCy Schubert 740*bf6873c5SCy Schubertpam-krb5 3.9 (2007-11-12) 741*bf6873c5SCy Schubert 742*bf6873c5SCy Schubert If use_authtok is set, fail even if we can retrieve the stored PAM 743*bf6873c5SCy Schubert password if that password is set to NULL. Apparently that can happen 744*bf6873c5SCy Schubert in some cases, such as with pam_cracklib. Thanks to Christian Holler 745*bf6873c5SCy Schubert for the diagnosis and a patch. 746*bf6873c5SCy Schubert 747*bf6873c5SCy Schubert Add a new clear_on_fail option for the password group. If set, when a 748*bf6873c5SCy Schubert password change fails, set PAM_AUTHTOK to NULL so that subsequent 749*bf6873c5SCy Schubert modules in the PAM stack with use_authtok set will also fail. Just 750*bf6873c5SCy Schubert returning failure doesn't abort the stack on the second pass when 751*bf6873c5SCy Schubert actual password changes are made. This is not the default since it 752*bf6873c5SCy Schubert interferes with other desirable PAM configurations. It's useful 753*bf6873c5SCy Schubert primarily when using the PAM stack to synchronize passwords between 754*bf6873c5SCy Schubert multiple environments. Thanks to Christian Holler and Tomas Mraz for 755*bf6873c5SCy Schubert the analysis. 756*bf6873c5SCy Schubert 757*bf6873c5SCy Schubert Fix portability issues with Heimdal, versions of PAM that don't 758*bf6873c5SCy Schubert provide pam_modutil_getpwnam, and compiler warnings when building 759*bf6873c5SCy Schubert PKINIT support. Thanks, Martin von Gagern. 760*bf6873c5SCy Schubert 761*bf6873c5SCy Schubert Fix parsing of the keytab PAM option. Thanks, Markus Moeller. 762*bf6873c5SCy Schubert 763*bf6873c5SCy Schubert Return PAM_AUTHINFO_UNAVAIL instead of PAM_AUTH_ERR when unable to 764*bf6873c5SCy Schubert resolve the Kerberos realm. Thanks, Frank Cornelissen. 765*bf6873c5SCy Schubert 766*bf6873c5SCy Schubert Add a new debugging section to the README. 767*bf6873c5SCy Schubert 768*bf6873c5SCy Schubertpam-krb5 3.8 (2007-09-30) 769*bf6873c5SCy Schubert 770*bf6873c5SCy Schubert krb5_get_init_creds_opt_alloc doesn't initialize the returned 771*bf6873c5SCy Schubert structure with the default flags in MIT Kerberos 1.6, which meant that 772*bf6873c5SCy Schubert users with expired passwords were not being prompted to change their 773*bf6873c5SCy Schubert password but just rejected. Fixed by always calling _init before 774*bf6873c5SCy Schubert setting the credential flags, regardless of the provenance of the opt 775*bf6873c5SCy Schubert structure. Thanks, Michael Richters. 776*bf6873c5SCy Schubert 777*bf6873c5SCy Schubert Fix configure and Makefile glue so that Mac OS X and HP-UX have a 778*bf6873c5SCy Schubert chance of working (still untested). 779*bf6873c5SCy Schubert 780*bf6873c5SCy Schubert Add a make warnings target with aggressive gcc warning options. Treat 781*bf6873c5SCy Schubert negative minimum UIDs as zero so that UID comparisons can always be 782*bf6873c5SCy Schubert done unsigned. Add casts and unused attributes as needed. 783*bf6873c5SCy Schubert 784*bf6873c5SCy Schubertpam-krb5 3.7 (2007-09-29) 785*bf6873c5SCy Schubert 786*bf6873c5SCy Schubert If given an explicit keytab path to use for credential verification, 787*bf6873c5SCy Schubert use the first principal found in that keytab as the principal for 788*bf6873c5SCy Schubert verification rather than the library default (which is normally the 789*bf6873c5SCy Schubert host/* principal for the local system and may not be found in that 790*bf6873c5SCy Schubert keytab). 791*bf6873c5SCy Schubert 792*bf6873c5SCy Schubert When authenticating, don't store our context data until after 793*bf6873c5SCy Schubert authentication has succeeded. Otherwise, we may destroy the ticket 794*bf6873c5SCy Schubert cache of a previous successful authentication. This bug would only 795*bf6873c5SCy Schubert affect configurations where pam_krb5 was run multiple times with 796*bf6873c5SCy Schubert different settings, such as multiple realms. Thanks to Dave Botsch 797*bf6873c5SCy Schubert for the report. 798*bf6873c5SCy Schubert 799*bf6873c5SCy Schubert Use pam_modutil_getpwnam instead of getpwnam if available for better 800*bf6873c5SCy Schubert thread safety. 801*bf6873c5SCy Schubert 802*bf6873c5SCy Schubert Don't store PAM data unless we're saving a ticket cache. All other 803*bf6873c5SCy Schubert calls use it for is to find the ticket cache, so without a cache it's 804*bf6873c5SCy Schubert pointless and means we run the risk of stomping on ourselves in 805*bf6873c5SCy Schubert multithreaded programs. 806*bf6873c5SCy Schubert 807*bf6873c5SCy Schubert Still canonicalize the PAM user before returning when not saving a 808*bf6873c5SCy Schubert ticket cache. 809*bf6873c5SCy Schubert 810*bf6873c5SCy Schubert Fix determination of linker flags on non-x86_64 Linux. Always link 811*bf6873c5SCy Schubert with -fPIC when using GCC, just in case. 812*bf6873c5SCy Schubert 813*bf6873c5SCy Schubert Add compilation options for Mac OS X and HP-UX (untested). 814*bf6873c5SCy Schubert 815*bf6873c5SCy Schubert Use pam_krb5 instead of ctx for our PAM data name to reduce the 816*bf6873c5SCy Schubert chances of collision. 817*bf6873c5SCy Schubert 818*bf6873c5SCy Schubertpam-krb5 3.6 (2007-09-18) 819*bf6873c5SCy Schubert 820*bf6873c5SCy Schubert When the local user doesn't exist and search_k5login is enabled, fall 821*bf6873c5SCy Schubert back to simple Kerberos authentication just as if the account existed 822*bf6873c5SCy Schubert with no .k5login file. This avoids trying to verify an all-zero 823*bf6873c5SCy Schubert credentials structure, leading to non-expoloitable segfaults on x86_64 824*bf6873c5SCy Schubert systems. Be more careful in general about setting error codes in the 825*bf6873c5SCy Schubert search_k5login implementation. 826*bf6873c5SCy Schubert 827*bf6873c5SCy Schubert Explicitly clear the forwardable and proxiable options and don't ask 828*bf6873c5SCy Schubert for renewable tickets when getting a ticket for the password changing 829*bf6873c5SCy Schubert service. Otherwise, system-wide defaults and PAM configuration will 830*bf6873c5SCy Schubert apply to those tickets as well and the resulting ticket request may be 831*bf6873c5SCy Schubert rejected based on KDC configuration. Based on a patch by Sergio 832*bf6873c5SCy Schubert Gelato. 833*bf6873c5SCy Schubert 834*bf6873c5SCy Schubert Do username canonicalization earlier so that .k5login checking and 835*bf6873c5SCy Schubert similar work uses the correct username but only change the PAM 836*bf6873c5SCy Schubert username if authentication succeeds. Document that username 837*bf6873c5SCy Schubert canonicalization won't work with unmodified OpenSSH and with several 838*bf6873c5SCy Schubert common PAM modules. Thanks to R. Scott Bailey for the bug report and 839*bf6873c5SCy Schubert analysis. 840*bf6873c5SCy Schubert 841*bf6873c5SCy Schubert Add a prompt_principal option which, if set, causes the PAM module to 842*bf6873c5SCy Schubert prompt the user for the Kerberos principal to use for authentication 843*bf6873c5SCy Schubert before prompting for the password. 844*bf6873c5SCy Schubert 845*bf6873c5SCy Schubert Try to determine whether the PAM headers use const in the prototypes 846*bf6873c5SCy Schubert of such things as pam_get_item and adjust accordingly. This should 847*bf6873c5SCy Schubert address most compiler warnings on Solaris. Thanks, Markus Moeller. 848*bf6873c5SCy Schubert 849*bf6873c5SCy Schubert Change lib to lib64 on x86_64 Linux to allow for the magical $ISA 850*bf6873c5SCy Schubert parameter in Red Hat's PAM configuration. Hopefully this won't cause 851*bf6873c5SCy Schubert problems elsewhere. 852*bf6873c5SCy Schubert 853*bf6873c5SCy Schubert Support DESTDIR for make install. 854*bf6873c5SCy Schubert 855*bf6873c5SCy Schubertpam-krb5 3.5 (2007-04-10) 856*bf6873c5SCy Schubert 857*bf6873c5SCy Schubert Don't try to chown non-FILE ticket caches, which among other things 858*bf6873c5SCy Schubert breaks using pam-krb5 with Heimdal KCM caches. Thanks, Jeremy 859*bf6873c5SCy Schubert Jackson. 860*bf6873c5SCy Schubert 861*bf6873c5SCy Schubert When logging session deletion via pam_setcred or pam_close_session, 862*bf6873c5SCy Schubert don't look for the username in the PAM context after it's been freed. 863*bf6873c5SCy Schubert Thanks, Markus Moeller. 864*bf6873c5SCy Schubert 865*bf6873c5SCy Schubert Map more Kerberos status codes to PAM status codes for authentication 866*bf6873c5SCy Schubert errors. 867*bf6873c5SCy Schubert 868*bf6873c5SCy Schubertpam-krb5 3.4 (2007-01-28) 869*bf6873c5SCy Schubert 870*bf6873c5SCy Schubert More compilation fixes for Heimdal 0.7, which has a pkinit function 871*bf6873c5SCy Schubert but takes a different number of arguments. Thanks, Morgan LEFIEUX. 872*bf6873c5SCy Schubert 873*bf6873c5SCy Schubert Never call error_message directly on Heimdal. krb5_get_err_text can 874*bf6873c5SCy Schubert cope with a NULL context and krb5-config on Heimdal doesn't include 875*bf6873c5SCy Schubert -lcom_err. 876*bf6873c5SCy Schubert 877*bf6873c5SCy Schubert Handle a NULL return from krb5_get_error_message, since that seems 878*bf6873c5SCy Schubert possible in some edge cases. 879*bf6873c5SCy Schubert 880*bf6873c5SCy Schubert Call krb5_get_error_message on Heimdal as well if it's available, 881*bf6873c5SCy Schubert since it's supported by the 0.8 release candidates. 882*bf6873c5SCy Schubert 883*bf6873c5SCy Schubertpam-krb5 3.3 (2007-01-24) 884*bf6873c5SCy Schubert 885*bf6873c5SCy Schubert Support the new MIT Kerberos error message functions. 886*bf6873c5SCy Schubert 887*bf6873c5SCy Schubert Fix compilation errors in the Heimdal PKINIT support and don't be 888*bf6873c5SCy Schubert confused by a similar function in the MIT Kerberos PKINIT branch. 889*bf6873c5SCy Schubert Thanks to Douglas E. Engert for the testing and patch. 890*bf6873c5SCy Schubert 891*bf6873c5SCy Schubert Fix compilation errors with Heimdal 0.7, which has some of the PKINIT 892*bf6873c5SCy Schubert functions but doesn't define the same error codes. Thanks, Morgan 893*bf6873c5SCy Schubert LEFIEUX. 894*bf6873c5SCy Schubert 895*bf6873c5SCy Schubert Initial support for the MIT Kerberos PKINIT branch, which uses a 896*bf6873c5SCy Schubert different mechanism for configuring PKINIT support than Heimdal. Also 897*bf6873c5SCy Schubert support configuration of general preauth parameters for the MIT 898*bf6873c5SCy Schubert preauth plugin system via the preauth_opt option. Thanks to Douglas 899*bf6873c5SCy Schubert E. Engert for the initial patch. 900*bf6873c5SCy Schubert 901*bf6873c5SCy Schubert If use_pkinit is set in the PAM configuration and PKINIT isn't 902*bf6873c5SCy Schubert available or cannot be forced, always fail authentication. 903*bf6873c5SCy Schubert 904*bf6873c5SCy Schubertpam-krb5 3.2 (2007-01-16) 905*bf6873c5SCy Schubert 906*bf6873c5SCy Schubert This release fixes numerous bugs all identified by Douglas E. Engert 907*bf6873c5SCy Schubert while testing with Heimdal and PKINIT support. Thank you! 908*bf6873c5SCy Schubert 909*bf6873c5SCy Schubert Rewrite the code to drop the credlist data structure since we only 910*bf6873c5SCy Schubert ever have one set of credentials, allocate new krb5_creds objects, and 911*bf6873c5SCy Schubert do proper memory management, which should plug some memory leaks of 912*bf6873c5SCy Schubert the contents of krb5_creds objects. 913*bf6873c5SCy Schubert 914*bf6873c5SCy Schubert Probe for the correct Heimdal function to set default initial 915*bf6873c5SCy Schubert credential options. 916*bf6873c5SCy Schubert 917*bf6873c5SCy Schubert Prefix the default cache path with "FILE:" to make the cache type 918*bf6873c5SCy Schubert explicit. 919*bf6873c5SCy Schubert 920*bf6873c5SCy Schubert Fix installation of the manual page when building from a different 921*bf6873c5SCy Schubert directory than the source directory. 922*bf6873c5SCy Schubert 923*bf6873c5SCy Schubert Fix several compilation errors with the PKINIT support with Heimdal 924*bf6873c5SCy Schubert 0.8rc1 or later. This code should still be considered alpha-quality. 925*bf6873c5SCy Schubert 926*bf6873c5SCy Schubertpam-krb5 3.1 (2007-01-03) 927*bf6873c5SCy Schubert 928*bf6873c5SCy Schubert Fix an infinite loop with failed Kerberos authentication and a doubled 929*bf6873c5SCy Schubert colon that causes a syntax error with some compilers. Thanks, Markus 930*bf6873c5SCy Schubert Moeller. 931*bf6873c5SCy Schubert 932*bf6873c5SCy Schubert Move the check for users we should ignore to pam_sm_authenticate 933*bf6873c5SCy Schubert from pamk5_password_auth so that it's consistently done in the API 934*bf6873c5SCy Schubert function. This also avoids bogus log messages when authenticating as 935*bf6873c5SCy Schubert an ignored user with debug enabled. 936*bf6873c5SCy Schubert 937*bf6873c5SCy Schubertpam-krb5 3.0 (2006-12-18) 938*bf6873c5SCy Schubert 939*bf6873c5SCy Schubert Add preliminary PKINIT support, contributed by Douglas E. Engert. 940*bf6873c5SCy Schubert I reorganized and refactored the code extensively and it therefore may 941*bf6873c5SCy Schubert not compile; until it has received more testing, it should be 942*bf6873c5SCy Schubert considered alpha-quality. Currently, PKINIT support requires Heimdal 943*bf6873c5SCy Schubert 0.8rc1 or later. 944*bf6873c5SCy Schubert 945*bf6873c5SCy Schubert Add a keytab configuration option to use a different keytab for 946*bf6873c5SCy Schubert initial credential validation. 947*bf6873c5SCy Schubert 948*bf6873c5SCy Schubert Add a ticket_lifetime configuration option to set the lifetime of 949*bf6873c5SCy Schubert obtained credentials. 950*bf6873c5SCy Schubert 951*bf6873c5SCy Schubert Add the banner and expose_account configuration options, which control 952*bf6873c5SCy Schubert the prompts for authentication and password changing. Provide more 953*bf6873c5SCy Schubert informative prompts when changing passwords. 954*bf6873c5SCy Schubert 955*bf6873c5SCy Schubert Work around a bug in MIT Kerberos prior to 1.4 causing the library to 956*bf6873c5SCy Schubert cache the default realm and assume a particular realm even if the 957*bf6873c5SCy Schubert default realm is later changed. This bug prevented running two 958*bf6873c5SCy Schubert instances of pam-krb5 with different realm settings in the same PAM 959*bf6873c5SCy Schubert stack. Thanks, Dave Botsch. 960*bf6873c5SCy Schubert 961*bf6873c5SCy Schubert Honor PAM_SILENT when the Kerberos library prompts for more 962*bf6873c5SCy Schubert information, passing to the application only prompts. 963*bf6873c5SCy Schubert 964*bf6873c5SCy Schubert If PAM_USER is set to a fully-qualified principal that the Kerberos 965*bf6873c5SCy Schubert library can map to a local account name, reset PAM_USER to that local 966*bf6873c5SCy Schubert account name after authentication. 967*bf6873c5SCy Schubert 968*bf6873c5SCy Schubert Avoid memory leaks in the Kerberos prompter by freeing the PAM 969*bf6873c5SCy Schubert response strings. We were already doing this elsewhere and the world 970*bf6873c5SCy Schubert didn't end, so assume that it's safe for the PAM module to do this. 971*bf6873c5SCy Schubert Also avoid memory leaks in some unusual error conditions. 972*bf6873c5SCy Schubert 973*bf6873c5SCy Schubert Return unknown user rather than internal error when attempting 974*bf6873c5SCy Schubert authentication of a user we're supposed to ignore. 975*bf6873c5SCy Schubert 976*bf6873c5SCy Schubert When debug is enabled, report the principal for which we're attempting 977*bf6873c5SCy Schubert authentication to help catch realm configuration errors. 978*bf6873c5SCy Schubert 979*bf6873c5SCy Schubert Document the broken behavior of old versions of OpenSSH, which tell 980*bf6873c5SCy Schubert PAM to refresh credentials rather than opening a session. Thanks, 981*bf6873c5SCy Schubert Michael C. Garrison. 982*bf6873c5SCy Schubert 983*bf6873c5SCy Schubert Add a link to the distribution page to the pam-krb5 man page. 984*bf6873c5SCy Schubert 985*bf6873c5SCy Schubert Extensive refactoring and reorganization of the code. 986*bf6873c5SCy Schubert 987*bf6873c5SCy Schubertpam-krb5 2.6 (2006-11-28) 988*bf6873c5SCy Schubert 989*bf6873c5SCy Schubert Don't assume the pointer set by pam_get_user is usable over the life 990*bf6873c5SCy Schubert of the PAM module; instead, save a local copy. 991*bf6873c5SCy Schubert 992*bf6873c5SCy Schubert Avoid a use of already freed memory when debugging is enabled. 993*bf6873c5SCy Schubert 994*bf6873c5SCy Schubert Use __func__ instead of __FUNCTION__ and provide a fallback for older 995*bf6873c5SCy Schubert versions of gcc and for systems that support neither. Should fix 996*bf6873c5SCy Schubert compilation issues with Sun's C compiler. 997*bf6873c5SCy Schubert 998*bf6873c5SCy Schubert On platforms where we know the appropriate compiler flags, try to 999*bf6873c5SCy Schubert build the module so that symbols are resolved within the module in 1000*bf6873c5SCy Schubert preference to any externally available symbols. Also add the 1001*bf6873c5SCy Schubert hopefully correct compiler flags for Sun's C compiler. 1002*bf6873c5SCy Schubert 1003*bf6873c5SCy Schubertpam-krb5 2.5 (2006-11-03) 1004*bf6873c5SCy Schubert 1005*bf6873c5SCy Schubert Don't free the results of pam_get_item(PAM_AUTHTOK) when changing 1006*bf6873c5SCy Schubert passwords. Thanks, Arne Nordmark. 1007*bf6873c5SCy Schubert 1008*bf6873c5SCy Schubert Be a bit more thorough when checking authorization in 1009*bf6873c5SCy Schubert pam_sm_acct_mgmt. Re-retrieve the value of user in case the 1010*bf6873c5SCy Schubert application changed it, and if we have a ticket cache (we may not even 1011*bf6873c5SCy Schubert after a successful authentication if no_ccache was specified), 1012*bf6873c5SCy Schubert retrieve the principal from it rather than using the principal from 1013*bf6873c5SCy Schubert the context. 1014*bf6873c5SCy Schubert 1015*bf6873c5SCy Schubert Overwrite passwords with 0 before freeing them, just out of paranoia 1016*bf6873c5SCy Schubert (and because PAM also does this internally). 1017*bf6873c5SCy Schubert 1018*bf6873c5SCy Schubertpam-krb5 2.4 (2006-10-05) 1019*bf6873c5SCy Schubert 1020*bf6873c5SCy Schubert Fix compilation problems with Heimdal. Thanks, Matthijs Mohlmann and 1021*bf6873c5SCy Schubert Douglas Engert. 1022*bf6873c5SCy Schubert 1023*bf6873c5SCy Schubert Check for memory allocation failures when parsing PAM options rather 1024*bf6873c5SCy Schubert than segfaulting. 1025*bf6873c5SCy Schubert 1026*bf6873c5SCy Schubert Fix several places where an uninitialized context could have been 1027*bf6873c5SCy Schubert passed into the argument parsing function. 1028*bf6873c5SCy Schubert 1029*bf6873c5SCy Schubert Refactor the code to read configuration from krb5.conf to be easier 1030*bf6873c5SCy Schubert to read and understand. Parse renew_lifetime immediately and always 1031*bf6873c5SCy Schubert report an error rather than deferring time parsing until acquiring 1032*bf6873c5SCy Schubert tickets. 1033*bf6873c5SCy Schubert 1034*bf6873c5SCy Schubert Log errors (not just authentication failures) at the LOG_ERR level 1035*bf6873c5SCy Schubert to match (some of) the recommendations of the Linux PAM documentation. 1036*bf6873c5SCy Schubert 1037*bf6873c5SCy Schubert Log an error when an unknown option is passed via the PAM 1038*bf6873c5SCy Schubert configuration. 1039*bf6873c5SCy Schubert 1040*bf6873c5SCy Schubertpam-krb5 2.3 (2006-09-03) 1041*bf6873c5SCy Schubert 1042*bf6873c5SCy Schubert Fix the interface between the Kerberos prompting function and the 1043*bf6873c5SCy Schubert PAM conversation function on Linux. Prior to this fix, the PAM module 1044*bf6873c5SCy Schubert would only work on Solaris if Kerberos passed multiple prompts, which 1045*bf6873c5SCy Schubert happens when an account requires a password change. Solaris and Linux 1046*bf6873c5SCy Schubert PAM implementations expect a different structure of pam_message 1047*bf6873c5SCy Schubert structs in the conversation function; use a workaround to cater to 1048*bf6873c5SCy Schubert both of them. Based on a patch by Joachim Keltsch. 1049*bf6873c5SCy Schubert 1050*bf6873c5SCy Schubert Implement retain_after_close, which specifies that the PAM module 1051*bf6873c5SCy Schubert should never destroy the user's ticket cache, even on session end. 1052*bf6873c5SCy Schubert 1053*bf6873c5SCy Schubert Adjust for the differences in Solaris's PAM libraries: Include 1054*bf6873c5SCy Schubert pam_appl.h everywhere for structure and type definitions, and add 1055*bf6873c5SCy Schubert portability workarounds for the return statuses missing from the 1056*bf6873c5SCy Schubert Solaris implementation. 1057*bf6873c5SCy Schubert 1058*bf6873c5SCy Schubertpam-krb5 2.2 (2006-08-28) 1059*bf6873c5SCy Schubert 1060*bf6873c5SCy Schubert Allow the default realm to be overridden in the PAM options. 1061*bf6873c5SCy Schubert 1062*bf6873c5SCy Schubert Use the realm, default or otherwise, when reading options from 1063*bf6873c5SCy Schubert krb5.conf so that realm-specific sections in [appdefaults] work 1064*bf6873c5SCy Schubert correctly. 1065*bf6873c5SCy Schubert 1066*bf6873c5SCy Schubert Update the build and installation documentation for the new 1067*bf6873c5SCy Schubert Autoconf-based build system. This should have been in the last 1068*bf6873c5SCy Schubert release but was missed. 1069*bf6873c5SCy Schubert 1070*bf6873c5SCy Schubert Initialize ticket options correctly when built with Heimdal. 1071*bf6873c5SCy Schubert 1072*bf6873c5SCy Schubert Fix a typo that caused the Heimdal support not to compile. Thanks, 1073*bf6873c5SCy Schubert Matthijs Mohlmann. 1074*bf6873c5SCy Schubert 1075*bf6873c5SCy Schubertpam-krb5 2.1 (2006-08-26) 1076*bf6873c5SCy Schubert 1077*bf6873c5SCy Schubert Strip off a FILE: prefix from the cache path before creating it in 1078*bf6873c5SCy Schubert case the user set ccache or ccache_dir with a cache type prefix. 1079*bf6873c5SCy Schubert Thanks to Björn Torkelsson for the patch. 1080*bf6873c5SCy Schubert 1081*bf6873c5SCy Schubert Added an Autoconf script to distinguish between Heimdal and MIT 1082*bf6873c5SCy Schubert Kerberos and take care of other portability issues. Rewrote the 1083*bf6873c5SCy Schubert Makefile accordingly. 1084*bf6873c5SCy Schubert 1085*bf6873c5SCy Schubert Added portability and error reporting fixes for Heimdal, thanks to 1086*bf6873c5SCy Schubert Matthijs Mohlmann. 1087*bf6873c5SCy Schubert 1088*bf6873c5SCy Schubertpam-krb5 2.0 (2006-08-11) 1089*bf6873c5SCy Schubert 1090*bf6873c5SCy Schubert Always use a disk cache for temporary storage of credentials between 1091*bf6873c5SCy Schubert authentication and setcred or session initialization. This allows the 1092*bf6873c5SCy Schubert module to work correctly with OpenSSH ChallengeResponseAuthentication. 1093*bf6873c5SCy Schubert 1094*bf6873c5SCy Schubert Add support for some PAM options that were supported by the 1095*bf6873c5SCy Schubert Sourceforge K5 PAM module, most notably minimum_uid and 1096*bf6873c5SCy Schubert renew_lifetime. 1097*bf6873c5SCy Schubert 1098*bf6873c5SCy Schubert Support setting many PAM options from krb5.conf as well as on the PAM 1099*bf6873c5SCy Schubert command line, using the same application section as the Sourceforge 1100*bf6873c5SCy Schubert PAM module. Use the profile reading functions provided by the 1101*bf6873c5SCy Schubert Kerberos libraries. 1102*bf6873c5SCy Schubert 1103*bf6873c5SCy Schubert Add support for use_authtok, which is like use_first_pass except that 1104*bf6873c5SCy Schubert it will never prompt even if no password is currently set. 1105*bf6873c5SCy Schubert 1106*bf6873c5SCy Schubert Add a search_k5login option to check the user's password against every 1107*bf6873c5SCy Schubert principal listed in .k5login, to support use of this module to 1108*bf6873c5SCy Schubert authenticate user access to shared accounts. 1109*bf6873c5SCy Schubert 1110*bf6873c5SCy Schubert Add an ignore_k5login option that bypasses all checks of .k5login 1111*bf6873c5SCy Schubert files entirely and relies solely on krb5_aname_to_localname checks. 1112*bf6873c5SCy Schubert 1113*bf6873c5SCy Schubert Re-add the ccache option to specify the exact file name of the ticket 1114*bf6873c5SCy Schubert cache, and allow for randomization using mkstemp even when this option 1115*bf6873c5SCy Schubert is used. 1116*bf6873c5SCy Schubert 1117*bf6873c5SCy Schubert Only call krb5_kuserok (the .k5login check) when the account to which 1118*bf6873c5SCy Schubert the user is authenticating is a local account. It's up to the 1119*bf6873c5SCy Schubert application to handle authorization checks for non-local accounts. 1120*bf6873c5SCy Schubert 1121*bf6873c5SCy Schubert Support preliminary checks for password changing by using that to 1122*bf6873c5SCy Schubert obtain the user's current credentials. Correctly handle saved 1123*bf6873c5SCy Schubert passwords from previous authentications or password changes when 1124*bf6873c5SCy Schubert changing passwords, and correctly set the saved passwords for 1125*bf6873c5SCy Schubert subsequent password changes in the PAM stack. 1126*bf6873c5SCy Schubert 1127*bf6873c5SCy Schubert Only initialize the ticket cache once, no matter how many times 1128*bf6873c5SCy Schubert setcred is called. This saves duplicate work and works around a bug 1129*bf6873c5SCy Schubert in X.org xdm that otherwise causes it to lose the PAM environment. 1130*bf6873c5SCy Schubert 1131*bf6873c5SCy Schubert When reinitializing a ticket cache, never reinitialize the temporary 1132*bf6873c5SCy Schubert cache created by the authentication call. Instead, fall back to the 1133*bf6873c5SCy Schubert default ticket cache name if KRB5CCNAME isn't set. 1134*bf6873c5SCy Schubert 1135*bf6873c5SCy Schubert Improve support for no_ccache. Now, it doesn't even generate a 1136*bf6873c5SCy Schubert temporary ticket cache during authentication but only uses an 1137*bf6873c5SCy Schubert in-memory credential list. 1138*bf6873c5SCy Schubert 1139*bf6873c5SCy Schubert Do user ticket validation using the standard Kerberos library call 1140*bf6873c5SCy Schubert rather than rolling our own code. This means that the user can now 1141*bf6873c5SCy Schubert set options in krb5.conf to control whether that call should fail if 1142*bf6873c5SCy Schubert the local keytab isn't readable or contains no usable keys. 1143*bf6873c5SCy Schubert 1144*bf6873c5SCy Schubert Completely rewrite the man page. Clean it up and make it more 1145*bf6873c5SCy Schubert readable and fully document all of the options. Also rewrite the 1146*bf6873c5SCy Schubert README file and clean up the rest of the package documentation. 1147*bf6873c5SCy Schubert 1148*bf6873c5SCy Schubert Don't create a ticket cache until after successful authentication. 1149*bf6873c5SCy Schubert 1150*bf6873c5SCy Schubert Understand the FILE: prefix to Kerberos ticket cache names and compare 1151*bf6873c5SCy Schubert and chown ticket caches properly with that prefix. 1152*bf6873c5SCy Schubert 1153*bf6873c5SCy Schubert Add a trailing nul to the password in the Kerberos prompter function, 1154*bf6873c5SCy Schubert since some code relies on it being there. 1155*bf6873c5SCy Schubert 1156*bf6873c5SCy Schubert Review the return status of each PAM function and ensure that we only 1157*bf6873c5SCy Schubert return failure statuses that are supported for that function. 1158*bf6873c5SCy Schubert 1159*bf6873c5SCy Schubert Rename all internal functions with a pamk5_* prefix to avoid 1160*bf6873c5SCy Schubert conflicting with any application or system library functions. 1161*bf6873c5SCy Schubert 1162*bf6873c5SCy Schubert Eliminate global variables in the PAM module and do a better job at 1163*bf6873c5SCy Schubert cleaning up memory usage. There are still a few places where the PAM 1164*bf6873c5SCy Schubert conversation functions may leak memory due to an incomplete 1165*bf6873c5SCy Schubert specification in the PAM API on who should free what memory. 1166*bf6873c5SCy Schubert 1167*bf6873c5SCy Schubert The logging messages produced when debug is set should now be more 1168*bf6873c5SCy Schubert consistent and more complete. 1169*bf6873c5SCy Schubert 1170*bf6873c5SCy Schubertpam-krb5 1.2 (2005-09-27) 1171*bf6873c5SCy Schubert 1172*bf6873c5SCy Schubert Don't reinitialize the ticket cache if the old and new cache have the 1173*bf6873c5SCy Schubert same name, since otherwise we end up destroying it. 1174*bf6873c5SCy Schubert 1175*bf6873c5SCy Schubert Always set KRB5CCNAME, even when reinitializing. 1176*bf6873c5SCy Schubert 1177*bf6873c5SCy Schubert When reinitializing, look for the ticket cache in the saved context 1178*bf6873c5SCy Schubert even if KRB5CCNAME isn't set. OpenSSH calls it this way. 1179*bf6873c5SCy Schubert 1180*bf6873c5SCy Schubert Drop the ccache option and add ccache_dir instead, which only 1181*bf6873c5SCy Schubert specifies the directory for ticket caches and is therefore easier to 1182*bf6873c5SCy Schubert implement. 1183*bf6873c5SCy Schubert 1184*bf6873c5SCy Schubertpam-krb5 1.1 (2005-08-31) 1185*bf6873c5SCy Schubert 1186*bf6873c5SCy Schubert Add support for reinitialization/refreshing of credentials in 1187*bf6873c5SCy Schubert pam_sm_setcred. 1188*bf6873c5SCy Schubert 1189*bf6873c5SCy Schubert Set PAM_AUTHTOK and PAM_OLDAUTHTOK when authenticating to better 1190*bf6873c5SCy Schubert support stacking this module with others. 1191*bf6873c5SCy Schubert 1192*bf6873c5SCy Schubert Add an ignore_root option to not do anything when the account to which 1193*bf6873c5SCy Schubert the user is authenticating is root. This allows one to log in via 1194*bf6873c5SCy Schubert console as root even when the network is down (thereby breaking the 1195*bf6873c5SCy Schubert PAM module in ways that login doesn't like due to timeouts in the 1196*bf6873c5SCy Schubert Kerberos libraries). 1197*bf6873c5SCy Schubert 1198*bf6873c5SCy Schubert Store the entire context structure in PAM's memory rather than just 1199*bf6873c5SCy Schubert the name of the ticket cache so that we can pass around more data to 1200*bf6873c5SCy Schubert ourself. 1201*bf6873c5SCy Schubert 1202*bf6873c5SCy Schubert Bring errors more in line with the official PAM specification. 1203*bf6873c5SCy Schubert 1204*bf6873c5SCy Schubert Move prompt generation into the PAM module rather than letting the 1205*bf6873c5SCy Schubert Kerberos library generate the prompt. This way we don't leak 1206*bf6873c5SCy Schubert principal information to the caller, and the non-standard prompt also 1207*bf6873c5SCy Schubert broke some applications like gksudo. 1208*bf6873c5SCy Schubert 1209*bf6873c5SCy Schubert Support session management and destruction of the ticket cache on 1210*bf6873c5SCy Schubert close of session. 1211*bf6873c5SCy Schubert 1212*bf6873c5SCy Schubert Don't require that the user have a local account on the system. 1213*bf6873c5SCy Schubert 1214*bf6873c5SCy Schubert Include the user UID in the default ticket cache name so that rpc.gssd 1215*bf6873c5SCy Schubert and similar programs can find it. 1216