move-memdump-file-20040511
authorJeffrey Altman <jaltman@mit.edu>
Tue, 11 May 2004 14:26:14 +0000 (14:26 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 11 May 2004 14:26:14 +0000 (14:26 +0000)
Move the memdump file produced on Windows by "fs memdump" from
%WINDIR% to %WINDIR%\TEMP

src/WINNT/afsd/cm_ioctl.c

index 9138bb1..57099b3 100644 (file)
@@ -1978,7 +1978,15 @@ long cm_IoctlMemoryDump(struct smb_ioctl *ioctlp, struct cm_user *userp)
     cm_SkipIoctlPath(ioctlp);
     memcpy(&inValue, ioctlp->inDatap, sizeof(long));
   
-    GetWindowsDirectory(logfileName, sizeof(logfileName));
+    if (getenv("TEMP"))
+    {
+        strncpy(logfileName, getenv("TEMP"), MAX_PATH);
+        logfileName[MAX_PATH] = '\0';
+    }
+    else
+    {
+        GetWindowsDirectory(logfileName, sizeof(logfileName));
+    }
     strncat(logfileName, "\\afsd_alloc.log", sizeof(logfileName));
 
     hLogFile = CreateFile(logfileName, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);