On Mon, Nov 22, 2010 at 10:49:04AM -0500, Stephen Gallagher wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 11/22/2010 04:03 AM, Sumit Bose wrote:
> On Fri, Nov 19, 2010 at 02:23:21PM -0500, Stephen Gallagher wrote:
> All errnum values passed into this function throughout the code
> are PAM error codes, but we were passing them through strerror()
> to print them, which is only meaningful for ERRNO error codes.
>
> This patch changes dp_err_to_string() to use pam_strerror().
>
>> Maybe it makes sense to rename it to something like
>> dp_pam_err_to_string() ?
>
Done. New patch attached.
ACK
bye,
Sumit
>
> Fixes
https://fedorahosted.org/sssd/ticket/636
>
> Note: the first argument to pam_strerror() requiring a PAM handle is
> historical and not necessary. I tested that passing it NULL results in
> no unexpected behavior.
>
>> Although I'm not aware of any example I would suggest to add a configure
>> test to make sure that there is no PAM implementation which assumes that
>> the first argument is a valid PAM handle. But I would agree to add this
>> as a new enhancement ticket, because it will be only important if we
>> start to test sssd on other platforms than Linux.
>
I don't think there's actually any way to detect this, as the definition
for this function allows no error code returns (just a valid constant
string or NULL, if the error code can't be mapped to one).
I suppose it's possible that it could segfault on certain platforms, but
it doesn't seem likely.
I'm inclined to ignore this unless we actually find a platform that hits it.
- --
Stephen Gallagher
RHCE 804006346421761
Delivering value year after year.
Red Hat ranks #1 in value among software vendors.
http://www.redhat.com/promo/vendor/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora -
http://enigmail.mozdev.org/
iEYEARECAAYFAkzqkPAACgkQeiVVYja6o6NGagCfVP7CfmiJPaZeiEoWUIprEudv
DHoAniRBtAxlt3j/CzMz+5JySBsOru8h
=4cdt
-----END PGP SIGNATURE-----