Skip to contentSkip to conversation

handle_reply: Don't use the xp_auth pointer directly

PATCH In review Steve Dickson 1 participant 2 messages Nov 2, 2015 – Nov 3, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 handle_reply: Don't use the xp_auth pointer directly

In the latest libtirpc version to access the xp_auth one must use the SVC_XP_AUTH macro. To be backwards compatible a couple ifdefs were added to use the macro when it exists.

---
 src/rpcb_svc_com.c | 7 +++++++
 1 file changed, 7 insertions(+)
src/rpcb_svc_com.c +7 -0
index 4ae93f1..22d6c84 100644
@@ -1295,10 +1295,17 @@ handle_reply(int fd, SVCXPRT *xprt)
 	a.rmt_localvers = fi->versnum;
 
 	xprt_set_caller(xprt, fi);
+#if defined(SVC_XP_AUTH)
+	SVC_XP_AUTH(xprt) = svc_auth_none;
+#else 
 	xprt->xp_auth = &svc_auth_none;
+#endif
 	svc_sendreply(xprt, (xdrproc_t) xdr_rmtcall_result, (char *) &a);
+#if !defined(SVC_XP_AUTH)
 	SVCAUTH_DESTROY(xprt->xp_auth);
 	xprt->xp_auth = NULL;
+#endif
+
 done:
 	if (buffer)
 		free(buffer);
Signature · 1 line
2.6.2
#1 lore raw
Quoted 6 lines · Steve Dickson

In the latest libtirpc version to access the xp_auth one must use the SVC_XP_AUTH macro. To be backwards compatible a couple ifdefs were added to use the macro when it exists.

Committed...

steved.

Quoted 27 lines
---
 src/rpcb_svc_com.c | 7 +++++++
 1 file changed, 7 insertions(+)
src/rpcb_svc_com.c +7 -0
index 4ae93f1..22d6c84 100644
@@ -1295,10 +1295,17 @@ handle_reply(int fd, SVCXPRT *xprt)
 	a.rmt_localvers = fi->versnum;
 
 	xprt_set_caller(xprt, fi);
+#if defined(SVC_XP_AUTH)
+	SVC_XP_AUTH(xprt) = svc_auth_none;
+#else 
 	xprt->xp_auth = &svc_auth_none;
+#endif
 	svc_sendreply(xprt, (xdrproc_t) xdr_rmtcall_result, (char *) &a);
+#if !defined(SVC_XP_AUTH)
 	SVCAUTH_DESTROY(xprt->xp_auth);
 	xprt->xp_auth = NULL;
+#endif
+
 done:
 	if (buffer)
 		free(buffer);