This is inspired by discussions about adding --password-file option to subversion command line tool at dev <at> subversion.a.o mailing list. Links to threads: "The --password and clumsy users issue" "[PATCH]: Add --password-file and --password-envvar" http://subversion.markmail.org/thread/xdcfgujgqvgytx64 http://subversion.markmail.org/thread/jgbu75eiradryodf The digest.sh utility in Tomcat accepts passwords as arguments on the command line and prints hashed representation for them to System.out. Proposal is to 1) Provide an option to specify a file name to read passwords from 2) If file name is "-" then treat it as System.in 3) Add support for option "--" to specify the end of list of options Notes: Implementation goes into RealmBase.java, documentation goes into realm-howto.xml. r1633589 can be used for a reference.
This would be a good bug for someone who would like to get their name in the changelog. Any takers? (Is there an "easy bug" flag that we can set to make finding them easier in BZ?)
Created attachment 33572 [details] Patch proposal I think that I added the requirements correctly :) I had a little trouble understanding exactly what option 3 (the -- addition) was asking, so I did what other CLI tools do. Additionally, I made the password-file option ignore other password input, which can easily be reversed if that behavior was undesired. The documentation may need some touching up to incorporate the file option also (I added the option in the realm-howto explanation, but didn't amend the example use-case). Lastly, I put in some comments to help understand my intention in case they were incorrect. Those can be cleaned up if the logic is agreed upon.
I took a quick look at your proposed patch. Is there a reason why you implemented a file-based system instead of stdin-to-stdout? This enhancement request is for stdin-to-stdout. The quality of the patch seems good to me (thanks!), I was just wondering about the use-case. stdin-to-stdout could easily be scripted to process a file a line-at-a-time.
Hmm, lack of experience in the area I suppose...I thought I did a pretty literal implementation of the requirements from the description (specifically the first point). I could rewrite it if you would like me to if you can elaborate on where my misunderstanding was.
Fair enough. I'll have another look.
Bump; It's been a while since this RFE has gotten any attention. Have you had a chance to take a look and provide further feedback?
Coty: any reason to stop processing additional command-line arguments when reading passwords from a file?
Fixed in 8932164afc55b4851ba8cd1680a6e56e6db28cea in main. Back-ported to other branches as well.
Totally missed this, but no I don't think so :)