SabreTools / MPF

Redumper/Aaru/DiscImageCreator GUI in C#
GNU General Public License v3.0
432 stars 34 forks source link

[Request] Preserve relative Output Path #526

Closed tjanas closed 1 year ago

tjanas commented 1 year ago

Is your feature request related to a problem? Please describe. I would like to use relative output paths in MPF. This may also result in eliminating sensitive information from path names that would be present in log files.

Describe the solution you'd like Relative paths in MPF that would also be used for --image-path when executing redumper.

Describe alternatives you've considered Running redumper manually instead of via MPF.

mnadareski commented 1 year ago

As mentioned on Discord, I'm hesitant to keep relative paths after normalization (or always using relative paths if it's under the same tree) because some tools may have issues with relative paths. I'm still paranoid from some past behavior of at least one of the included applications, so I'm going to keep them as absolute paths for now. I will leave this open, however, as I hope that this is not necessary in the future.

mnadareski commented 1 year ago

As an update to this, the code has been modified internally to allow this at a future point, either by default or via an option.

Deterous commented 1 year ago

I think I tested changing the default to relative path here: https://github.com/SabreTools/MPF/compare/master...Deterous:MPF:relative-path Build artifacts: https://ci.appveyor.com/project/Deterous/mpf/builds/48286773/artifacts However, after dumping the redumper logs still do show the full path. Either I've missed something (likely), something else needs changing in MPF (unlikely), or perhaps redumper does need to change its logging.

tjanas commented 1 year ago

So far following is working fine for me when running Redumper directly (not invoked by MPF) where its working directory is the base MPF directory. I don't see any full output paths being printed in the log.

=== 2023-10-16 09:38:18 ========================================================
redumper v2023.10.14 build_230 [Oct 14 2023, 23:19:39]

command line: Programs\Redumper\redumper.exe --verbose --image-path=ISO\TestDump --image-name=TestDump --retries=10 --debug

drive path: F:
drive: ASUS - BW-16D1HT (revision level: 3.10, vendor specific: WM01601KLZL4T85024)
drive configuration: GENERIC (read offset: +6, C2 shift: 0, pre-gap start: -135, read method: BE_CDDA, sector order: DATA_C2_SUB)

image path: ISO\TestDump
image name: TestDump

*** DUMP

disc TOC:
  track 1 {  data }
    index 01 { LBA:      0, MSF: 00:02:00 }
  track A {  data }
    index 01 { LBA: 293296, MSF: 65:12:46 }
Deterous commented 1 year ago

So far following is working fine for me when running Redumper directly (not invoked by MPF) where its working directory is the base MPF directory. I don't see any full output paths being printed in the log.

=== 2023-10-16 09:38:18 ========================================================
redumper v2023.10.14 build_230 [Oct 14 2023, 23:19:39]

command line: Programs\Redumper\redumper.exe --verbose --image-path=ISO\TestDump --image-name=TestDump --retries=10 --debug

drive path: F:
drive: ASUS - BW-16D1HT (revision level: 3.10, vendor specific: WM01601KLZL4T85024)
drive configuration: GENERIC (read offset: +6, C2 shift: 0, pre-gap start: -135, read method: BE_CDDA, sector order: DATA_C2_SUB)

image path: ISO\TestDump
image name: TestDump

*** DUMP

disc TOC:
  track 1 {  data }
    index 01 { LBA:      0, MSF: 00:02:00 }
  track A {  data }
    index 01 { LBA: 293296, MSF: 65:12:46 }

Did you run it standalone in Windows?

tjanas commented 1 year ago

Yes I did.

Deterous commented 1 year ago

https://github.com/superg/redumper/issues/85#issuecomment-1777833374

Redumper (build 239) has now changed such that even when called from a full path, the logs do not include sensitive information as long as the image-path argument is a relative path.

@tjanas I assume you have used CMD when calling redumper, as superg found that when calling from Powershell or Visual studio from a relative path (as I did), it still passes the full path to redumper.

I have submitted a PR (#589) with the changes to use relative paths inside MPF, and tested that redumper (build 239) and DIC do not have the full path anywhere in the logs (for my dumps, anyway). Hopefully this fixes this issue. Larger changes could potentially be made such that MPF calls redumper with a relative path, but that's not something I'm capable of doing, and the logs are clean after this PR anyway.

mnadareski commented 1 year ago

Fixed by https://github.com/SabreTools/MPF/pull/589