]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
DEVEL15-windows-afsd-no-more-ods-20090402
authorJeffrey Altman <jaltman@secure-endpoints.com>
Fri, 3 Apr 2009 03:57:13 +0000 (03:57 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Fri, 3 Apr 2009 03:57:13 +0000 (03:57 +0000)
LICENSE MIT

Any use of OutputDebugString() in production can result in serious
delays in the execution of the thread that issues the call.  Remove
the last of the unprotected calls within afsd_service.

(cherry picked from commit f6b4902daeb731eb01de44464476cb0a3edb26b1)

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

index f23c2d61fa3afc81daa77cca81bde34d3b220961..28098398760ee38252c51a81132f929ab94ded3c 100644 (file)
@@ -10083,13 +10083,12 @@ void smb_Init(osi_log_t *logp, int useV3, int nThreads, void *aMBfunc)
                                                     );
 
                 if (nts != STATUS_SUCCESS && ntsEx != STATUS_SUCCESS) {
-                    char message[AFSPATHMAX];
-                    sprintf(message,"MsV1_0SetProcessOption failure: nts 0x%x ntsEx 0x%x",
-                                       nts, ntsEx);
-                    OutputDebugString(message);
-                    afsi_log(message);
+                    osi_Log2(smb_logp, "MsV1_0SetProcessOption failure: nts 0x%x ntsEx 0x%x",
+                             nts, ntsEx);
+
+                    afsi_log("MsV1_0SetProcessOption failure: nts 0x%x ntsEx 0x%x", nts, ntsEx);
                 } else {
-                    OutputDebugString("MsV1_0SetProcessOption success");
+                    osi_Log0(smb_logp, "MsV1_0SetProcessOption success");
                     afsi_log("MsV1_0SetProcessOption success");
                 }
                 /* END - code from Larry */
index 955e893a3cdc04ac590c8e318922a5ca28c02278..39cc6acf632f1ce1c2d6fd6831d26ac835aaee00 100644 (file)
@@ -144,8 +144,6 @@ void OutputDebugF(clientchar_t * format, ...) {
     va_start( args, format );
     cm_ClientStrPrintfV(vbuffer, lengthof(vbuffer), format, args);
     osi_Log1(smb_logp, "%S", osi_LogSaveClientString(smb_logp, vbuffer));
-    cm_ClientStrCat(vbuffer, lengthof(vbuffer), _C("\n"));
-    OutputDebugStringW(vbuffer);
 }
 
 void OutputDebugHexDump(unsigned char * buffer, int len) {
@@ -159,8 +157,6 @@ void OutputDebugHexDump(unsigned char * buffer, int len) {
         if(!(i%16)) {
             if(i) {
                 osi_Log1(smb_logp, "%s", osi_LogSaveString(smb_logp, buf));
-                StringCchCatA(buf, lengthof(buf), "\r\n");
-                OutputDebugString(buf);
             }
             StringCchPrintfA(buf, lengthof(buf), "%5x", i);
             memset(buf+5,' ',80);
@@ -180,8 +176,6 @@ void OutputDebugHexDump(unsigned char * buffer, int len) {
     }    
     if(i) {
         osi_Log1(smb_logp, "%s", osi_LogSaveString(smb_logp, buf));
-        StringCchCatA(buf, lengthof(buf), "\r\n");
-        OutputDebugString(buf);
     }   
 }