Add auditing to GetXStats
authorBenjamin Kaduk <kaduk@mit.edu>
Thu, 4 Dec 2014 21:52:37 +0000 (16:52 -0500)
committerBenjamin Kaduk <kaduk@mit.edu>
Wed, 21 Jan 2015 22:36:08 +0000 (17:36 -0500)
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 <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

src/audit/audit.h
src/viced/afsfileprocs.c

index de8572d..f8b4100 100644 (file)
 #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"
index 914024e..33c3657 100644 (file)
@@ -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
     /*