Bug in Target-dump
Been having a new issue since upgrading the dissect tools recently and I thought it might have been my environment, but I'm still seeing it after a fresh Linux install. I'm not able to get target-dump to run at all:
target-dump --restart -o dissect_out/ [target_path]/[target] -f apache leads to the following:
Traceback (most recent call last):
File "/home/[user]/.local/bin/target-dump", line 8, in <module>
sys.exit(main())
^^^^^^
File "/home/[user]/.local/share/pipx/venvs/dissect/lib/python3.12/site-packages/dissect/target/tools/dump/run.py", line 290, in main
args = parse_arguments()
^^^^^^^^^^^^^^^^^
File "/home/[user]/.local/share/pipx/venvs/dissect/lib/python3.12/site-packages/dissect/target/tools/dump/run.py", line 284, in parse_arguments
process_generic_arguments(args)
TypeError: process_generic_arguments() missing 1 required positional argument: 'rest'
I went digging and this *process_generic_arguments*() seems to be a utility function that is used in target-query and other places, which are still working.
After a search I see the 'rest' argument is passed in other cases, but not in target-dump. After adding 'rest' as a return value from parser.parse_known_args() and passing it to process_generic_arguments() everything seems to work as normal. Curious if target-dump is working for anybody right now? Thanks in advance
Hi @jd-gui, Thanks for reporting this! You are spot-on regarding the cause and solution. Would you like to submit a PR for this yourself? If so, please also add a unit test for running target-dump. You can take inspiration from here: (https://github.com/fox-it/dissect.target/blob/5200fc1e192cb4b30281eb74da32f1a57ce7b9ab/tests/tools/test_query.py#L183). Otherwise let us know and we would implement the solution.
Hello @jd-gui I am making a patch to fix this issue right now