chiark / gitweb /
claim-dir: New `mode' option for non-private pieces of filesystem.
[distorted-keys] / keys.list-recov
index 38ab00fe16ba7a9c6821f18e689ef16cbe17151c..e05dc33382326e3f9ab984c45b3fd15299e7693b 100755 (executable)
@@ -34,32 +34,47 @@ HELP
 
 case $# in 0) ;; *) usage_err ;; esac
 
+## Work through the recovery keys.
 if [ ! -d $KEYS/recov ]; then
   echo 2>&1 "$quis: no recovery keys"
 else
   cd $KEYS/recov
   firstp=t
-  for r in $(find . -type l -name current -print); do
-    r=${r#./}; r=${r%/current}
-    if ! expr >/dev/null "Q$r" : "Q$R_LABEL"; then continue; fi
-    unset ri
+  for r in *; do
+    if [ ! -d $r ]; then continue; fi
+
+    ## Start printing a record for this key.
     case $firstp in t) firstp=nil ;; nil) echo ;; esac
     echo "$r"
+
+    ## Print information about the configured keeper set.
     echo "      keepers"
     while read k t; do
       read n hunoz <$KEYS/keeper/$k/meta
       echo "   $k t=$t n=$n"
     done <$r/keepers
+
+    ## Print information about the various instances.
     rcur=$(readlink $r/current)
     for ri in $r/*; do
+
+      ## Extract and check the instance number.
       i=${ri##*/}
       case "$i" in *[!0-9]*) continue ;; esac
+
+      ## Start printing a subrecord.
       echo "  instance $i"
+
+      ## If this is the current instance, mention this.
       case "$rcur" in $i) echo "       current" ;; esac
+
+      ## Print basic facts about the instance.
       readmeta $ri/store
       nubid=$(cat $ri/store/nubid)
       echo "   profile $profile"
       echo "   nubid $nubid"
+
+      ## Print information about the keepers, including sharing stuff.
       echo "      keepers"
       for kp in $ri/*.param; do
        k=${kp##*/}; k=${k%.param}
@@ -67,9 +82,12 @@ else
        t=$(sharethresh $kp)
        echo "  $k t=$t n=$n"
       done
+
+      ## Print information about secrets protected by this recovery key
+      ## instance.
       anyp=nil
       for sf in $(cd $ri; find . -type f -name '*.recov' -print); do
-       s=${sf#./}
+       s=${sf#./}; s=${s%.recov}
        case $anyp in nil) anyp=t; echo "      secrets" ;; esac
        echo "  $s"
       done