Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BLU0-SMTP1066FA7D64D40A238B536F4FDF70@phx.gbl>
Date: Mon, 11 Jun 2012 13:48:44 +0200
From: Frank Dittrich <frank_dittrich@...mail.com>
To: john-dev@...ts.openwall.com
Subject: Re: bash completion

On 06/11/2012 01:22 PM, Frank Dittrich wrote:
> All options --option= or --opt: that are not individually handled get
> the list of all file names and directories as completions:
> 
> 
> $ ./john --markov=[tab][tab]
> all.chr               john.local.conf       rar2john
> alnum.chr             john.rec              raw2dyna
> alpha.chr             lanman.chr            relbench
> calc_stat             ldif2john.pl          sap2john.pl
> ...
> 
> Fixing this will probably not be as easy as I'd like it to be.

What I got so far is a solution that lists an empty line for each [tab][tab]


$ ./john --markov=[tab][tab]

$ ./john --markov=[tab][tab]

$ ./john --markov=[tab][tab]

$ ./john --markov=[tab][tab]

$ ./john --markov=[tab][tab]

$ ./john --markov=


May be better than listing all files, but not perfect.

The patch would look like this:

diff --git a/run/john.bash_completion b/run/john.bash_completion
index ccc7387..a99512a 100644
--- a/run/john.bash_completion
+++ b/run/john.bash_completion
@@ -534,6 +534,8 @@ _john()
 			return 0
 			;;
 		-*+(=|:))
+			COMPREPLY[0]=""
+			compopt -o nospace
 			return 0;
 			;;
 		-*)
@@ -555,7 +557,6 @@ _john()
 	esac
 } &&
 complete -o bashdefault -o default -F _john john
-
 # unique
 ## have grep && have sed &&
 _unique()


What would be better, reverting (or not applying) my previous patch, or
applying this one on top? I am not sure.

Frank

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.