dissect.target icon indicating copy to clipboard operation
dissect.target copied to clipboard

Mark user shell as a path

Open twiggler opened this issue 1 year ago • 4 comments

Currently, the UnixUserRecord encodes the user shell as a string. While this is safe from implicit path flavor conversions, making this field a path is semantically clearer.

Also check the other field types.

Related: https://github.com/fox-it/dissect.target/issues/891

twiggler avatar Oct 15 '24 07:10 twiggler

If the issue is still open, i might want to change it. Can do a quick fix for this. Then again the issue is a few months old still not sure if its still an issue?

Peter-The-Great avatar Jul 29 '25 13:07 Peter-The-Great

@twiggler If it is still open, maybe like a function that could dynamically edit the COMMON_UNIX_FIELDS. Something along the lines of:

override_fields(
        COMMON_UNIX_FIELDS,
        shell="string",
    ),

There could be a solution in there, making sure that you can always use the standard COMMON_UNIX_FIELDS, but also allowing them to be overwritten moredynamicly for each iteration of a differnt UnixUserRecord. Depending on if you need it. Or the more simpler option is to just:

("string", "shell"), --> ("path", "shell"),

Peter-The-Great avatar Jul 29 '25 14:07 Peter-The-Great

Nothing as complicated as that is required, just a change from ("string", "shell"), -> ("path", "shell"), and a sanity check if everything still works, maybe an added unit test.

Schamper avatar Jul 29 '25 16:07 Schamper

I guess. Then i will make those changes right now.

Peter-The-Great avatar Jul 30 '25 16:07 Peter-The-Great