brunnhilde icon indicating copy to clipboard operation
brunnhilde copied to clipboard

Siegfried error on Windows if root of drive is selected as input

Open kieranjol opened this issue 1 year ago • 4 comments

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?

kieranjol avatar Aug 01 '24 14:08 kieranjol

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.

kieranjol avatar Aug 01 '24 14:08 kieranjol

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.

kieranjol avatar Aug 01 '24 15:08 kieranjol

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?

kieranjol avatar Aug 01 '24 15:08 kieranjol

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!

tw4l avatar Aug 01 '24 15:08 tw4l