Invalid processing of root directories on Windows.
(1) By anonymous on 2022-01-25 02:10:32 [source]
After executing fs zip trunk F:\test.zip
command on Windows, Fossil creates a subdirectory with a strange name.
The reason is simple: Windows treat F: and F:\ differently.
Fossil unsuccessfully checks (blob_write_to_file > file_mkfolder > file_isdir) the presence of F: and creates F0xF03A
dir after that.
To fix this bug you can add something like this:
if( *wUnicode=='\0' && wUnicode>zUnicode && wUnicode[-1]==':' ){
wUnicode[0] = '\\';
wUnicode[1] = '\0';
return zUnicode;
}
before while( *wUnicode != '\0' ){
line at fossil_utf8_to_path function.
(2) By Richard Hipp (drh) on 2022-01-25 16:38:56 in reply to 1 [link] [source]
I'm unable to reproduce the problem. Do you have additional hints?
I have a separate drive letter R: defined on my Win10 laptop. I did this:
fossil zip current r:\test.zip
The ZIP archive was created. It appears to be valid and intact. No additional files or directories were created.
(3) By Daniel Dumitriu (danield) on 2022-01-25 16:41:27 in reply to 2 [link] [source]
Same here.
(4) By anonymous on 2022-01-25 18:51:20 in reply to 1 [link] [source]
I'am on Windows 7.
Fossil creates this directories not on the specified drives but in current directory. Name of directory contains drive letter plus nonprintable unicode point generated from ":" by this line *wUnicode |= 0xF000;
of fossil_utf8_to_path function.
This happened not only for root paths: if subdir not exists fossil zip trunk F:\subdir\test.zip
lead to the same behaviour and fossil zip trunk \\?\f:\test.zip
lead to unable to open file "\\test.zip" for writing
error, but only if F0xF03A
dir not already present in current directory.
If you create in current directory read-only file named <Drive letter>+0xF03A
then command fossil zip trunk <Drive letter>:\test.zip
lead to unable to create directory <Drive letter>:
error.
(5) By anonymous on 2022-01-25 19:23:30 in reply to 4 [link] [source]
Partial Process Monitor log after executing fossil zip trunk c:\test.zip
from C:\t
directory:
"Time of Day","Process Name","PID","Operation","Path","Result","Detail"
"22:13:02.2588946","fossil.exe","19036","CreateFile","C:\t\c","NAME NOT FOUND","Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a"
"22:13:02.2590494","fossil.exe","19036","CreateFile","C:\t\c","NAME NOT FOUND","Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a"
"22:13:02.2591343","fossil.exe","19036","CreateFile","C:\t\c","SUCCESS","Desired Access: Read Data/List Directory, Synchronize, Disposition: Create, Options: Directory, Synchronous IO Non-Alert, Open Reparse Point, Attributes: N, ShareMode: Read, Write, AllocationSize: 0, OpenResult: Created"
"22:13:02.2593801","fossil.exe","19036","CloseFile","C:\t\c","SUCCESS",""
(6) By anonymous on 2022-01-25 19:31:48 in reply to 4 [link] [source]
Same on Windows 10:
"Time of Day","Process Name","PID","Operation","Path","Result","Detail"
"11:28:54.3464929 AM","fossil.exe","4864","CreateFile","C:\t\c","NAME NOT FOUND","Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a"
"11:28:54.3468725 AM","fossil.exe","4864","CreateFile","C:\t\c","NAME NOT FOUND","Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a"
"11:28:54.3470918 AM","fossil.exe","4864","CreateFile","C:\t\c","SUCCESS","Desired Access: Read Data/List Directory, Synchronize, Disposition: Create, Options: Directory, Synchronous IO Non-Alert, Open Reparse Point, Attributes: N, ShareMode: Read, Write, AllocationSize: 0, OpenResult: Created"
"11:28:54.3473113 AM","fossil.exe","4864","CloseFile","C:\t\c","SUCCESS",""