X-Git-Url: https://git.distorted.org.uk/~mdw/distorted-keys/blobdiff_plain/cc9695851772f5130854519f0936ea9b282ff23f..ec2081492f7a9a50f36c507928ae6ed1af0f164b:/keyfunc.sh.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.