OpenSolaris

Printable Version Enter a New Search
Bug ID 6613494
Synopsis pktool fails creation outkey = in dir= if there is a file/dir in current dir of same name
State 10-Fix Delivered (Fix available in build)
Category:Subcategory solaris-crypto:key_mgmt_tools
Keywords
Responsible Engineer Wyllys Ingersoll
Reported Against
Duplicate Of
Introduced In solaris_nevada
Commit to Fix snv_76
Fixed In snv_76
Release Fixed solaris_nevada(snv_76)
Related Bugs
Submit Date 5-October-2007
Last Update Date 29-October-2007
Description
'pktool genkey' has a very strange CLI syntax for creating files in a given directory.

Instead of the expected UNIX syntax which would be:

pktool genkey keystore=file outkey=/path/to/file keytype=aes keylen=256

One has to specify the file and directory separately, this makes scripting harder than
it should be but more importantly it has led to this very strange bug:

braveheart# mkdir tank
braveheart# pwd
/
braveheart# ls -ld tank
drwxr-xr-x   2 root     root         512 Oct  5 11:39 tank
braveheart# truss -t open pktool genkey keystore=file keytype=aes keylen=256 dir=/etc/zfs/keys outkey=tank
....
open("tank", O_RDONLY|O_CREAT|O_EXCL, 0600)     Err#17 EEXIST
Cannot write the indicated output key file (tank).

Error generating key:
libkmf error: KMF_ERR_BAD_PARAMETER

Note that the cwd has a "directory" named tank but I told pktool to put the keyfile named tank in a different directory to the current one.

The proper fix in my opinion is to follow common UNIX practice and allow outfile to specify a full path
and not require dir=.
Work Around
N/A
Comments
N/A