Hello,
After updating ntdissector to use dissect.database instead of dissect.esedb, we found a bug where record.get returns a list of values even when there is only one value.
The Problem
The issue is caused by a recent change in https://github.com/fox-it/dissect.database/blob/542289301b3f754c40dceddaed26d4bd33043f6f/dissect/database/ese/record.py (lines 303–304):
if column.is_multivalue and not isinstance(value, list):
value = [value]
The code currently treats all "multivalue" columns as lists. However, a column typed as "multivalue" might still only contain a single value (or none). In these cases, it should return the value directly rather than wrapping it in a list. This is why the tag flags are compared to TAGFLD_HEADER.MultiValues in which case, indicate that multiple values are in the field.
This condition was recently added in 64ae6d8 .
Proposed Fix
Remove lines 303 and 304. I have tested this change locally, and it restores the expected behavior for ntdissector.
Hello,
After updating ntdissector to use dissect.database instead of dissect.esedb, we found a bug where record.get returns a list of values even when there is only one value.
The Problem
The issue is caused by a recent change in https://github.com/fox-it/dissect.database/blob/542289301b3f754c40dceddaed26d4bd33043f6f/dissect/database/ese/record.py (lines 303–304):
The code currently treats all "multivalue" columns as lists. However, a column typed as "multivalue" might still only contain a single value (or none). In these cases, it should return the value directly rather than wrapping it in a list. This is why the tag flags are compared to TAGFLD_HEADER.MultiValues in which case, indicate that multiple values are in the field.
This condition was recently added in 64ae6d8 .
Proposed Fix
Remove lines 303 and 304. I have tested this change locally, and it restores the expected behavior for ntdissector.