summaryrefslogtreecommitdiffstats
path: root/utils/gssd/gssd_proc.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2014-04-30 12:12:02 -0400
committerSteve Dickson <steved@redhat.com>2014-04-30 12:19:11 -0400
commitc2007d1c2d2fe27750295cc3845411355a8dd945 (patch)
treea5fd01330af5a3e9a523c6ca195f9ebd948840b7 /utils/gssd/gssd_proc.c
parent4367cacd3c9f52cd7db6c3d0a51e14fb0adef7a4 (diff)
downloadnfs-utils-c2007d1c2d2fe27750295cc3845411355a8dd945.tar.gz
nfs-utils-c2007d1c2d2fe27750295cc3845411355a8dd945.tar.xz
nfs-utils-c2007d1c2d2fe27750295cc3845411355a8dd945.zip
gssd: explicitly set lifetime_rec to 0 when gss_inquire_context fails
Contrary to the comment here, the lifetime_rec is not necessarily set to zero on failure. That's only guaranteed to be the case if the context has expired. Cc: Andy Adamson <androsadamson@gmail.com> Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'utils/gssd/gssd_proc.c')
-rw-r--r--utils/gssd/gssd_proc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/utils/gssd/gssd_proc.c b/utils/gssd/gssd_proc.c
index 7387cce..e26935d 100644
--- a/utils/gssd/gssd_proc.c
+++ b/utils/gssd/gssd_proc.c
@@ -1174,14 +1174,15 @@ process_krb5_upcall(struct clnt_info *clp, uid_t uid, int fd, char *tgtname,
goto out_return_error;
}
- /* Grab the context lifetime to pass to the kernel. lifetime_rec
- * is set to zero on error */
+ /* Grab the context lifetime to pass to the kernel. */
maj_stat = gss_inquire_context(&min_stat, pd.pd_ctx, NULL, NULL,
&lifetime_rec, NULL, NULL, NULL, NULL);
- if (maj_stat)
+ if (maj_stat) {
printerr(1, "WARNING: Failed to inquire context for lifetme "
"maj_stat %u\n", maj_stat);
+ lifetime_rec = 0;
+ }
if (serialize_context_for_kernel(&pd.pd_ctx, &token, &krb5oid, NULL)) {
printerr(0, "WARNING: Failed to serialize krb5 context for "