From: Mark Wooding Date: Thu, 20 Sep 2012 00:08:43 +0000 (+0100) Subject: keys.reveal: Rename variables to avoid them being clobbered. X-Git-Tag: 0.99.2~9 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/distorted-keys/commitdiff_plain/bdc4cfb4adae0b66732a4be76d83402d55b9f35d keys.reveal: Rename variables to avoid them being clobbered. This is getting to be a nuisance. --- diff --git a/keys.reveal b/keys.reveal index 9270b55..c0b2a58 100755 --- a/keys.reveal +++ b/keys.reveal @@ -51,12 +51,12 @@ checkword "recovery key" "$recov" checkword "keeper set label" "$keeper" ## Check that this is a sensible thing to do. -kdir=$KEYS/keeper/$keeper -if [ ! -f $kdir/meta ]; then +keepdir=$KEYS/keeper/$keeper +if [ ! -f $keepdir/meta ]; then echo >&2 "$quis: unknown keeper set \`$keeper'" exit 1 fi -if [ ! -l $KEYS/recov/$recov/current ]; then +if [ ! -h $KEYS/recov/$recov/current ]; then echo >&2 "$quis: unknown recovery key \`$recov'" exit 1 fi @@ -74,17 +74,17 @@ cat >$tmp/secret t=$(sharethresh $rdir/$keeper.param) ## Find out which keeper index it corresponds to. -read n hunoz <$kdir/meta +read n hunoz <$keepdir/meta i=0 -foundp=nil +foundnubp=nil while [ $i -lt $n ]; do - c_sysprepare $kdir/$i + c_sysprepare $keepdir/$i nubbin=$(nubid <$tmp/secret) - nubid=$(cat $kdir/$i/nubid) - case "$nubbin" in "$nubid") foundp=t; break ;; esac + nubid=$(cat $keepdir/$i/nubid) + case "$nubbin" in "$nubid") foundnubp=t; break ;; esac i=$(( $i + 1 )) done -case $foundp in +case $foundnubp in nil) echo >&2 "$quis: nub doesn't match keeper \`$keeper'"; exit 1 ;; esac @@ -106,7 +106,7 @@ umask 077 if [ -f $keeper.$i.share ]; then echo >&2 "$quis: share $i already revealed" else - c_sysdecrypt $kdir/$i $tmp/secret \ + c_sysdecrypt $keepdir/$i $tmp/secret \ <$rdir/$keeper.$i.share \ >$keeper.$i.new mv $keeper.$i.new $keeper.$i.share