[SSSD] [PATCH] Fix return value check
Sumit Bose
sbose at redhat.com
Wed Jan 19 12:42:55 UTC 2011
On Wed, Jan 19, 2011 at 06:49:26AM -0500, Stephen Gallagher wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 01/19/2011 06:42 AM, Sumit Bose wrote:
> > On Wed, Jan 19, 2011 at 06:29:17AM -0500, Stephen Gallagher wrote:
> > On 01/19/2011 06:16 AM, Sumit Bose wrote:
> >>>> Hi,
> >>>>
> >>>> this patch fixes a typo which leads to irritation log messages.
> >
> >
> > As a general rule, I prefer explicit (ret != EOK) checks. Yes, I know
> > they're identical, but it reads better.
> >
> >> me too, but I tried to keep the style used in sdap_pam_auth_done().
> >
>
>
> Keeping to that style introduced this bug in the first place, I think :)
>
this new patch should fixes the style issue, too
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/
>
> iEYEARECAAYFAk02z8YACgkQeiVVYja6o6P+RgCfUNIKGAZeUxtjd5NoNhqo7ms/
> AZkAn2jSRJlcL/GLqj5RL/XMAlwj8JOJ
> =BP0L
> -----END PGP SIGNATURE-----
> _______________________________________________
> sssd-devel mailing list
> sssd-devel at lists.fedorahosted.org
> https://fedorahosted.org/mailman/listinfo/sssd-devel
-------------- next part --------------
From c938de388f0fe8ddbad671fb6696cc06a1674e18 Mon Sep 17 00:00:00 2001
From: Sumit Bose <sbose at redhat.com>
Date: Wed, 19 Jan 2011 09:31:31 +0100
Subject: [PATCH] Fix return value check
---
src/providers/ldap/ldap_auth.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/providers/ldap/ldap_auth.c b/src/providers/ldap/ldap_auth.c
index 2d66b1d..853231b 100644
--- a/src/providers/ldap/ldap_auth.c
+++ b/src/providers/ldap/ldap_auth.c
@@ -998,7 +998,7 @@ static void sdap_pam_auth_done(struct tevent_req *req)
&result, NULL,
&pw_expire_type, &pw_expire_data);
talloc_zfree(req);
- if (ret) {
+ if (ret != EOK) {
state->pd->pam_status = PAM_SYSTEM_ERR;
dp_err = DP_ERR_FATAL;
goto done;
@@ -1087,7 +1087,7 @@ static void sdap_pam_auth_done(struct tevent_req *req)
state->username, password);
/* password caching failures are not fatal errors */
- if (!ret) {
+ if (ret != EOK) {
DEBUG(2, ("Failed to cache password for %s\n",
state->username));
} else {
--
1.7.3.3
More information about the sssd-devel
mailing list