From ec2081492f7a9a50f36c507928ae6ed1af0f164b Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Sun, 25 Dec 2011 23:51:36 +0000 Subject: [PATCH] cryptop.in, keyfunc.sh.in: Move userv variable setup into keyfunc.sh. We'll need these set up in a later program. --- cryptop.in | 11 ----------- keyfunc.sh.in | 10 ++++++++++ 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/cryptop.in b/cryptop.in index 3efb554..7b38a0a 100755 --- a/cryptop.in +++ b/cryptop.in @@ -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 diff --git a/keyfunc.sh.in b/keyfunc.sh.in index f134198..5b6320e 100644 --- a/keyfunc.sh.in +++ b/keyfunc.sh.in @@ -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. -- 2.11.0