[SSSD] [PATCH] Print correct error messages for dp_err_to_string()

Sumit Bose sbose at redhat.com
Mon Nov 22 09:03:10 UTC 2010


On Fri, Nov 19, 2010 at 02:23:21PM -0500, Stephen Gallagher wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> 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() ?

> 
> 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.

bye,
Sumit

> 
> - -- 
> 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/
> 
> iEYEARECAAYFAkzmzqkACgkQeiVVYja6o6PIXwCgqWXP1Sm1ym1PaDcWeBjgxB+K
> FcQAn3o5A0KmgT/Z0X0itrTmqiO3sGQl
> =1LHe
> -----END PGP SIGNATURE-----



More information about the sssd-devel mailing list