From: Jeffrey Altman Date: Mon, 11 Jul 2005 20:29:18 +0000 (+0000) Subject: STABLE14-audit-add-and-fix-messages-20050708 X-Git-Tag: openafs-devel-1_3_85~7 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=45cfbf2f01df41981701a17ac7df52778771d4f6;p=packages%2Fo%2Fopenafs.git STABLE14-audit-add-and-fix-messages-20050708 Fix logging of authenticated user name (cherry picked from commit 85d429528bfba3e909d9614320fbaad84473dfe3) --- diff --git a/src/audit/audit.c b/src/audit/audit.c index 11476ed64..99533f43e 100644 --- a/src/audit/audit.c +++ b/src/audit/audit.c @@ -63,6 +63,8 @@ audmakebuf(char *audEvent, va_list vaList) while (vaEntry != AUD_END) { switch (vaEntry) { case AUD_STR: /* String */ + case AUD_NAME: /* Name */ + case AUD_ACL: /* ACL */ vaStr = (char *)va_arg(vaList, int); if (vaStr) { strcpy(bufferPtr, vaStr); @@ -73,6 +75,7 @@ audmakebuf(char *audEvent, va_list vaList) } break; case AUD_INT: /* Integer */ + case AUD_ID: /* ViceId */ vaInt = va_arg(vaList, int); *(int *)bufferPtr = vaInt; bufferPtr += sizeof(vaInt); @@ -144,13 +147,14 @@ printbuf(FILE *out, int rec, char *audEvent, afs_int32 errCode, va_list vaList) struct AFSFid *vaFid; struct AFSCBFids *vaFids; int num = LogThreadNum(); + struct in_addr hostAddr; /* Don't print the thread id if we recursed */ if ((num > -1) && (rec == 0)) fprintf(out, "[%d]:", num); if (strcmp(audEvent, "VALST") != 0) - fprintf(out, "%s %d ", audEvent, errCode); + fprintf(out, "EVENT %s CODE %d ", audEvent, errCode); vaEntry = va_arg(vaList, int); while (vaEntry != AUD_END) { @@ -158,22 +162,44 @@ printbuf(FILE *out, int rec, char *audEvent, afs_int32 errCode, va_list vaList) case AUD_STR: /* String */ vaStr = (char *)va_arg(vaList, int); if (vaStr) - fprintf(out, "%s ", vaStr); + fprintf(out, "STR %s ", vaStr); else - fprintf(out, ""); + fprintf(out, "STR "); + break; + case AUD_NAME: /* Name */ + vaStr = (char *)va_arg(vaList, int); + if (vaStr) + fprintf(out, "NAME %s ", vaStr); + else + fprintf(out, "NAME "); + break; + case AUD_ACL: /* ACL */ + vaStr = (char *)va_arg(vaList, int); + if (vaStr) + fprintf(out, "ACL %s ", vaStr); + else + fprintf(out, "ACL "); break; case AUD_INT: /* Integer */ vaInt = va_arg(vaList, int); - fprintf(out, "%d ", vaInt); + fprintf(out, "INT %d ", vaInt); + break; + case AUD_ID: /* ViceId */ + vaInt = va_arg(vaList, int); + fprintf(out, "ID %d ", vaInt); break; case AUD_DATE: /* Date */ + vaLong = va_arg(vaList, afs_int32); + fprintf(out, "DATE %u ", vaLong); + break; case AUD_HOST: /* Host ID */ vaLong = va_arg(vaList, afs_int32); - fprintf(out, "%u ", vaLong); + hostAddr.s_addr = vaLong; + fprintf(out, "HOST %s ", inet_ntoa(hostAddr)); break; case AUD_LONG: /* afs_int32 */ vaLong = va_arg(vaList, afs_int32); - fprintf(out, "%d ", vaLong); + fprintf(out, "LONG %d ", vaLong); break; case AUD_LST: /* Ptr to another list */ vaLst = (char *)va_arg(vaList, int); @@ -182,22 +208,32 @@ printbuf(FILE *out, int rec, char *audEvent, afs_int32 errCode, va_list vaList) case AUD_FID: /* AFSFid - contains 3 entries */ vaFid = (struct AFSFid *)va_arg(vaList, int); if (vaFid) - fprintf(out, "%u:%u:%u ", vaFid->Volume, vaFid->Vnode, + fprintf(out, "FID %u:%u:%u ", vaFid->Volume, vaFid->Vnode, vaFid->Unique); else - fprintf(out, "%u:%u:%u ", 0, 0, 0); + fprintf(out, "FID %u:%u:%u ", 0, 0, 0); break; case AUD_FIDS: /* array of Fids */ vaFids = (struct AFSCBFids *)va_arg(vaList, int); vaFid = NULL; - if (vaFids) - vaFid = vaFids->AFSCBFids_val; - if (vaFid) - fprintf(out, "%u %u:%u:%u ", vaFids->AFSCBFids_len, vaFid->Volume, - vaFid->Vnode, vaFid->Unique); - else - fprintf(out, "0 0:0:0 "); + if (vaFids) { + int i; + if (vaFid) + fprintf(out, "FIDS %u FID %u:%u:%u ", vaFids->AFSCBFids_len, vaFid->Volume, + vaFid->Vnode, vaFid->Unique); + else + fprintf(out, "FIDS 0 FID 0:0:0 "); + + for ( i = 1; i < vaFids->AFSCBFids_len; i++ ) { + vaFid = vaFids->AFSCBFids_val; + if (vaFid) + fprintf(out, "FID %u:%u:%u ", vaFid->Volume, + vaFid->Vnode, vaFid->Unique); + else + fprintf(out, "FID 0:0:0 "); + } + } break; default: fprintf(out, "--badval-- "); @@ -331,7 +367,7 @@ osi_auditU(struct rx_call *call, char *audEvent, int errCode, ...) if (call) { conn = rx_ConnectionOf(call); /* call -> conn) */ if (conn) { - secClass = rx_SecurityClassOf(conn); /* conn -> securityIndex */ + secClass = rx_SecurityClassOf(conn); /* conn -> securityIndex */ if (secClass == 0) { /* unauthenticated */ osi_audit("AFS_Aud_Unauth", (-1), AUD_STR, audEvent, AUD_END); strcpy(afsName, "--UnAuth--"); @@ -346,8 +382,7 @@ osi_auditU(struct rx_call *call, char *audEvent, int errCode, ...) rxkad_GetServerInfo(conn, NULL, NULL, name, inst, tcell, NULL); if (code) { - osi_audit("AFS_Aud_NoAFSId", (-1), AUD_STR, audEvent, - AUD_END); + osi_audit("AFS_Aud_NoAFSId", (-1), AUD_STR, audEvent, AUD_END); strcpy(afsName, "--NoName--"); } else { strncpy(vname, name, sizeof(vname)); @@ -358,7 +393,7 @@ osi_auditU(struct rx_call *call, char *audEvent, int errCode, ...) strcat(vname, inst); } if ((clen = strlen(tcell))) { -#if defined(AFS_ATHENA_STDENV) || defined(AFS_KERBREALM_ENV) +#if defined(AFS_ATHENA_STDENV) || defined(AFS_KERBREALM_ENV) static char local_realm[AFS_REALM_SZ] = ""; if (!local_realm[0]) { if (afs_krb_get_lrealm(local_realm, 0) != 0 /*KSUCCESS*/) @@ -371,13 +406,12 @@ osi_auditU(struct rx_call *call, char *audEvent, int errCode, ...) strcat(vname, tcell); } #endif - strcpy(afsName, vname); } + strcpy(afsName, vname); } } else { /* Unauthenticated & unknown */ - - osi_audit("AFS_Aud_UnknSec", (-1), AUD_STR, audEvent, - AUD_END); + osi_audit("AFS_Aud_UnknSec", (-1), AUD_STR, audEvent, AUD_END); + strcpy(afsName, "--Unknown--"); } done: peer = rx_PeerOf(conn); /* conn -> peer */ @@ -386,17 +420,14 @@ osi_auditU(struct rx_call *call, char *audEvent, int errCode, ...) else osi_audit("AFS_Aud_NoHost", (-1), AUD_STR, audEvent, AUD_END); } else { /* null conn */ - osi_audit("AFS_Aud_NoConn", (-1), AUD_STR, audEvent, AUD_END); } } else { /* null call */ - osi_audit("AFS_Aud_NoCall", (-1), AUD_STR, audEvent, AUD_END); } - va_start(vaList, errCode); - osi_audit(audEvent, errCode, AUD_STR, afsName, AUD_HOST, hostId, AUD_LST, - vaList, AUD_END); + osi_audit(audEvent, errCode, AUD_NAME, afsName, AUD_HOST, hostId, + AUD_LST, vaList, AUD_END); return 0; } diff --git a/src/audit/audit.h b/src/audit/audit.h index af318ee9e..1c51ff3fa 100644 --- a/src/audit/audit.h +++ b/src/audit/audit.h @@ -7,7 +7,7 @@ * directory or online at http://www.openafs.org/dl/license10.html */ -#define AUD_END 0 /* End of veriable list */ +#define AUD_END 0 /* End of variable list */ #define AUD_STR 1 /* String in variable list */ #define AUD_INT 2 /* int in variable list */ #define AUD_LST 3 /* Variable list in a variable list */ @@ -16,6 +16,9 @@ #define AUD_DATE 6 /* date (unsigned long) */ #define AUD_FID 7 /* File ID */ #define AUD_FIDS 8 /* array of Fids */ +#define AUD_NAME 9 /* Name */ +#define AUD_ID 10 /* Id (Vice, PTS, ...) */ +#define AUD_ACL 11 /* ACL */ /* next 3 lines on behalf of MR-AFS */ #define AUD_RESID 20 /* resid in variable list */ #define AUD_RSSIZERANGE 21 /* rssizerange in variable list */ @@ -172,6 +175,7 @@ #define SetLockEvent "AFS_SRX_SetLock" #define ExtendLockEvent "AFS_SRX_ExtLock" #define ReleaseLockEvent "AFS_SRX_RelLock" +#define GetVolumeStatusEvent "AFS_SRX_GetVolS" #define SetVolumeStatusEvent "AFS_SRX_SetVolS" #define FlushCPSEvent "AFS_SRX_FlusCPS" #define InlineBulkFetchStatusEvent "AFS_SRX_BIFchSt" @@ -183,6 +187,8 @@ #define ImportResidenciesEvent "AFS_SRX_Import" #define GetExtendedVolumeAttributesEvent "AFS_SRX_GetVA" #define SetExtendedVolumeAttributesEvent "AFS_SRX_SetVA" +#define GetStatisticsEvent "AFS_SRX_GetStats" +#define XStatsVersionEvent "AFS_SRX_XStatsVer" #define NoAuthEvent "AFS_RunNoAuth" #define NoAuthDisableEvent "AFS_NoAuthDsbl" diff --git a/src/ptserver/ptprocs.c b/src/ptserver/ptprocs.c index 7c22da929..57b570524 100644 --- a/src/ptserver/ptprocs.c +++ b/src/ptserver/ptprocs.c @@ -232,8 +232,8 @@ SPR_INewEntry(call, aname, aid, oid) afs_int32 cid = ANONYMOUSID; code = iNewEntry(call, aname, aid, oid, &cid); - osi_auditU(call, PTS_INewEntEvent, code, AUD_LONG, aid, AUD_STR, aname, - AUD_LONG, oid, AUD_END); + osi_auditU(call, PTS_INewEntEvent, code, AUD_ID, aid, AUD_STR, aname, + AUD_ID, oid, AUD_END); ViceLog(25, ("PTS_INewEntry: code %d cid %d aid %d aname %s oid %d", code, cid, aid, aname, oid)); return code; } @@ -312,8 +312,8 @@ SPR_NewEntry(call, aname, flag, oid, aid) afs_int32 cid = ANONYMOUSID; code = newEntry(call, aname, flag, oid, aid, &cid); - osi_auditU(call, PTS_NewEntEvent, code, AUD_LONG, *aid, AUD_STR, aname, - AUD_LONG, oid, AUD_END); + osi_auditU(call, PTS_NewEntEvent, code, AUD_ID, *aid, AUD_STR, aname, + AUD_ID, oid, AUD_END); ViceLog(25, ("PTS_NewEntry: code %d cid %d aid %d aname %s oid %d", code, cid, *aid, aname, oid)); return code; } @@ -384,7 +384,7 @@ SPR_WhereIsIt(call, aid, apos) afs_int32 cid = ANONYMOUSID; code = whereIsIt(call, aid, apos, &cid); - osi_auditU(call, PTS_WheIsItEvent, code, AUD_LONG, aid, AUD_LONG, *apos, + osi_auditU(call, PTS_WheIsItEvent, code, AUD_ID, aid, AUD_LONG, *apos, AUD_END); ViceLog(125, ("PTS_WhereIsIt: code %d cid %d aid %d apos %d", code, cid, aid, *apos)); return code; @@ -502,7 +502,7 @@ SPR_AddToGroup(call, aid, gid) afs_int32 cid = ANONYMOUSID; code = addToGroup(call, aid, gid, &cid); - osi_auditU(call, PTS_AdToGrpEvent, code, AUD_LONG, gid, AUD_LONG, aid, + osi_auditU(call, PTS_AdToGrpEvent, code, AUD_ID, gid, AUD_ID, aid, AUD_END); ViceLog(5, ("PTS_AddToGroup: code %d cid %d gid %d aid %d", code, cid, gid, aid)); return code; @@ -597,7 +597,7 @@ SPR_NameToID(call, aname, aid) code = nameToID(call, aname, aid); osi_auditU(call, PTS_NmToIdEvent, code, AUD_END); - ViceLog(125, ("PTS_NameToID: code %d aname %s aid %d", code, aname, aid)); + ViceLog(125, ("PTS_NameToID: code %d", code)); return code; } @@ -644,6 +644,11 @@ nameToID(call, aname, aid) code = NameToID(tt, aname->namelist_val[i], &aid->idlist_val[i]); if (code != PRSUCCESS) aid->idlist_val[i] = ANONYMOUSID; + osi_audit(PTS_NmToIdEvent, code, AUD_STR, + aname->namelist_val[i], AUD_ID, aid->idlist_val[i], + AUD_END); + ViceLog(125, ("PTS_NameToID: code %d aname %s aid %d", code, + aname->namelist_val[i], aid->idlist_val[i])); if (count++ > 50) IOMGR_Poll(), count = 0; } @@ -669,8 +674,8 @@ SPR_IDToName(call, aid, aname) afs_int32 code; code = idToName(call, aid, aname); - osi_auditU(call, PTS_IdToNmEvent, code, AUD_LONG, aid, AUD_END); - ViceLog(125, ("PTS_IDToName: code %d aid %d aname %s", code, aid, aname)); + osi_auditU(call, PTS_IdToNmEvent, code, AUD_END); + ViceLog(125, ("PTS_IDToName: code %d", code)); return code; } @@ -718,6 +723,10 @@ idToName(call, aid, aname) code = IDToName(tt, aid->idlist_val[i], aname->namelist_val[i]); if (code != PRSUCCESS) sprintf(aname->namelist_val[i], "%d", aid->idlist_val[i]); + osi_audit(PTS_IdToNmEvent, code, AUD_ID, aid->idlist_val[i], + AUD_STR, aname->namelist_val[i], AUD_END); + ViceLog(125, ("PTS_idToName: code %d aid %d aname %s", code, + aid->idlist_val[i], aname->namelist_val[i])); if (count++ > 50) IOMGR_Poll(), count = 0; } @@ -738,7 +747,7 @@ SPR_Delete(call, aid) afs_int32 cid = ANONYMOUSID; code = Delete(call, aid, &cid); - osi_auditU(call, PTS_DelEvent, code, AUD_LONG, aid, AUD_END); + osi_auditU(call, PTS_DelEvent, code, AUD_ID, aid, AUD_END); ViceLog(25, ("PTS_Delete: code %d cid %d aid %d", code, cid, aid)); return code; } @@ -980,7 +989,7 @@ SPR_UpdateEntry(call, aid, name, uentry) afs_int32 cid = ANONYMOUSID; code = UpdateEntry(call, aid, name, uentry, &cid); - osi_auditU(call, PTS_UpdEntEvent, code, AUD_LONG, aid, AUD_STR, name, AUD_END); + osi_auditU(call, PTS_UpdEntEvent, code, AUD_ID, aid, AUD_STR, name, AUD_END); ViceLog(5, ("PTS_UpdateEntry: code %d cid %d aid %d name %s", code, cid, aid, name)); return code; } @@ -1077,7 +1086,7 @@ SPR_RemoveFromGroup(call, aid, gid) afs_int32 cid = ANONYMOUSID; code = removeFromGroup(call, aid, gid, &cid); - osi_auditU(call, PTS_RmFmGrpEvent, code, AUD_LONG, gid, AUD_LONG, aid, + osi_auditU(call, PTS_RmFmGrpEvent, code, AUD_ID, gid, AUD_ID, aid, AUD_END); ViceLog(5, ("PTS_RemoveFromGroup: code %d cid %d gid %d aid %d", code, cid, gid, aid)); return code; @@ -1167,7 +1176,7 @@ SPR_GetCPS(call, aid, alist, over) afs_int32 cid = ANONYMOUSID; code = getCPS(call, aid, alist, over, &cid); - osi_auditU(call, PTS_GetCPSEvent, code, AUD_LONG, aid, AUD_END); + osi_auditU(call, PTS_GetCPSEvent, code, AUD_ID, aid, AUD_END); ViceLog(125, ("PTS_GetCPS: code %d cid %d aid %d", code, cid, aid)); return code; } @@ -1255,7 +1264,7 @@ SPR_GetCPS2(call, aid, ahost, alist, over) afs_int32 cid = ANONYMOUSID; code = getCPS2(call, aid, ahost, alist, over, &cid); - osi_auditU(call, PTS_GetCPS2Event, code, AUD_LONG, aid, AUD_HOST, ahost, + osi_auditU(call, PTS_GetCPS2Event, code, AUD_ID, aid, AUD_HOST, ahost, AUD_END); ViceLog(125, ("PTS_GetCPS2: code %d cid %d aid %d ahost %d", code, cid, aid, ahost)); return code; @@ -1471,7 +1480,7 @@ SPR_SetMax(call, aid, gflag) afs_int32 cid = ANONYMOUSID; code = setMax(call, aid, gflag, &cid); - osi_auditU(call, PTS_SetMaxEvent, code, AUD_LONG, aid, AUD_LONG, gflag, + osi_auditU(call, PTS_SetMaxEvent, code, AUD_ID, aid, AUD_LONG, gflag, AUD_END); ViceLog(125, ("PTS_SetMax: code %d cid %d aid %d gflag %d", code, cid, aid, gflag)); return code; @@ -1528,7 +1537,7 @@ SPR_ListEntry(call, aid, aentry) afs_int32 cid = ANONYMOUSID; code = listEntry(call, aid, aentry, &cid); - osi_auditU(call, PTS_LstEntEvent, code, AUD_LONG, aid, AUD_END); + osi_auditU(call, PTS_LstEntEvent, code, AUD_ID, aid, AUD_END); ViceLog(125, ("PTS_ListEntry: code %d cid %d aid %d", code, cid, aid)); return code; } @@ -1748,7 +1757,7 @@ SPR_ChangeEntry(call, aid, name, oid, newid) afs_int32 cid = ANONYMOUSID; code = changeEntry(call, aid, name, oid, newid, &cid); - osi_auditU(call, PTS_ChgEntEvent, code, AUD_LONG, aid, AUD_STR, name, + osi_auditU(call, PTS_ChgEntEvent, code, AUD_ID, aid, AUD_STR, name, AUD_LONG, oid, AUD_LONG, newid, AUD_END); ViceLog(5, ("PTS_ChangeEntry: code %d cid %d aid %d name %s oid %d newid %d", code, cid, aid, name, oid, newid)); return code; @@ -1818,7 +1827,7 @@ SPR_SetFieldsEntry(call, id, mask, flags, ngroups, nusers, spare1, spare2) code = setFieldsEntry(call, id, mask, flags, ngroups, nusers, spare1, spare2, &cid); - osi_auditU(call, PTS_SetFldEntEvent, code, AUD_LONG, id, AUD_END); + osi_auditU(call, PTS_SetFldEntEvent, code, AUD_ID, id, AUD_END); ViceLog(5, ("PTS_SetFieldsEntry: code %d cid %d id %d", code, cid, id)); return code; } @@ -1920,7 +1929,7 @@ SPR_ListElements(call, aid, alist, over) afs_int32 cid = ANONYMOUSID; code = listElements(call, aid, alist, over, &cid); - osi_auditU(call, PTS_LstEleEvent, code, AUD_LONG, aid, AUD_END); + osi_auditU(call, PTS_LstEleEvent, code, AUD_ID, aid, AUD_END); ViceLog(125, ("PTS_ListElements: code %d cid %d aid %d", code, cid, aid)); return code; } @@ -1989,7 +1998,7 @@ SPR_ListSuperGroups(call, aid, alist, over) afs_int32 cid = ANONYMOUSID; code = listSuperGroups(call, aid, alist, over, &cid); - osi_auditU(call, "PTS_LstSGrps", code, AUD_LONG, aid, AUD_END); + osi_auditU(call, PTS_LstSGrps, code, AUD_ID, aid, AUD_END); ViceLog(125, ("PTS_ListSuperGroups: code %d cid %d aid %d", code, cid, aid)); return code; #else @@ -2069,7 +2078,7 @@ SPR_ListOwned(call, aid, alist, lastP) afs_int32 cid = ANONYMOUSID; code = listOwned(call, aid, alist, lastP, &cid); - osi_auditU(call, PTS_LstOwnEvent, code, AUD_LONG, aid, AUD_END); + osi_auditU(call, PTS_LstOwnEvent, code, AUD_ID, aid, AUD_END); ViceLog(125, ("PTS_ListOwned: code %d cid %d aid %d", code, cid, aid)); return code; } diff --git a/src/viced/afsfileprocs.c b/src/viced/afsfileprocs.c index 6dfb139aa..4259a5d94 100644 --- a/src/viced/afsfileprocs.c +++ b/src/viced/afsfileprocs.c @@ -814,7 +814,7 @@ Check_PermissionRights(Vnode * targetptr, struct client *client, #endif } else { /* !VanillaUser(client) && !FetchData */ - osi_audit(PrivilegeEvent, 0, AUD_INT, + osi_audit(PrivilegeEvent, 0, AUD_ID, (client ? client->ViceId : 0), AUD_INT, CallingRoutine, AUD_END); } @@ -832,13 +832,13 @@ Check_PermissionRights(Vnode * targetptr, struct client *client, else if (VanillaUser(client)) return (EPERM); /* Was EACCES */ else - osi_audit(PrivilegeEvent, 0, AUD_INT, + osi_audit(PrivilegeEvent, 0, AUD_ID, (client ? client->ViceId : 0), AUD_INT, CallingRoutine, AUD_END); } } else { if (CallingRoutine != CHK_STOREDATA && !VanillaUser(client)) { - osi_audit(PrivilegeEvent, 0, AUD_INT, + osi_audit(PrivilegeEvent, 0, AUD_ID, (client ? client->ViceId : 0), AUD_INT, CallingRoutine, AUD_END); } else { @@ -858,7 +858,7 @@ Check_PermissionRights(Vnode * targetptr, struct client *client, else if (VanillaUser(client)) return (EPERM); /* Was EACCES */ else - osi_audit(PrivilegeEvent, 0, AUD_INT, + osi_audit(PrivilegeEvent, 0, AUD_ID, (client ? client->ViceId : 0), AUD_INT, CallingRoutine, AUD_END); } @@ -874,7 +874,7 @@ Check_PermissionRights(Vnode * targetptr, struct client *client, if (VanillaUser(client)) return (EACCES); else - osi_audit(PrivSetID, 0, AUD_INT, + osi_audit(PrivSetID, 0, AUD_ID, (client ? client->ViceId : 0), AUD_INT, CallingRoutine, AUD_END); } @@ -914,7 +914,7 @@ Check_PermissionRights(Vnode * targetptr, struct client *client, if (VanillaUser(client)) return (EACCES); else - osi_audit(PrivilegeEvent, 0, AUD_INT, + osi_audit(PrivilegeEvent, 0, AUD_ID, (client ? client->ViceId : 0), AUD_INT, CallingRoutine, AUD_END); } @@ -1502,12 +1502,12 @@ Update_TargetVnodeStatus(Vnode * targetptr, afs_uint32 Caller, targetptr->disk.modeBits = modebits; switch (Caller) { case TVS_SDATA: - osi_audit(PrivSetID, 0, AUD_INT, client->ViceId, AUD_INT, + osi_audit(PrivSetID, 0, AUD_ID, client->ViceId, AUD_INT, CHK_STOREDATA, AUD_END); break; case TVS_CFILE: case TVS_SSTATUS: - osi_audit(PrivSetID, 0, AUD_INT, client->ViceId, AUD_INT, + osi_audit(PrivSetID, 0, AUD_ID, client->ViceId, AUD_INT, CHK_STORESTATUS, AUD_END); break; default: @@ -2081,7 +2081,7 @@ common_FetchData64(struct rx_call *acall, struct AFSFid *Fid, struct client *client; /* pointer to the client data */ struct rx_connection *tcon; /* the connection we're part of */ afs_int32 rights, anyrights; /* rights for this and any user */ - struct client *t_client; /* tmp ptr to client data */ + struct client *t_client = NULL; /* tmp ptr to client data */ struct in_addr logHostAddr; /* host ip holder for inet_ntoa */ #if FS_STATS_DETAILED struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */ @@ -2288,7 +2288,9 @@ common_FetchData64(struct rx_call *acall, struct AFSFid *Fid, } #endif /* FS_STATS_DETAILED */ - osi_auditU(acall, FetchDataEvent, errorCode, AUD_FID, Fid, AUD_END); + osi_auditU(acall, FetchDataEvent, errorCode, + AUD_ID, t_client ? t_client->ViceId : 0, + AUD_FID, Fid, AUD_END); return (errorCode); } /*SRXAFS_FetchData */ @@ -2298,12 +2300,8 @@ SRXAFS_FetchData(struct rx_call * acall, struct AFSFid * Fid, afs_int32 Pos, afs_int32 Len, struct AFSFetchStatus * OutStatus, struct AFSCallBack * CallBack, struct AFSVolSync * Sync) { - int code; - - code = - common_FetchData64(acall, Fid, Pos, Len, OutStatus, CallBack, Sync, - 0); - return code; + return common_FetchData64(acall, Fid, Pos, Len, OutStatus, CallBack, + Sync, 0); } afs_int32 @@ -2346,7 +2344,7 @@ SRXAFS_FetchACL(struct rx_call * acall, struct AFSFid * Fid, struct client *client; /* pointer to the client data */ afs_int32 rights, anyrights; /* rights for this and any user */ struct rx_connection *tcon = rx_ConnectionOf(acall); - struct client *t_client; /* tmp ptr to client data */ + struct client *t_client = NULL; /* tmp ptr to client data */ struct in_addr logHostAddr; /* host ip holder for inet_ntoa */ #if FS_STATS_DETAILED struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */ @@ -2441,7 +2439,9 @@ SRXAFS_FetchACL(struct rx_call * acall, struct AFSFid * Fid, } #endif /* FS_STATS_DETAILED */ - osi_auditU(acall, FetchACLEvent, errorCode, AUD_FID, Fid, AUD_END); + osi_auditU(acall, FetchACLEvent, errorCode, + AUD_ID, t_client ? t_client->ViceId : 0, + AUD_FID, Fid, AUD_END); return errorCode; } /*SRXAFS_FetchACL */ @@ -2462,7 +2462,7 @@ SAFSS_FetchStatus(struct rx_call *acall, struct AFSFid *Fid, Volume *volptr = 0; /* pointer to the volume */ struct client *client; /* pointer to the client data */ afs_int32 rights, anyrights; /* rights for this and any user */ - struct client *t_client; /* tmp ptr to client data */ + struct client *t_client = NULL; /* tmp ptr to client data */ struct in_addr logHostAddr; /* host ip holder for inet_ntoa */ struct rx_connection *tcon = rx_ConnectionOf(acall); @@ -2539,6 +2539,7 @@ SRXAFS_BulkStatus(struct rx_call * acall, struct AFSCBFids * Fids, afs_int32 rights, anyrights; /* rights for this and any user */ register struct AFSFid *tfid; /* file id we're dealing with now */ struct rx_connection *tcon = rx_ConnectionOf(acall); + struct client *t_client = NULL; /* tmp pointer to the client data */ #if FS_STATS_DETAILED struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */ struct timeval opStartTime, opStopTime; /* Start/stop times for RPC op */ @@ -2640,6 +2641,8 @@ SRXAFS_BulkStatus(struct rx_call * acall, struct AFSCBFids * Fids, volptr); errorCode = CallPostamble(tcon, errorCode); + t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key); + #if FS_STATS_DETAILED TM_GetTimeOfDay(&opStopTime, 0); if (errorCode == 0) { @@ -2660,8 +2663,9 @@ SRXAFS_BulkStatus(struct rx_call * acall, struct AFSCBFids * Fids, Audit_and_Return: ViceLog(2, ("SAFS_BulkStatus returns %d\n", errorCode)); - osi_auditU(acall, BulkFetchStatusEvent, errorCode, AUD_FIDS, Fids, - AUD_END); + osi_auditU(acall, BulkFetchStatusEvent, errorCode, + AUD_ID, t_client ? t_client->ViceId : 0, + AUD_FIDS, Fids, AUD_END); return errorCode; } /*SRXAFS_BulkStatus */ @@ -2682,6 +2686,7 @@ SRXAFS_InlineBulkStatus(struct rx_call * acall, struct AFSCBFids * Fids, afs_int32 rights, anyrights; /* rights for this and any user */ register struct AFSFid *tfid; /* file id we're dealing with now */ struct rx_connection *tcon; + struct client *t_client = NULL; /* tmp ptr to client data */ AFSFetchStatus *tstatus; #if FS_STATS_DETAILED struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */ @@ -2799,6 +2804,8 @@ SRXAFS_InlineBulkStatus(struct rx_call * acall, struct AFSCBFids * Fids, volptr); errorCode = CallPostamble(tcon, errorCode); + t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key); + #if FS_STATS_DETAILED TM_GetTimeOfDay(&opStopTime, 0); if (errorCode == 0) { @@ -2819,8 +2826,9 @@ SRXAFS_InlineBulkStatus(struct rx_call * acall, struct AFSCBFids * Fids, Audit_and_Return: ViceLog(2, ("SAFS_InlineBulkStatus returns %d\n", errorCode)); - osi_auditU(acall, InlineBulkFetchStatusEvent, errorCode, AUD_FIDS, Fids, - AUD_END); + osi_auditU(acall, InlineBulkFetchStatusEvent, errorCode, + AUD_ID, t_client ? t_client->ViceId : 0, + AUD_FIDS, Fids, AUD_END); return 0; } /*SRXAFS_InlineBulkStatus */ @@ -2833,6 +2841,7 @@ SRXAFS_FetchStatus(struct rx_call * acall, struct AFSFid * Fid, { afs_int32 code; struct rx_connection *tcon; + struct client *t_client = NULL; /* tmp ptr to client data */ #if FS_STATS_DETAILED struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */ struct timeval opStartTime, opStopTime; /* Start/stop times for RPC op */ @@ -2857,6 +2866,8 @@ SRXAFS_FetchStatus(struct rx_call * acall, struct AFSFid * Fid, Bad_FetchStatus: code = CallPostamble(tcon, code); + t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key); + #if FS_STATS_DETAILED TM_GetTimeOfDay(&opStopTime, 0); if (code == 0) { @@ -2875,7 +2886,9 @@ SRXAFS_FetchStatus(struct rx_call * acall, struct AFSFid * Fid, } #endif /* FS_STATS_DETAILED */ - osi_auditU(acall, FetchStatusEvent, code, AUD_FID, Fid, AUD_END); + osi_auditU(acall, FetchStatusEvent, code, + AUD_ID, t_client ? t_client->ViceId : 0, + AUD_FID, Fid, AUD_END); return code; } /*SRXAFS_FetchStatus */ @@ -2895,7 +2908,7 @@ common_StoreData64(struct rx_call *acall, struct AFSFid *Fid, Volume *volptr = 0; /* pointer to the volume header */ struct client *client; /* pointer to client structure */ afs_int32 rights, anyrights; /* rights for this and any user */ - struct client *t_client; /* tmp ptr to client data */ + struct client *t_client = NULL; /* tmp ptr to client data */ struct in_addr logHostAddr; /* host ip holder for inet_ntoa */ struct rx_connection *tcon; #if FS_STATS_DETAILED @@ -3094,10 +3107,10 @@ common_StoreData64(struct rx_call *acall, struct AFSFid *Fid, FS_UNLOCK; } #endif /* FS_STATS_DETAILED */ - - osi_auditU(acall, StoreDataEvent, errorCode, AUD_FID, Fid, AUD_END); + osi_auditU(acall, StoreDataEvent, errorCode, + AUD_ID, t_client ? t_client->ViceId : 0, + AUD_FID, Fid, AUD_END); return (errorCode); - } /*common_StoreData64 */ afs_int32 @@ -3106,13 +3119,8 @@ SRXAFS_StoreData(struct rx_call * acall, struct AFSFid * Fid, afs_uint32 Length, afs_uint32 FileLength, struct AFSFetchStatus * OutStatus, struct AFSVolSync * Sync) { - int code; - - code = - common_StoreData64(acall, Fid, InStatus, Pos, Length, FileLength, - OutStatus, Sync); - return code; - + return common_StoreData64(acall, Fid, InStatus, Pos, Length, FileLength, + OutStatus, Sync); } /*SRXAFS_StoreData */ afs_int32 @@ -3162,7 +3170,7 @@ SRXAFS_StoreACL(struct rx_call * acall, struct AFSFid * Fid, struct client *client; /* pointer to client structure */ afs_int32 rights, anyrights; /* rights for this and any user */ struct rx_connection *tcon; - struct client *t_client; /* tmp ptr to client data */ + struct client *t_client = NULL; /* tmp ptr to client data */ struct in_addr logHostAddr; /* host ip holder for inet_ntoa */ #if FS_STATS_DETAILED struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */ @@ -3256,7 +3264,9 @@ SRXAFS_StoreACL(struct rx_call * acall, struct AFSFid * Fid, } #endif /* FS_STATS_DETAILED */ - osi_auditU(acall, StoreACLEvent, errorCode, AUD_FID, Fid, AUD_END); + osi_auditU(acall, StoreACLEvent, errorCode, + AUD_ID, t_client ? t_client->ViceId : 0, + AUD_FID, Fid, AUD_ACL, AccessList->AFSOpaque_val, AUD_END); return errorCode; } /*SRXAFS_StoreACL */ @@ -3277,7 +3287,7 @@ SAFSS_StoreStatus(struct rx_call *acall, struct AFSFid *Fid, Volume *volptr = 0; /* pointer to the volume header */ struct client *client; /* pointer to client structure */ afs_int32 rights, anyrights; /* rights for this and any user */ - struct client *t_client; /* tmp ptr to client data */ + struct client *t_client = NULL; /* tmp ptr to client data */ struct in_addr logHostAddr; /* host ip holder for inet_ntoa */ struct rx_connection *tcon = rx_ConnectionOf(acall); @@ -3353,6 +3363,7 @@ SRXAFS_StoreStatus(struct rx_call * acall, struct AFSFid * Fid, { afs_int32 code; struct rx_connection *tcon; + struct client *t_client = NULL; /* tmp ptr to client data */ #if FS_STATS_DETAILED struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */ struct timeval opStartTime, opStopTime; /* Start/stop times for RPC op */ @@ -3377,6 +3388,8 @@ SRXAFS_StoreStatus(struct rx_call * acall, struct AFSFid * Fid, Bad_StoreStatus: code = CallPostamble(tcon, code); + t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key); + #if FS_STATS_DETAILED TM_GetTimeOfDay(&opStopTime, 0); if (code == 0) { @@ -3395,7 +3408,9 @@ SRXAFS_StoreStatus(struct rx_call * acall, struct AFSFid * Fid, } #endif /* FS_STATS_DETAILED */ - osi_auditU(acall, StoreStatusEvent, code, AUD_FID, Fid, AUD_END); + osi_auditU(acall, StoreStatusEvent, code, + AUD_ID, t_client ? t_client->ViceId : 0, + AUD_FID, Fid, AUD_END); return code; } /*SRXAFS_StoreStatus */ @@ -3509,6 +3524,7 @@ SRXAFS_RemoveFile(struct rx_call * acall, struct AFSFid * DirFid, char *Name, { afs_int32 code; struct rx_connection *tcon; + struct client *t_client = NULL; /* tmp ptr to client data */ #if FS_STATS_DETAILED struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */ struct timeval opStartTime, opStopTime; /* Start/stop times for RPC op */ @@ -3533,6 +3549,8 @@ SRXAFS_RemoveFile(struct rx_call * acall, struct AFSFid * DirFid, char *Name, Bad_RemoveFile: code = CallPostamble(tcon, code); + t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key); + #if FS_STATS_DETAILED TM_GetTimeOfDay(&opStopTime, 0); if (code == 0) { @@ -3551,8 +3569,9 @@ SRXAFS_RemoveFile(struct rx_call * acall, struct AFSFid * DirFid, char *Name, } #endif /* FS_STATS_DETAILED */ - osi_auditU(acall, RemoveFileEvent, code, AUD_FID, DirFid, AUD_STR, Name, - AUD_END); + osi_auditU(acall, RemoveFileEvent, code, + AUD_ID, t_client ? t_client->ViceId : 0, + AUD_FID, DirFid, AUD_STR, Name, AUD_END); return code; } /*SRXAFS_RemoveFile */ @@ -3671,6 +3690,7 @@ SRXAFS_CreateFile(struct rx_call * acall, struct AFSFid * DirFid, char *Name, { afs_int32 code; struct rx_connection *tcon; + struct client *t_client = NULL; /* tmp ptr to client data */ #if FS_STATS_DETAILED struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */ struct timeval opStartTime, opStopTime; /* Start/stop times for RPC op */ @@ -3697,6 +3717,8 @@ SRXAFS_CreateFile(struct rx_call * acall, struct AFSFid * DirFid, char *Name, Bad_CreateFile: code = CallPostamble(tcon, code); + t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key); + #if FS_STATS_DETAILED TM_GetTimeOfDay(&opStopTime, 0); if (code == 0) { @@ -3715,8 +3737,9 @@ SRXAFS_CreateFile(struct rx_call * acall, struct AFSFid * DirFid, char *Name, } #endif /* FS_STATS_DETAILED */ - osi_auditU(acall, CreateFileEvent, code, AUD_FID, DirFid, AUD_STR, Name, - AUD_END); + osi_auditU(acall, CreateFileEvent, code, + AUD_ID, t_client ? t_client->ViceId : 0, + AUD_FID, DirFid, AUD_STR, Name, AUD_END); return code; } /*SRXAFS_CreateFile */ @@ -4156,6 +4179,7 @@ SRXAFS_Rename(struct rx_call * acall, struct AFSFid * OldDirFid, { afs_int32 code; struct rx_connection *tcon; + struct client *t_client = NULL; /* tmp ptr to client data */ #if FS_STATS_DETAILED struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */ struct timeval opStartTime, opStopTime; /* Start/stop times for RPC op */ @@ -4182,6 +4206,8 @@ SRXAFS_Rename(struct rx_call * acall, struct AFSFid * OldDirFid, Bad_Rename: code = CallPostamble(tcon, code); + t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key); + #if FS_STATS_DETAILED TM_GetTimeOfDay(&opStopTime, 0); if (code == 0) { @@ -4200,8 +4226,10 @@ SRXAFS_Rename(struct rx_call * acall, struct AFSFid * OldDirFid, } #endif /* FS_STATS_DETAILED */ - osi_auditU(acall, RenameFileEvent, code, AUD_FID, OldDirFid, AUD_STR, - OldName, AUD_FID, NewDirFid, AUD_STR, NewName, AUD_END); + osi_auditU(acall, RenameFileEvent, code, + AUD_ID, t_client ? t_client->ViceId : 0, + AUD_FID, OldDirFid, AUD_STR, OldName, + AUD_FID, NewDirFid, AUD_STR, NewName, AUD_END); return code; } /*SRXAFS_Rename */ @@ -4356,6 +4384,7 @@ SRXAFS_Symlink(acall, DirFid, Name, LinkContents, InStatus, OutFid, { afs_int32 code; struct rx_connection *tcon; + struct client *t_client = NULL; /* tmp ptr to client data */ #if FS_STATS_DETAILED struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */ struct timeval opStartTime, opStopTime; /* Start/stop times for RPC op */ @@ -4382,6 +4411,8 @@ SRXAFS_Symlink(acall, DirFid, Name, LinkContents, InStatus, OutFid, Bad_Symlink: code = CallPostamble(tcon, code); + t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key); + #if FS_STATS_DETAILED TM_GetTimeOfDay(&opStopTime, 0); if (code == 0) { @@ -4400,8 +4431,10 @@ SRXAFS_Symlink(acall, DirFid, Name, LinkContents, InStatus, OutFid, } #endif /* FS_STATS_DETAILED */ - osi_auditU(acall, SymlinkEvent, code, AUD_FID, DirFid, AUD_STR, Name, - AUD_END); + osi_auditU(acall, SymlinkEvent, code, + AUD_ID, t_client ? t_client->ViceId : 0, + AUD_FID, DirFid, AUD_STR, Name, + AUD_FID, OutFid, AUD_STR, LinkContents, AUD_END); return code; } /*SRXAFS_Symlink */ @@ -4551,6 +4584,7 @@ SRXAFS_Link(struct rx_call * acall, struct AFSFid * DirFid, char *Name, { afs_int32 code; struct rx_connection *tcon; + struct client *t_client = NULL; /* tmp ptr to client data */ #if FS_STATS_DETAILED struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */ struct timeval opStartTime, opStopTime; /* Start/stop times for RPC op */ @@ -4577,6 +4611,8 @@ SRXAFS_Link(struct rx_call * acall, struct AFSFid * DirFid, char *Name, Bad_Link: code = CallPostamble(tcon, code); + t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key); + #if FS_STATS_DETAILED TM_GetTimeOfDay(&opStopTime, 0); if (code == 0) { @@ -4595,7 +4631,9 @@ SRXAFS_Link(struct rx_call * acall, struct AFSFid * DirFid, char *Name, } #endif /* FS_STATS_DETAILED */ - osi_auditU(acall, LinkEvent, code, AUD_FID, DirFid, AUD_STR, Name, + osi_auditU(acall, LinkEvent, code, + AUD_ID, t_client ? t_client->ViceId : 0, + AUD_FID, DirFid, AUD_STR, Name, AUD_FID, ExistingFid, AUD_END); return code; @@ -4746,6 +4784,7 @@ SRXAFS_MakeDir(struct rx_call * acall, struct AFSFid * DirFid, char *Name, { afs_int32 code; struct rx_connection *tcon; + struct client *t_client = NULL; /* tmp ptr to client data */ #if FS_STATS_DETAILED struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */ struct timeval opStartTime, opStopTime; /* Start/stop times for RPC op */ @@ -4771,6 +4810,8 @@ SRXAFS_MakeDir(struct rx_call * acall, struct AFSFid * DirFid, char *Name, Bad_MakeDir: code = CallPostamble(tcon, code); + t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key); + #if FS_STATS_DETAILED TM_GetTimeOfDay(&opStopTime, 0); if (code == 0) { @@ -4789,8 +4830,10 @@ SRXAFS_MakeDir(struct rx_call * acall, struct AFSFid * DirFid, char *Name, } #endif /* FS_STATS_DETAILED */ - osi_auditU(acall, MakeDirEvent, code, AUD_FID, DirFid, AUD_STR, Name, - AUD_END); + osi_auditU(acall, MakeDirEvent, code, + AUD_ID, t_client ? t_client->ViceId : 0, + AUD_FID, DirFid, AUD_STR, Name, + AUD_FID, OutFid, AUD_END); return code; } /*SRXAFS_MakeDir */ @@ -4903,6 +4946,7 @@ SRXAFS_RemoveDir(struct rx_call * acall, struct AFSFid * DirFid, char *Name, { afs_int32 code; struct rx_connection *tcon; + struct client *t_client = NULL; /* tmp ptr to client data */ #if FS_STATS_DETAILED struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */ struct timeval opStartTime, opStopTime; /* Start/stop times for RPC op */ @@ -4927,6 +4971,8 @@ SRXAFS_RemoveDir(struct rx_call * acall, struct AFSFid * DirFid, char *Name, Bad_RemoveDir: code = CallPostamble(tcon, code); + t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key); + #if FS_STATS_DETAILED TM_GetTimeOfDay(&opStopTime, 0); if (code == 0) { @@ -4945,8 +4991,9 @@ SRXAFS_RemoveDir(struct rx_call * acall, struct AFSFid * DirFid, char *Name, } #endif /* FS_STATS_DETAILED */ - osi_auditU(acall, RemoveDirEvent, code, AUD_FID, DirFid, AUD_STR, Name, - AUD_END); + osi_auditU(acall, RemoveDirEvent, code, + AUD_ID, t_client ? t_client->ViceId : 0, + AUD_FID, DirFid, AUD_STR, Name, AUD_END); return code; } /*SRXAFS_RemoveDir */ @@ -5021,7 +5068,6 @@ SRXAFS_OldSetLock(struct rx_call * acall, struct AFSFid * Fid, ViceLockType type, struct AFSVolSync * Sync) { return SRXAFS_SetLock(acall, Fid, type, Sync); - } /*SRXAFS_OldSetLock */ @@ -5031,6 +5077,7 @@ SRXAFS_SetLock(struct rx_call * acall, struct AFSFid * Fid, ViceLockType type, { afs_int32 code; struct rx_connection *tcon; + struct client *t_client = NULL; /* tmp ptr to client data */ #if FS_STATS_DETAILED struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */ struct timeval opStartTime, opStopTime; /* Start/stop times for RPC op */ @@ -5055,6 +5102,8 @@ SRXAFS_SetLock(struct rx_call * acall, struct AFSFid * Fid, ViceLockType type, Bad_SetLock: code = CallPostamble(tcon, code); + t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key); + #if FS_STATS_DETAILED TM_GetTimeOfDay(&opStopTime, 0); if (code == 0) { @@ -5073,10 +5122,10 @@ SRXAFS_SetLock(struct rx_call * acall, struct AFSFid * Fid, ViceLockType type, } #endif /* FS_STATS_DETAILED */ - osi_auditU(acall, SetLockEvent, code, AUD_FID, Fid, AUD_LONG, type, - AUD_END); + osi_auditU(acall, SetLockEvent, code, + AUD_ID, t_client ? t_client->ViceId : 0, + AUD_FID, Fid, AUD_LONG, type, AUD_END); return code; - } /*SRXAFS_SetLock */ @@ -5144,7 +5193,6 @@ SRXAFS_OldExtendLock(struct rx_call * acall, struct AFSFid * Fid, struct AFSVolSync * Sync) { return SRXAFS_ExtendLock(acall, Fid, Sync); - } /*SRXAFS_OldExtendLock */ @@ -5154,6 +5202,7 @@ SRXAFS_ExtendLock(struct rx_call * acall, struct AFSFid * Fid, { afs_int32 code; struct rx_connection *tcon; + struct client *t_client = NULL; /* tmp ptr to client data */ #if FS_STATS_DETAILED struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */ struct timeval opStartTime, opStopTime; /* Start/stop times for RPC op */ @@ -5178,6 +5227,8 @@ SRXAFS_ExtendLock(struct rx_call * acall, struct AFSFid * Fid, Bad_ExtendLock: code = CallPostamble(tcon, code); + t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key); + #if FS_STATS_DETAILED TM_GetTimeOfDay(&opStopTime, 0); if (code == 0) { @@ -5196,7 +5247,9 @@ SRXAFS_ExtendLock(struct rx_call * acall, struct AFSFid * Fid, } #endif /* FS_STATS_DETAILED */ - osi_auditU(acall, ExtendLockEvent, code, AUD_FID, Fid, AUD_END); + osi_auditU(acall, ExtendLockEvent, code, + AUD_ID, t_client ? t_client->ViceId : 0, + AUD_FID, Fid, AUD_END); return code; } /*SRXAFS_ExtendLock */ @@ -5275,7 +5328,6 @@ SRXAFS_OldReleaseLock(struct rx_call * acall, struct AFSFid * Fid, struct AFSVolSync * Sync) { return SRXAFS_ReleaseLock(acall, Fid, Sync); - } /*SRXAFS_OldReleaseLock */ @@ -5285,6 +5337,7 @@ SRXAFS_ReleaseLock(struct rx_call * acall, struct AFSFid * Fid, { afs_int32 code; struct rx_connection *tcon; + struct client *t_client = NULL; /* tmp ptr to client data */ #if FS_STATS_DETAILED struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */ struct timeval opStartTime, opStopTime; /* Start/stop times for RPC op */ @@ -5309,6 +5362,8 @@ SRXAFS_ReleaseLock(struct rx_call * acall, struct AFSFid * Fid, Bad_ReleaseLock: code = CallPostamble(tcon, code); + t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key); + #if FS_STATS_DETAILED TM_GetTimeOfDay(&opStopTime, 0); if (code == 0) { @@ -5327,7 +5382,9 @@ SRXAFS_ReleaseLock(struct rx_call * acall, struct AFSFid * Fid, } #endif /* FS_STATS_DETAILED */ - osi_auditU(acall, ReleaseLockEvent, code, AUD_FID, Fid, AUD_END); + osi_auditU(acall, ReleaseLockEvent, code, + AUD_ID, t_client ? t_client->ViceId : 0, + AUD_FID, Fid, AUD_END); return code; } /*SRXAFS_ReleaseLock */ @@ -5413,7 +5470,8 @@ afs_int32 SRXAFS_GetStatistics(struct rx_call *acall, struct ViceStatistics *Statistics) { afs_int32 code; - struct rx_connection *tcon; + struct rx_connection *tcon = rx_ConnectionOf(acall); + struct client *t_client = NULL; /* tmp ptr to client data */ #if FS_STATS_DETAILED struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */ struct timeval opStartTime, opStopTime; /* Start/stop times for RPC op */ @@ -5445,6 +5503,8 @@ SRXAFS_GetStatistics(struct rx_call *acall, struct ViceStatistics *Statistics) Bad_GetStatistics: code = CallPostamble(tcon, code); + t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key); + #if FS_STATS_DETAILED TM_GetTimeOfDay(&opStopTime, 0); if (code == 0) { @@ -5463,8 +5523,9 @@ SRXAFS_GetStatistics(struct rx_call *acall, struct ViceStatistics *Statistics) } #endif /* FS_STATS_DETAILED */ + osi_auditU(acall, GetStatisticsEvent, code, + AUD_ID, t_client ? t_client->ViceId : 0, AUD_END); return code; - } /*SRXAFS_GetStatistics */ @@ -5492,6 +5553,8 @@ afs_int32 SRXAFS_XStatsVersion(struct rx_call * a_call, afs_int32 * a_versionP) { /*SRXAFS_XStatsVersion */ + struct client *t_client = NULL; /* tmp ptr to client data */ + struct rx_connection *tcon; #if FS_STATS_DETAILED struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */ struct timeval opStartTime, opStopTime; /* Start/stop times for RPC op */ @@ -5510,6 +5573,8 @@ SRXAFS_XStatsVersion(struct rx_call * a_call, afs_int32 * a_versionP) *a_versionP = AFS_XSTAT_VERSION; + t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key); + #if FS_STATS_DETAILED TM_GetTimeOfDay(&opStopTime, 0); fs_stats_GetDiff(elapsedTime, opStartTime, opStopTime); @@ -5525,8 +5590,10 @@ SRXAFS_XStatsVersion(struct rx_call * a_call, afs_int32 * a_versionP) (opP->numSuccesses)++; FS_UNLOCK; #endif /* FS_STATS_DETAILED */ - return (0); + osi_auditU(a_call, XStatsVersionEvent, 0, + AUD_ID, t_client ? t_client->ViceId : 0, AUD_END); + return (0); } /*SRXAFS_XStatsVersion */ @@ -6232,6 +6299,7 @@ SRXAFS_GetVolumeStatus(struct rx_call * acall, afs_int32 avolid, afs_int32 rights, anyrights; /* rights for this and any user */ AFSFid dummyFid; struct rx_connection *tcon; + struct client *t_client = NULL; /* tmp ptr to client data */ #if FS_STATS_DETAILED struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */ struct timeval opStartTime, opStopTime; /* Start/stop times for RPC op */ @@ -6294,6 +6362,8 @@ SRXAFS_GetVolumeStatus(struct rx_call * acall, afs_int32 avolid, } errorCode = CallPostamble(tcon, errorCode); + t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key); + #if FS_STATS_DETAILED TM_GetTimeOfDay(&opStopTime, 0); if (errorCode == 0) { @@ -6311,6 +6381,10 @@ SRXAFS_GetVolumeStatus(struct rx_call * acall, afs_int32 avolid, FS_UNLOCK; } #endif /* FS_STATS_DETAILED */ + + osi_auditU(acall, GetVolumeStatusEvent, errorCode, + AUD_ID, t_client ? t_client->ViceId : 0, + AUD_LONG, avolid, AUD_STR, *Name, AUD_END); return (errorCode); } /*SRXAFS_GetVolumeStatus */ @@ -6329,6 +6403,7 @@ SRXAFS_SetVolumeStatus(struct rx_call * acall, afs_int32 avolid, afs_int32 rights, anyrights; /* rights for this and any user */ AFSFid dummyFid; struct rx_connection *tcon = rx_ConnectionOf(acall); + struct client *t_client = NULL; /* tmp ptr to client data */ #if FS_STATS_DETAILED struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */ struct timeval opStartTime, opStopTime; /* Start/stop times for RPC op */ @@ -6383,6 +6458,8 @@ SRXAFS_SetVolumeStatus(struct rx_call * acall, afs_int32 avolid, ViceLog(2, ("SAFS_SetVolumeStatus returns %d\n", errorCode)); errorCode = CallPostamble(tcon, errorCode); + t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key); + #if FS_STATS_DETAILED TM_GetTimeOfDay(&opStopTime, 0); if (errorCode == 0) { @@ -6401,10 +6478,10 @@ SRXAFS_SetVolumeStatus(struct rx_call * acall, afs_int32 avolid, } #endif /* FS_STATS_DETAILED */ - osi_auditU(acall, SetVolumeStatusEvent, errorCode, AUD_LONG, avolid, - AUD_STR, Name, AUD_END); + osi_auditU(acall, SetVolumeStatusEvent, errorCode, + AUD_ID, t_client ? t_client->ViceId : 0, + AUD_LONG, avolid, AUD_STR, Name, AUD_END); return (errorCode); - } /*SRXAFS_SetVolumeStatus */ #define DEFAULTVOLUME "root.afs"