cryptop.in, keyfunc.sh.in: Move userv variable setup into keyfunc.sh.
authorMark Wooding <mdw@distorted.org.uk>
Sun, 25 Dec 2011 23:51:36 +0000 (23:51 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Mon, 26 Dec 2011 00:08:44 +0000 (00:08 +0000)
We'll need these set up in a later program.

cryptop.in
keyfunc.sh.in

index 3efb554..7b38a0a 100755 (executable)
@@ -34,17 +34,6 @@ export ETC KEYS KEYSLIB
 usage="usage: $quis COMMAND [ARGUMENTS ...]"
 prefix=cryptop
 
-## Fake up caller credentials if not called via userv.
-case "${USERV_USER+t}" in
-  t) ;;
-  *) USERV_USER=${LOGNAME-${USER-$(id -un)}} USERV_UID=$(id -u) ;;
-esac
-case "${USERV_GROUP+t}" in
-  t) ;;
-  *) USERV_GROUP=$(id -Gn) USERV_GID=$(id -gn) ;;
-esac
-export USERV_USER USERV_UID USERV_GROUP USERV_GID
-
 ## Parse options.
 while getopts "hv" opt; do
   case "$opt" in
index f134198..5b6320e 100644 (file)
@@ -38,6 +38,16 @@ if [ -f $ETC/keys.conf ]; then . $ETC/keys.conf; fi
 ## Maybe turn on debugging.
 case "${KEYS_DEBUG+t}" in t) set -x ;; esac
 
+## Fake up caller credentials if not called via userv.
+case "${USERV_USER+t}" in
+  t) ;;
+  *) USERV_USER=${LOGNAME-${USER-$(id -un)}} USERV_UID=$(id -u) ;;
+esac
+case "${USERV_GROUP+t}" in
+  t) ;;
+  *) USERV_GROUP=$(id -Gn) USERV_GID=$(id -gn) ;;
+esac
+
 ###--------------------------------------------------------------------------
 ### Cleanup handling.