summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew N. Dodd <matthew.nygard.dodd@gmail.com>2011-06-20 13:45:11 -0400
committerSteve Dickson <steved@redhat.com>2011-06-21 14:31:45 -0400
commite1cd6dc047c2f4d08f66776bc0206eeb5092f1f8 (patch)
tree839bb3a87e95834ab0b06a56b55a3fa885571633
parent8271dfe7ec97a993fe3e369c9e02165f54f32322 (diff)
downloadti-rpc-e1cd6dc047c2f4d08f66776bc0206eeb5092f1f8.tar.gz
Use correct AUTH when calling RPCSEC_GSS_DESTROY.
When using multiple AUTHs per client connection, calling AUTH_DESTROY(auth) may result in 'cl_auth' being set to something other than 'auth'. Avoid this by saving and restoring 'cl_auth' across the RPCSEC_GSS_DESTROY clnt_call(). Signed-off-by: Steve Dickson <steved@redhat.com>
-rw-r--r--src/auth_gss.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/auth_gss.c b/src/auth_gss.c
index 98f0341..a992049 100644
--- a/src/auth_gss.c
+++ b/src/auth_gss.c
@@ -557,9 +557,20 @@ authgss_destroy_context(AUTH *auth)
if (gd->gc.gc_ctx.length != 0) {
if (gd->established) {
+ AUTH *save_auth = NULL;
+
+ /* Make sure we use the right auth_ops */
+ if (gd->clnt->cl_auth != auth) {
+ save_auth = gd->clnt->cl_auth;
+ gd->clnt->cl_auth = auth;
+ }
+
gd->gc.gc_proc = RPCSEC_GSS_DESTROY;
clnt_call(gd->clnt, NULLPROC, (xdrproc_t)xdr_void, NULL,
(xdrproc_t)xdr_void, NULL, AUTH_TIMEOUT);
+
+ if (save_auth != NULL)
+ gd->clnt->cl_auth = save_auth;
}
gss_release_buffer(&min_stat, &gd->gc.gc_ctx);
/* XXX ANDROS check size of context - should be 8 */