Siegfried error on Windows if root of drive is selected as input
On Windows 10, i've noticed that if the input is the root of a drive, a Siegfried error appears.
brunnhilde.py -n D:\ C:\Users\kiera\Desktop\reportttt
2024-08-01 15:26:22,075 - INFO - Brunnhilde started. Source: D:\.
2024-08-01 15:26:22,093 - INFO - Running Siegfried. This might take a while...
2024/08/01 15:26:22 [FATAL] file access error for D:" : CreateFile D:" : The filename, directory name, or volume label syntax is incorrect.
2024-08-01 15:26:22,164 - INFO - Siegfried scan complete. Processing results.
2024-08-01 15:26:22,493 - INFO - Brunnhilde characterization complete. Reports written to C:\Users\kiera\Desktop\reportttt.
Siegfried itself has no issues when running with the input as the drive root. I wonder if it's just an escaping issue?
Actually it is an escaping issue. I can replicate in sf if I remove the colon:
C:\Users\kiera>sf D
---
siegfried : 1.11.1
scandate : 2024-08-01T15:40:51+01:00
signature : default.sig
created : 2024-06-21T16:01:11+10:00
identifiers :
- name : 'pronom'
details : 'DROID_SignatureFile_V118.xml; container-signature-20240501.xml'
2024/08/01 15:40:51 [FATAL] file access error for D: CreateFile D: The system cannot find the file specified.
Here's the command that is produced by Brunnhilde:
sf -csv -hash md5 "D:\" > "C:\Users\kiera\Desktop\8ktop\9\siegfried.csv"
which does indeed produce the error in sf:
C:\Users\kiera>sf "D:\"
---
siegfried : 1.11.1
scandate : 2024-08-01T15:58:58+01:00
signature : default.sig
created : 2024-06-21T16:01:11+10:00
identifiers :
- name : 'pronom'
details : 'DROID_SignatureFile_V118.xml; container-signature-20240501.xml'
2024/08/01 15:58:58 [FATAL] file access error for D:": CreateFile D:": The filename, directory name, or volume label syntax is incorrect.
Sorry for the multiple posts, i should have just edited the original. Anyhow I wonder if this could be resolved by using a list for the commands instead of a string with substitutions with shell=True? I think subprocess.check_output() or something similar could replace the piping and work across all operating systems. I could explore this and test unless there's a specific reason for keeping the shell=True approach?
Sorry for the multiple posts, i should have just edited the original. Anyhow I wonder if this could be resolved by using a list for the commands instead of a string with substitutions with shell=True? I think subprocess.check_output() or something similar could replace the piping and work across all operating systems. I could explore this and test unless there's a specific reason for keeping the shell=True approach?
I suspect you're right that a list with check_output or similar would be better! If you have the bandwidth to try it out, that would be wonderful!