From bde0c76e2d17b9da517f9df783a661cf3da70625 Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Wed, 8 Dec 2010 11:40:24 -0600 Subject: [PATCH] Fix AUD_HOST callers Servers using the AUD_HOST audit message should give the host IP in network-byte order, as that is how the auditing code interprets it. Fix the users of AUD_HOST that do not do so. Reviewed-on: http://gerrit.openafs.org/3492 Tested-by: BuildBot Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear (cherry picked from commit b20329e01968d3562f78382b27f7de9948a96899) Change-Id: I5d8b8059101b147583f006bcdd4abd301721be62 Reviewed-on: http://gerrit.openafs.org/3797 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- src/ptserver/ptprocs.c | 4 ++-- src/volser/volprocs.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ptserver/ptprocs.c b/src/ptserver/ptprocs.c index a3e8b2973..471b56ed9 100644 --- a/src/ptserver/ptprocs.c +++ b/src/ptserver/ptprocs.c @@ -1226,7 +1226,7 @@ SPR_GetCPS2(struct rx_call *call, afs_int32 aid, afs_int32 ahost, afs_int32 cid = ANONYMOUSID; code = getCPS2(call, aid, ahost, alist, over, &cid); - osi_auditU(call, PTS_GetCPS2Event, code, AUD_ID, aid, AUD_HOST, ahost, + osi_auditU(call, PTS_GetCPS2Event, code, AUD_ID, aid, AUD_HOST, htonl(ahost), AUD_END); ViceLog(125, ("PTS_GetCPS2: code %d cid %d aid %d ahost %d\n", code, cid, aid, ahost)); return code; @@ -1309,7 +1309,7 @@ SPR_GetHostCPS(struct rx_call *call, afs_int32 ahost, prlist *alist, afs_int32 code; code = getHostCPS(call, ahost, alist, over); - osi_auditU(call, PTS_GetHCPSEvent, code, AUD_HOST, ahost, AUD_END); + osi_auditU(call, PTS_GetHCPSEvent, code, AUD_HOST, htonl(ahost), AUD_END); ViceLog(125, ("PTS_GetHostCPS: code %d ahost %d\n", code, ahost)); return code; } diff --git a/src/volser/volprocs.c b/src/volser/volprocs.c index 858ac63cc..a3572affb 100644 --- a/src/volser/volprocs.c +++ b/src/volser/volprocs.c @@ -1240,7 +1240,7 @@ SAFSVolForward(struct rx_call *acid, afs_int32 fromTrans, afs_int32 fromDate, code = VolForward(acid, fromTrans, fromDate, destination, destTrans, cookie); osi_auditU(acid, VS_ForwardEvent, code, AUD_LONG, fromTrans, AUD_HOST, - destination->destHost, AUD_LONG, destTrans, AUD_END); + htonl(destination->destHost), AUD_LONG, destTrans, AUD_END); return code; } @@ -1443,7 +1443,7 @@ SAFSVolForwardMultiple(struct rx_call *acid, afs_int32 fromTrans, afs_int32 } osi_auditU(acid, VS_ForwardEvent, (code ? code : codes[i]), AUD_LONG, - fromTrans, AUD_HOST, dest->server.destHost, AUD_LONG, + fromTrans, AUD_HOST, htonl(dest->server.destHost), AUD_LONG, dest->trans, AUD_END); } free(tcons); @@ -1593,7 +1593,7 @@ SAFSVolSetForwarding(struct rx_call *acid, afs_int32 atid, afs_int32 anewsite) code = VolSetForwarding(acid, atid, anewsite); osi_auditU(acid, VS_SetForwEvent, code, AUD_LONG, atid, AUD_HOST, - anewsite, AUD_END); + htonl(anewsite), AUD_END); return code; } -- 2.39.5