Fossil SCM

On Windows, write the temporary server files to a subfolder, allowing for easier exclusion from antivirus scanning.

danield 2023-03-10 15:40 trunk
Commit 364337be102a9fdcc03c506ab0887985fbf7daf520376552f4dde8075b4a9ff8
1 file changed +8
--- src/winhttp.c
+++ src/winhttp.c
@@ -570,10 +570,12 @@
570570
DualSocket ds;
571571
int idCnt = 0;
572572
int iPort = mnPort;
573573
Blob options;
574574
wchar_t zTmpPath[MAX_PATH];
575
+ char *zTempSubDirPath;
576
+ const char *zTempSubDir = "fossil";
575577
const char *zSkin;
576578
#if USE_SEE
577579
const char *zSavedKey = 0;
578580
size_t savedKeySize = 0;
579581
#endif
@@ -661,10 +663,16 @@
661663
}
662664
}
663665
if( !GetTempPathW(MAX_PATH, zTmpPath) ){
664666
fossil_panic("unable to get path to the temporary directory.");
665667
}
668
+ /* Use a subdirectory for temp files (can then be excluded from virus scan) */
669
+ zTempSubDirPath = mprintf("%s%s\\",fossil_path_to_utf8(zTmpPath),zTempSubDir);
670
+ if ( !file_mkdir(zTempSubDirPath, ExtFILE, 0) ||
671
+ file_isdir(zTempSubDirPath, ExtFILE)==1 ){
672
+ wcscpy(zTmpPath, fossil_utf8_to_path(zTempSubDirPath, 1));
673
+ }
666674
if( g.fHttpTrace ){
667675
zTempPrefix = mprintf("httptrace");
668676
}else{
669677
zTempPrefix = mprintf("%sfossil_server_P%d",
670678
fossil_unicode_to_utf8(zTmpPath), iPort);
671679
--- src/winhttp.c
+++ src/winhttp.c
@@ -570,10 +570,12 @@
570 DualSocket ds;
571 int idCnt = 0;
572 int iPort = mnPort;
573 Blob options;
574 wchar_t zTmpPath[MAX_PATH];
 
 
575 const char *zSkin;
576 #if USE_SEE
577 const char *zSavedKey = 0;
578 size_t savedKeySize = 0;
579 #endif
@@ -661,10 +663,16 @@
661 }
662 }
663 if( !GetTempPathW(MAX_PATH, zTmpPath) ){
664 fossil_panic("unable to get path to the temporary directory.");
665 }
 
 
 
 
 
 
666 if( g.fHttpTrace ){
667 zTempPrefix = mprintf("httptrace");
668 }else{
669 zTempPrefix = mprintf("%sfossil_server_P%d",
670 fossil_unicode_to_utf8(zTmpPath), iPort);
671
--- src/winhttp.c
+++ src/winhttp.c
@@ -570,10 +570,12 @@
570 DualSocket ds;
571 int idCnt = 0;
572 int iPort = mnPort;
573 Blob options;
574 wchar_t zTmpPath[MAX_PATH];
575 char *zTempSubDirPath;
576 const char *zTempSubDir = "fossil";
577 const char *zSkin;
578 #if USE_SEE
579 const char *zSavedKey = 0;
580 size_t savedKeySize = 0;
581 #endif
@@ -661,10 +663,16 @@
663 }
664 }
665 if( !GetTempPathW(MAX_PATH, zTmpPath) ){
666 fossil_panic("unable to get path to the temporary directory.");
667 }
668 /* Use a subdirectory for temp files (can then be excluded from virus scan) */
669 zTempSubDirPath = mprintf("%s%s\\",fossil_path_to_utf8(zTmpPath),zTempSubDir);
670 if ( !file_mkdir(zTempSubDirPath, ExtFILE, 0) ||
671 file_isdir(zTempSubDirPath, ExtFILE)==1 ){
672 wcscpy(zTmpPath, fossil_utf8_to_path(zTempSubDirPath, 1));
673 }
674 if( g.fHttpTrace ){
675 zTempPrefix = mprintf("httptrace");
676 }else{
677 zTempPrefix = mprintf("%sfossil_server_P%d",
678 fossil_unicode_to_utf8(zTmpPath), iPort);
679

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button