keyfunc.sh.in, ktype.*: Make nub creation the job of `c_genkey'.
authorMark Wooding <mdw@distorted.org.uk>
Sun, 2 Dec 2012 15:44:47 +0000 (15:44 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Sun, 2 Dec 2012 15:51:09 +0000 (15:51 +0000)
This means that we can stop worrying about the permissions on the file,
and the duplicated calls to `makenub' can disappear.

keyfunc.sh.in
ktype.gnupg
ktype.seccure

index f257bb9..c8a6073 100644 (file)
@@ -437,7 +437,7 @@ $profile
 EOF
 
   ## Generate the key.
-  umask=$(umask); umask 077; >"$knub.new"; umask $umask
+  (umask 077; makenub >"$knub.new")
   k_generate "$kdir.new" "$knub.new"
   $hook "$kdir.new" "$knub.new"
 
index 18a17a9..c24492f 100644 (file)
@@ -91,7 +91,6 @@ EOF
 k_generate () {
   base=$1 nub=$2
 
-  makenub >"$nub"
   initdir "$base"
 
   { cat <<EOF
index da51687..e884453 100644 (file)
@@ -56,7 +56,6 @@ k_public () {
 
 k_generate () {
   base=$1 nub=$2
-  makenub >"$nub"
   k_public "$base" "$nub" >"$base/pub"
 }