mirror of
https://github.com/openwall/john.git
synced 2026-12-03 18:45:21 +07:00
[GH-ISSUE #842] Some bash completion errors #452
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#452
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 (Nov 4, 2014).
Original GitHub issue: https://github.com/openwall/john/issues/842
I intend to fix them when I find the time.
1: Markov mode completion
The two markov modes, default and fd, should have been listed as possible completions.
Without
--stdout, it works:2: External mode completion with --config=...
./john --config=fd.conf --external=[tab][tab]lists all external modes defined in fd.conf as possible completions./john --stdout --config=fd.conf --external=[tab][tab]lists all external modes defined in john.conf instead.3: bash completion doesn't work with "" or '' on the command line preceding the token to be completed.
./john --mask=?l?l?l --external=[tab][tab]lists all external modes as possible completions../john --mask="?l?l?l" --external=[tab][tab]lists all file names as possible completions../john --mask='?l?l?l' --external=[tab][tab]lists all file names as possible completions.That one is possibly harder to fix. I doubt that it is a john.bas_completion bug.
More likely, it is a bug in _get_comp_words_by_ref (used inside john.bash_completion).
Because the same bug can be reproduced like this:
cut --delimiter=" " --fie[tab][tab]doesn't complete--fietofields, whilecut --delimiter=: --fie[tab][tab]doesCan someon check this on othert systems (i.e., not Fefdora 20)?
Workaround: quote like this:
cut "--delimiter= " --fie[tab][tab]The same workaround also helps for john.bash_completion:
./john "--mask=?l?l?l" --external=[tab][tab]lists all external modes as possible completions../john '--mask=?l?l?l' --external=[tab][tab]lists all external modes as possible completions.@frank-dittrich commented on GitHub (Nov 4, 2014):
I think I found the root cause for 1 and 2:
@magnumripper commented on GitHub (Nov 4, 2014):
Hmm but what is the cause for that!? It doesn't make sense. --list uses FLG_ZERO which has its own dupe check: --list is only incompatible with another --list.
@magnumripper commented on GitHub (Nov 4, 2014):
See
783980c42a6d945aad58600b5ce0d52. Did it work before0b5ce0d52?@frank-dittrich commented on GitHub (Nov 4, 2014):
I guess it is related to
Probably it is the
FLG_BATCH_CHKinI tried to avoid that with
But that didn't help, either.
@magnumripper commented on GitHub (Nov 4, 2014):
Oh, I see. This is not a bug per se but just a result of the options parsing. We need some kind of workaround similar to what you did.
@magnumripper commented on GitHub (Nov 5, 2014):
This works for -stdout but it may cause problems (or just not help) for other combinations.
@magnumripper commented on GitHub (Nov 5, 2014):
It doesn't seem to cause problems though. And
../run/john -stdin -list=markovworks too without adding anything more.@magnumripper commented on GitHub (Nov 5, 2014):
BTW if it cause problems, it will only cause problems for --list. So we could commit this without super serious regression testing...
@frank-dittrich commented on GitHub (Nov 5, 2014):
Agreed. Please do commit that fix (may be add a comment that othetrwise --stdout --list=... will fail) and close the bug. Thanks for fixing.
@frank-dittrich commented on GitHub (Nov 11, 2014):
Unfortunately, your fix for
--stdout --list=...breaks@frank-dittrich commented on GitHub (Nov 11, 2014):
This seems to work:
@frank-dittrich commented on GitHub (Nov 11, 2014):
I committed the working fix as
172e933.@magnumripper commented on GitHub (Nov 11, 2014):
👍 there are probably a few more cases yet to be found.