Fossil SCM
On Windows, write the temporary server files to a subfolder, allowing for easier exclusion from antivirus scanning.
Commit
364337be102a9fdcc03c506ab0887985fbf7daf520376552f4dde8075b4a9ff8
Parent
782a7f9898f4e8e…
1 file changed
+8
+8
| --- src/winhttp.c | ||
| +++ src/winhttp.c | ||
| @@ -570,10 +570,12 @@ | ||
| 570 | 570 | DualSocket ds; |
| 571 | 571 | int idCnt = 0; |
| 572 | 572 | int iPort = mnPort; |
| 573 | 573 | Blob options; |
| 574 | 574 | wchar_t zTmpPath[MAX_PATH]; |
| 575 | + char *zTempSubDirPath; | |
| 576 | + const char *zTempSubDir = "fossil"; | |
| 575 | 577 | const char *zSkin; |
| 576 | 578 | #if USE_SEE |
| 577 | 579 | const char *zSavedKey = 0; |
| 578 | 580 | size_t savedKeySize = 0; |
| 579 | 581 | #endif |
| @@ -661,10 +663,16 @@ | ||
| 661 | 663 | } |
| 662 | 664 | } |
| 663 | 665 | if( !GetTempPathW(MAX_PATH, zTmpPath) ){ |
| 664 | 666 | fossil_panic("unable to get path to the temporary directory."); |
| 665 | 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 | + } | |
| 666 | 674 | if( g.fHttpTrace ){ |
| 667 | 675 | zTempPrefix = mprintf("httptrace"); |
| 668 | 676 | }else{ |
| 669 | 677 | zTempPrefix = mprintf("%sfossil_server_P%d", |
| 670 | 678 | fossil_unicode_to_utf8(zTmpPath), iPort); |
| 671 | 679 |
| --- 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 |