* [PATCH] rpc.gssd: Only clear the retval if it has not been set
@ 2015-07-30 21:15 Steve Dickson
2015-07-31 12:18 ` Steve Dickson
0 siblings, 1 reply; 2+ messages in thread
From: Steve Dickson @ 2015-07-30 21:15 UTC (permalink / raw)
To: Linux NFS Mailing list
In gssd_search_krb5_keytab() an error code can be
cleared by blindly setting retval to zero.
Reported-by: Jianhong Yin <jiyin@redhat.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
---
utils/gssd/krb5_util.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/utils/gssd/krb5_util.c b/utils/gssd/krb5_util.c
index f1ebc0d..ecf17a2 100644
--- a/utils/gssd/krb5_util.c
+++ b/utils/gssd/krb5_util.c
@@ -772,7 +772,9 @@ gssd_search_krb5_keytab(krb5_context context, krb5_keytab kt,
"keytab '%s'\n", k5err, kt_name);
}
- retval = 0;
+ /* Only clear the retval if has not been set */
+ if (retval < 0)
+ retval = 0;
out:
free(k5err);
return retval;
--
2.4.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] rpc.gssd: Only clear the retval if it has not been set
2015-07-30 21:15 [PATCH] rpc.gssd: Only clear the retval if it has not been set Steve Dickson
@ 2015-07-31 12:18 ` Steve Dickson
0 siblings, 0 replies; 2+ messages in thread
From: Steve Dickson @ 2015-07-31 12:18 UTC (permalink / raw)
To: Linux NFS Mailing list
On 07/30/2015 05:15 PM, Steve Dickson wrote:
> In gssd_search_krb5_keytab() an error code can be
> cleared by blindly setting retval to zero.
>
> Reported-by: Jianhong Yin <jiyin@redhat.com>
> Signed-off-by: Steve Dickson <steved@redhat.com>
Committed...
steved.
> ---
> utils/gssd/krb5_util.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/utils/gssd/krb5_util.c b/utils/gssd/krb5_util.c
> index f1ebc0d..ecf17a2 100644
> --- a/utils/gssd/krb5_util.c
> +++ b/utils/gssd/krb5_util.c
> @@ -772,7 +772,9 @@ gssd_search_krb5_keytab(krb5_context context, krb5_keytab kt,
> "keytab '%s'\n", k5err, kt_name);
> }
>
> - retval = 0;
> + /* Only clear the retval if has not been set */
> + if (retval < 0)
> + retval = 0;
> out:
> free(k5err);
> return retval;
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-07-31 12:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-30 21:15 [PATCH] rpc.gssd: Only clear the retval if it has not been set Steve Dickson
2015-07-31 12:18 ` Steve Dickson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).