windows-afsd-smb-logging-20090401
authorJeffrey Altman <jaltman@secure-endpoints.com>
Wed, 1 Apr 2009 18:30:29 +0000 (18:30 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Wed, 1 Apr 2009 18:30:29 +0000 (18:30 +0000)
LICENSE MIT

Add more info about the smb request to the log entry
that is written to afsd_init.log if the request took
longer than 45 seconds to complete.

src/WINNT/afsd/smb.c
src/WINNT/afsd/smb3.c

index 3edda81..6264079 100644 (file)
@@ -8390,7 +8390,7 @@ void smb_DispatchPacket(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp,
                 cm_fid_t afid = {0,0,0,0,0};
 
                 uidp = smb_FindUID(vcp, smbp->uid, 0);
-                smb_LookupTIDPath(vcp,((smb_t *)inp)->tid, &treepath);
+                smb_LookupTIDPath(vcp, smbp->tid, &treepath);
                 fidp = smb_FindFID(vcp, inp->fid, 0);
 
                 if (fidp) {
@@ -8404,9 +8404,10 @@ void smb_DispatchPacket(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp,
                         pathname = inp->stringsp->wdata;
                 }
 
-                afsi_log("Request %s duration %d ms user %S tid \"%S\" path? \"%S\" afid (%d.%d.%d.%d)", 
-                          opName, newTime - oldTime,
-                          uidp ? uidp->unp->name : NULL,
+                afsi_log("Request %s duration %d ms user 0x%x \"%S\" pid 0x%x mid 0x%x tid 0x%x \"%S\" path? \"%S\" afid (%d.%d.%d.%d)", 
+                          opName, newTime - oldTime, 
+                          smbp->uid, uidp ? uidp->unp->name : NULL,
+                          smbp->pid, smbp->mid, smbp->tid,
                           treepath,
                           pathname, 
                           afid.cell, afid.volume, afid.vnode, afid.unique);
index a08bca7..955e893 100644 (file)
@@ -2261,9 +2261,10 @@ long smb_ReceiveV3Tran2A(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
                     pathname = inp->stringsp->wdata;
             }
 
-            afsi_log("Request %s duration %d ms user %S tid \"%S\" path? \"%S\" afid (%d.%d.%d.%d)", 
+            afsi_log("Request %s duration %d ms user 0x%x \"%S\" pid 0x%x mid 0x%x tid 0x%x \"%S\" path? \"%S\" afid (%d.%d.%d.%d)", 
                       myCrt_2Dispatch(asp->opcode), newTime - oldTime,
-                      uidp ? uidp->unp->name : NULL,
+                      asp->uid, uidp ? uidp->unp->name : NULL,
+                      asp->pid, asp->mid, asp->tid,
                       treepath,
                       pathname, 
                       afid.cell, afid.volume, afid.vnode, afid.unique);