X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/distorted-keys/blobdiff_plain/1581d63e281564dbd7889f911773c862c80f04fc..HEAD:/keyfunc.sh.in diff --git a/keyfunc.sh.in b/keyfunc.sh.in index 98354d1..dca8dee 100644 --- a/keyfunc.sh.in +++ b/keyfunc.sh.in @@ -154,8 +154,14 @@ check () { validp=t case "$thing" in - *"$nl"*) validp=nil ;; - *) if ! expr >/dev/null "Q$thing" : "Q$ckpat\$"; then validp=nil; fi ;; + *"$nl"*) + validp=nil + ;; + *) + if ! expr >/dev/null "Q$thing" : "\(Q$ckpat\)\$"; then + validp=nil + fi + ;; esac case $validp in nil) echo >&2 "$quis: bad $ckwhat \`$thing'"; exit 1 ;; @@ -419,19 +425,20 @@ c_genkey () { ## options to the key type. ## Set options and check them. + kopt_owner=$kowner kopt_label=$klabel setprops "option" kopt_ "$@" checkprops "option" kopt_ "$k_genopts" ## Create directory structure and start writing metadata. rm -rf "$kdir.new" mkdir -m755 -p "$kdir.new" - case "$knub" in */*) mkdir -m700 -p "${knub%/*}" ;; esac + case "$knub" in */*) mkdir -m755 -p "${knub%/*}" ;; esac cat >"$kdir.new/meta" <"$knub.new"; umask $umask + (umask 077; makenub >"$knub.new") k_generate "$kdir.new" "$knub.new" $hook "$kdir.new" "$knub.new" @@ -664,7 +671,7 @@ usage_err () { usage >&2; exit 1; } ### Subcommand handling. version () { - echo "$PACKAGE version $VERSION" + echo "$quis, $PACKAGE version $VERSION" } unset cmdargs @@ -720,6 +727,7 @@ $cmds EOF case $foundp in t) + usage; echo eval help=\$help_$cmdname; echo "$help" ;; nil)