]> granicus.if.org Git - postgresql/commit
Rewrite pam_passwd_conv_proc to be more robust: avoid assuming that the
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 16 Oct 2009 22:08:48 +0000 (22:08 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 16 Oct 2009 22:08:48 +0000 (22:08 +0000)
commite0066c6b45bebe26e99b89ddb3769ea73206165e
treeb67323199a1fd1d707dd9b3ebd326e696cb20dc4
parent1b198db44e351ab2624a78f55bde5c830e0a5c9c
Rewrite pam_passwd_conv_proc to be more robust: avoid assuming that the
pam_message array contains exactly one PAM_PROMPT_ECHO_OFF message.
Instead, deal with however many messages there are, and don't throw error
for PAM_ERROR_MSG and PAM_TEXT_INFO messages.  This logic is borrowed from
openssh 5.2p1, which hopefully has seen more real-world PAM usage than we
have.  Per bug #5121 from Ryan Douglas, which turned out to be caused by
the conv_proc being called with zero messages.  Apparently that is normal
behavior given the combination of Linux pam_krb5 with MS Active Directory
as the domain controller.

Patch all the way back, since this code has been essentially untouched
since 7.4.  (Surprising we've not heard complaints before.)
src/backend/libpq/auth.c