[security-dev 01583]: Code review request for 6922482 (was Re: Confusing wording in new keytool command?)

Max (Weijun) Wang Weijun.Wang at Sun.COM
Tue Feb 2 18:41:27 PST 2010


Hi Brad (or others)

I've just fixed it, please take a review:

   http://cr.openjdk.java.net/~weijun/6922482/webrev.00/

Basically, I've created an Enum Option to hold all options, and two of them, FILEIN and FILEOUT, can have the same name but different descriptions.

For people in the open, the bug description is:

Keytool's new help feature has a name->description map, so the same option name always has the same description. However, -file sometimes means input file sometimes means output file. This should be fixed.

Thanks
Max

On Feb 3, 2010, at 10:10 AM, Brad Wetmore wrote:

> Thanks.
> 
> brad
> 
> 
> Max (Weijun) Wang wrote:
>> I'll file the bug and fix it.
>> 
>> Thanks
>> Max
>> 
>> On Feb 3, 2010, at 8:43 AM, Brad Wetmore wrote:
>> 
>>> Max,
>>> 
>>> I'm pretty sure you added the keytool option -printcertreq via 6780416.
>>> I think you might want to consider a change to the wording of the help
>>> option.  Let's say I have a CSR.txt file that I want to dump out.
>>> According to this:
>>> 
>>> ---begin---
>>> [wetmore at dualcongas] 207 >keytool -printcertreq -help
>>> keytool -printcertreq [OPTION]...
>>> 
>>> Prints the content of a certificate request
>>> 
>>> Options:
>>> 
>>> -file <filename>  output file name
>>> -v                verbose output
>>> 
>>> Use "keytool -help" for all available commands
>>> ---end---
>>> 
>>> I would use -file <filename> to store the output of the command.
>>> Something like:
>>> 
>>> ---begin---
>>> [wetmore at dualcongas] 210 >keytool -printcertreq -file output.txt -v <
>>> c:/csrforpsign.csr
>>> keytool error: java.io.FileNotFoundException: output.txt (The system
>>> cannot find the file specified)
>>> java.io.FileNotFoundException: dummy.txt (The system cannot find the
>>> file specified)
>>>       at java.io.FileInputStream.open(Native Method)
>>>       at java.io.FileInputStream.<init>(FileInputStream.java:137)
>>>       at java.io.FileInputStream.<init>(FileInputStream.java:96)
>>>       at sun.security.tools.KeyTool.doCommands(KeyTool.java:1092)
>>>       at sun.security.tools.KeyTool.run(KeyTool.java:307)
>>>       at sun.security.tools.KeyTool.main(KeyTool.java:300)
>>> ---end---
>>> 
>>> ...but that's not what it really does.  It actually points to the input
>>> for the printcertreq command.  I think it should be changed to read:
>>> 
>>> ---begin---
>>> -file <filename>  input file name
>>> ---end---
>>> 
>>> Do you want me to file a bug?
>>> 
>>> Brad
>>> 
>> 




More information about the security-dev mailing list