From ccda3b6cbbb61fb8d9bc3eea451beb299ad01c1b Mon Sep 17 00:00:00 2001 From: Benjamin Kaduk Date: Thu, 4 Dec 2014 16:52:37 -0500 Subject: [PATCH] Add auditing to GetXStats This will record the caller as well as the fact that we received a GetXStats call. Change-Id: I101b9fcea37e26e031efa4a8cf74df8351866dcf Reviewed-on: http://gerrit.openafs.org/11620 Reviewed-by: Daria Brashear Tested-by: BuildBot --- src/audit/audit.h | 1 + src/viced/afsfileprocs.c | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/audit/audit.h b/src/audit/audit.h index de8572d796..f8b4100b5a 100644 --- a/src/audit/audit.h +++ b/src/audit/audit.h @@ -190,6 +190,7 @@ #define SetExtendedVolumeAttributesEvent "AFS_SRX_SetVA" #define GetStatisticsEvent "AFS_SRX_GetStats" #define XStatsVersionEvent "AFS_SRX_XStatsVer" +#define GetXStatsEvent "AFS_SRX_GetXStats" #define NoAuthEvent "AFS_RunNoAuth" #define NoAuthDisableEvent "AFS_NoAuthDsbl" diff --git a/src/viced/afsfileprocs.c b/src/viced/afsfileprocs.c index 914024ef5c..33c365758a 100644 --- a/src/viced/afsfileprocs.c +++ b/src/viced/afsfileprocs.c @@ -5392,6 +5392,8 @@ SRXAFS_GetXStats(struct rx_call *a_call, afs_int32 a_clientVersionNum, afs_int32 * a_timeP, AFS_CollData * a_dataP) { /*SRXAFS_GetXStats */ + struct client *t_client = NULL; /* tmp ptr to client data */ + struct rx_connection *tcon = rx_ConnectionOf(a_call); int code; /*Return value */ afs_int32 *dataBuffP; /*Ptr to data to be returned */ afs_int32 dataBytes; /*Bytes in data buffer */ @@ -5399,6 +5401,7 @@ SRXAFS_GetXStats(struct rx_call *a_call, afs_int32 a_clientVersionNum, fsstats_StartOp(&fsstats, FS_STATS_RPCIDX_GETXSTATS); + t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key); /* * Record the time of day and the server version number. */ @@ -5410,9 +5413,10 @@ SRXAFS_GetXStats(struct rx_call *a_call, afs_int32 a_clientVersionNum, */ code = 0; - ViceLog(1, - ("Received GetXStats call for collection %d\n", - a_collectionNumber)); + osi_auditU(a_call, GetXStatsEvent, + AUD_ID, t_client ? t_client->z.ViceId : 0, + AUD_INT, a_clientVersionNum, + AUD_INT, a_collectionNumber, AUD_END); #if 0 /*