superg / redumper

Low level CD dumper utility
GNU General Public License v3.0
216 stars 19 forks source link

[Request] Remove full path from logs #85

Closed Deterous closed 11 months ago

Deterous commented 11 months ago

To remove sensitive information within Paths from redumper logs (when submitting to redump.org), such as a usernames, I suggest something like the following changes: https://github.com/superg/redumper/compare/main...Deterous:redumper:no-full-path

Although if you disagree with this change as default behaviour, then I at least request for a flag to enable this feature. This is to support the feature of MPF using only relative paths: https://github.com/SabreTools/MPF/issues/526

tjanas commented 11 months ago

Not sure if this should be a change on the redumper side; if the redumper executable is launched from a relative working directory, sensitive information won’t be included in the relative path to the redumper executable.

As long as MPF sets the working directory appropriately when forking the redumper process (e.g. from the base MPF directory, calling “./Programs/Redumper/redumper.exe”) the paths in the redumper log will naturally be relative.

Deterous commented 11 months ago

Okay, I will try do that and see if it works. Setting --image-path to a relative path did not remove the full path from the redumper logs completely, but that would.

superg commented 11 months ago

I will have to actually check it because in some spots I convert to absolute paths, forgot the reason why.

superg commented 11 months ago

--image-path is passed verbatim and is not changed, this is responsibility of a caller.

Overall there is only one such spot where it outputs an absolute filename: command line: E:\ISO\redumper.exe --drive=X: --retries=100 --image-name=test

redumper never converts from relative to absolute but the issue here is that depending on what is launching the process, it might be passed as absolute by the shell. In my testing, Windows PowerShell and Visual Studio always pass absolute executable path, CMD doesn't.

In any way, I stripped argv[0] alltogether and it became: arguments: --drive=X: --retries=100 --image-name=test

I think this way it will be more concise and friendly.

Deterous commented 11 months ago

Thank you, this makes sense.