Browse Source

Minor logging improvements

Tal Aloni 7 years ago
parent
commit
0cad00ad82

+ 3 - 1
SMBLibrary/Server/SMB1/NTCreateHelper.cs

@@ -60,7 +60,9 @@ namespace SMBLibrary.Server.SMB1
                 return new ErrorResponse(request.CommandName);
             }
 
-            state.LogToServer(Severity.Verbose, "Create: Opened '{0}{1}'. (UID: {2}, TID: {3}, FID: {4})", share.Name, path, header.UID, header.TID, fileID.Value);
+            string fileAccessString = fileAccess.ToString().Replace(", ", "|");
+            string shareAccessString = request.ShareAccess.ToString().Replace(", ", "|");
+            state.LogToServer(Severity.Verbose, "Create: Opened '{0}{1}', FileAccess: {2}, ShareAccess: {3}. (UID: {4}, TID: {5}, FID: {6})", share.Name, path, fileAccessString, shareAccessString, header.UID, header.TID, fileID.Value);
             if (share is NamedPipeShare)
             {
                 if (isExtended)

+ 3 - 1
SMBLibrary/Server/SMB2/CreateHelper.cs

@@ -53,7 +53,9 @@ namespace SMBLibrary.Server.SMB2
                 return new ErrorResponse(request.CommandName, NTStatus.STATUS_TOO_MANY_OPENED_FILES);
             }
 
-            state.LogToServer(Severity.Verbose, "Create: Opened '{0}{1}'. (SessionID: {2}, TreeID: {3}, FileId: {4})", share.Name, path, request.Header.SessionID, request.Header.TreeID, fileID.Value.Volatile);
+            string fileAccessString = fileAccess.ToString().Replace(", ", "|");
+            string shareAccessString = request.ShareAccess.ToString().Replace(", ", "|");
+            state.LogToServer(Severity.Verbose, "Create: Opened '{0}{1}', FileAccess: {2}, ShareAccess: {3}. (SessionID: {4}, TreeID: {5}, FileId: {6})", share.Name, path, fileAccessString, shareAccessString, request.Header.SessionID, request.Header.TreeID, fileID.Value.Volatile);
             if (share is NamedPipeShare)
             {
                 return CreateResponseForNamedPipe(fileID.Value, FileStatus.FILE_OPENED);