mirror of
https://github.com/openwall/john.git
synced 2026-12-03 18:45:21 +07:00
[GH-ISSUE #701] bash completion must not call ./john with all the command line parameters... #346
Labels
No labels
bug
core branch
documentation
enhancement
enhancement
fixed - pending verify
fuzz bug
good first issue
invalid
invalid
maintenance/cleanup
new cracking mode
new format
new tool
non-trivial
notes/external issues
portability
question
RFC / discussion
testing
WONTFIX
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
openwall/john#346
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @frank-dittrich on GitHub (Jul 23, 2014).
Original GitHub issue: https://github.com/openwall/john/issues/701
Bash completion shouldn't reuse all command line parameters when trying to complete --rules= etc.
While testing some --fork issues, I wanted to add --rules and use bash completion for --rules=no[tab].
The completion took longer than usual, and top listed this process running:
I guess this is the result of bash completion trying to reuse the command line (to find the right config file if there is a --conf= on the command line.
I really need to restrict which parameters and options I use.
And I wonder why "> stdout.txt" is part of the command line as seen in top.
@magnumripper commented on GitHub (Jul 23, 2014):
Yeah that
> stdout.txtis even a dangerous bug!@frank-dittrich commented on GitHub (Jul 23, 2014):
I was afraid of the "> stdout.txt" part as well.
But why is it shown in top output? Apparently, it somehow became a part of the command, not an output redirection.
Because, after finishing the completion, there is no file stdout.txt, so nothing got redirected.
While there's still a bug that needs fixing, I don't think it is dangerous.
@magnumripper commented on GitHub (Jul 23, 2014):
Maybe it is run in a sandbox, with that redirection.
@magnumripper commented on GitHub (Aug 20, 2014):
Here's another variant of (probably) same bug. I can't see what introduced this, I'm pretty sure these problems are new:
After removing john.pot I get similar output, but mixed with the expected list of external modes.
@magnumripper commented on GitHub (Aug 20, 2014):
Isn't the problem that the enumeration call to
johnincludes the hash file(s) if any were given? It should only include arguments that starts with a-dash.@magnumripper commented on GitHub (Aug 21, 2014):
This works, but only if I use
sed -r.@magnumripper commented on GitHub (Aug 21, 2014):
Wasn't supposed to be closed yet.
@magnumripper commented on GitHub (Aug 21, 2014):
In case that redirection really was a problem, it's actually removed now by the very same regex. It wasn't intended but I realized it now that I was going to add that :-)
I wonder if there can be any ill effects though. Apart from that
-ris not guaranteed to work everywhere...I see you are using similar regexps though, without adding
-r. How come?!@magnumripper commented on GitHub (Aug 21, 2014):
Hmm here is the real problem (I think this behavior is new)
I believe in earlier versions the --list option overrode everything else. Maybe we can revert to that and revert
4dc73c9.@frank-dittrich commented on GitHub (Aug 21, 2014):
On 08/21/2014 02:14 AM, magnum wrote:
I don't think it is a problem. Using GNU extensions would be a problem.
@frank-dittrich commented on GitHub (Aug 21, 2014):
On 08/21/2014 02:43 AM, magnum wrote:
Preferably, john should warn about an illegal combination of options here.
It doesn't make sense to use --list together with --test (and many other
options).
@magnumripper commented on GitHub (Aug 21, 2014):
Normally yes, but for shell completion the "override" behavior turned out to be a feature - without it we'd need a lot more stuff trimmed from
$COMP_LINEwith some sort of heuristics. I believe we currently have complete override for listconf_parse_early() while listconf_parse_late() is called after loading hashes. I had a quick look today and it's not trivial to change that.On the other hand we might do fine with a short whitelist and trim anything else. I guess
--config=is one of the very few things we need to keep?@magnumripper commented on GitHub (Aug 28, 2014):
This seems to be fine now