Windows: Restrict redir trace buffer to 10240KB
authorJeffrey Altman <jaltman@your-file-system.com>
Wed, 14 May 2014 10:42:40 +0000 (06:42 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Mon, 19 May 2014 18:30:12 +0000 (14:30 -0400)
Define macro AFS_DBG_LOG_MAXLENGTH to 10240 and then use it to
enforce the 10MB trace buffer limit.

Change-Id: I98b759d9f51d24d402bfdc56570c0f0de93926a0
Reviewed-on: http://gerrit.openafs.org/11146
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

src/WINNT/afsrdr/kernel/fs/AFSGeneric.cpp
src/WINNT/afsrdr/kernel/fs/AFSLogSupport.cpp
src/WINNT/afsrdr/kernel/fs/Include/AFSDefines.h

index f607cfc..27503bb 100644 (file)
@@ -417,10 +417,10 @@ AFSReadRegistry( IN PUNICODE_STRING RegistryPath)
             // Let's limit things a bit ...
             //
 
-            if( AFSDbgBufferLength > 10240)
+           if( AFSDbgBufferLength > AFS_DBG_LOG_MAXLENGTH)
             {
 
-                AFSDbgBufferLength = 1024;
+               AFSDbgBufferLength = AFS_DBG_LOG_MAXLENGTH;
             }
         }
         else
index 779c090..bcec8b6 100644 (file)
@@ -361,7 +361,16 @@ AFSConfigureTrace( IN AFSTraceConfigCB *TraceInfo)
                 DbgPrint("AFSConfigureTrace Failed to set debug buffer length in registry Status %08lX\n", ntStatus);
             }
 
-            AFSDbgBufferLength = TraceInfo->TraceBufferLength * 1024;
+           if ( TraceInfo->TraceBufferLength > AFS_DBG_LOG_MAXLENGTH)
+           {
+
+               AFSDbgBufferLength = AFS_DBG_LOG_MAXLENGTH * 1024;
+           }
+           else
+           {
+
+               AFSDbgBufferLength = TraceInfo->TraceBufferLength * 1024;
+           }
 
             ClearFlag( AFSDbgLogFlags, AFS_DBG_LOG_WRAPPED);
 
index fc1f595..c6701b3 100644 (file)
@@ -251,7 +251,7 @@ DEFINE_GUID (GUID_SD_AFS_REDIRECTOR_CONTROL_OBJECT,
 // Debug log length
 //
 
-#define AFS_DBG_LOG_LENGTH              256
+#define AFS_DBG_LOG_MAXLENGTH          10240   //KBs
 
 //
 // Debug log flags