X-Git-Url: http://git.hcoop.net/hcoop/zz_old/config/exim4-hopper.git/blobdiff_plain/8f42d430290715104a6e38d0aabc07ac861fd2bf..e5d180e5354327d6c0cfc3a655bd6e9d27fd3e90:/get-token diff --git a/get-token b/get-token index 23c32c0..7a77021 100755 --- a/get-token +++ b/get-token @@ -3,12 +3,29 @@ # # This is used to deliver mail with the appropriate credentials. +# fuse stdin and stderr +exec 2>&1 USER=$1 + +# all future output goes to this file +exec >&/tmp/get-token-log.$USER + +# check that setuid happened +whoami + +# set the credentials cache export KRB5CCNAME=FILE:/tmp/krb5cc_$USER.email + +# eliminate any previous tokens kdestroy unlog +KEYTAB=/etc/keytabs/user.daemon/$USER + +# display command-to-be-invoked as a sanity check +echo kinit -kt $KEYTAB $USER/daemon@HCOOP.NET + +kinit -kt $KEYTAB $USER/daemon@HCOOP.NET +aklog -#echo kinit -kt /etc/keytabs/$USER.email.keytab $USER/mailfilter@HCOOP.NET > /tmp/script-log -kinit -kt /etc/keytabs/$USER.email.keytab $USER/mailfilter@HCOOP.NET -#aklog +# list tokens, for the sake of debugging #tokens