From: Tom Yu Date: Tue, 17 Aug 2004 01:14:58 +0000 (+0000) Subject: * svc_auth_gss.c (gssrpc__svcauth_gss): Add some debug messages X-Git-Tag: krb5-1.4-beta1~143 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b6f896d46dc824de8895c3606e1f6e84cf23ae6f;p=krb5.git * svc_auth_gss.c (gssrpc__svcauth_gss): Add some debug messages * svc.c (svc_getreqset): Don't allocate either raw or cooked credentials on the stack using the cred_area char array; use mem_alloc() instead. This avoids alignment problems. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16668 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/rpc/ChangeLog b/src/lib/rpc/ChangeLog index a2f037137..f58e80098 100644 --- a/src/lib/rpc/ChangeLog +++ b/src/lib/rpc/ChangeLog @@ -1,3 +1,11 @@ +2004-08-16 Tom Yu + + * svc_auth_gss.c (gssrpc__svcauth_gss): Add some debug messages. + + * svc.c (svc_getreqset): Don't allocate either raw or cooked + credentials on the stack using the cred_area char array; use + mem_alloc() instead. This avoids alignment problems. + 2004-06-28 Tom Yu * auth_gss.c (g_OID_equal): Fix signedness. diff --git a/src/lib/rpc/svc.c b/src/lib/rpc/svc.c index e35c80c03..e7f3243cf 100644 --- a/src/lib/rpc/svc.c +++ b/src/lib/rpc/svc.c @@ -421,10 +421,9 @@ svc_getreqset(readfds) register int sock; bool_t no_dispatch; - char cred_area[2*MAX_AUTH_BYTES + RQCRED_SIZE]; - msg.rm_call.cb_cred.oa_base = cred_area; - msg.rm_call.cb_verf.oa_base = &(cred_area[MAX_AUTH_BYTES]); - r.rq_clntcred = &(cred_area[2*MAX_AUTH_BYTES]); + msg.rm_call.cb_cred.oa_base = mem_alloc(MAX_AUTH_BYTES); + msg.rm_call.cb_verf.oa_base = mem_alloc(MAX_AUTH_BYTES); + r.rq_clntcred = mem_alloc(RQCRED_SIZE); #ifdef FD_SETSIZE for (sock = 0; sock <= max_xport; sock++) { @@ -498,4 +497,7 @@ svc_getreqset(readfds) } while (stat == XPRT_MOREREQS); } } + mem_free(msg.rm_call.cb_cred.oa_base, MAX_AUTH_BYTES); + mem_free(msg.rm_call.cb_verf.oa_base, MAX_AUTH_BYTES); + mem_free(r.rq_clntcred, RQCRED_SIZE); } diff --git a/src/lib/rpc/svc_auth_gss.c b/src/lib/rpc/svc_auth_gss.c index 875125195..4479513cf 100644 --- a/src/lib/rpc/svc_auth_gss.c +++ b/src/lib/rpc/svc_auth_gss.c @@ -465,11 +465,16 @@ gssrpc__svcauth_gss(struct svc_req *rqst, struct rpc_msg *msg, gc = (struct rpc_gss_cred *)rqst->rq_clntcred; memset(gc, 0, sizeof(*gc)); - + + log_debug("calling xdrmem_create()"); + log_debug("oa_base=%p, oa_length=%u", rqst->rq_cred.oa_base, + rqst->rq_cred.oa_length); xdrmem_create(&xdrs, rqst->rq_cred.oa_base, rqst->rq_cred.oa_length, XDR_DECODE); + log_debug("xdrmem_create() returned"); if (!xdr_rpc_gss_cred(&xdrs, gc)) { + log_debug("xdr_rpc_gss_cred() failed"); XDR_DESTROY(&xdrs); return (AUTH_BADCRED); } @@ -589,6 +594,7 @@ gssrpc__svcauth_gss(struct svc_req *rqst, struct rpc_msg *msg, retstat = AUTH_OK; freegc: xdr_free(xdr_rpc_gss_cred, gc); + log_debug("returning %d from svcauth_gss()", retstat); return (retstat); }