8f42d430 |
1 | #!/bin/bash |
cf08a29f |
2 | # Get an AFS token for the given user. |
3 | # |
4 | # This is used to deliver mail with the appropriate credentials. |
5 | |
c3a1fc9a |
6 | # fuse stdin and stderr |
7 | exec 2>&1 |
8f42d430 |
8 | USER=$1 |
c3a1fc9a |
9 | |
10 | # all future output goes to this file |
11 | exec >&/tmp/get-token-log.$USER |
12 | |
13 | # check that setuid happened |
14 | whoami |
15 | |
16 | # set the credentials cache |
8f42d430 |
17 | export KRB5CCNAME=FILE:/tmp/krb5cc_$USER.email |
c3a1fc9a |
18 | |
19 | # eliminate any previous tokens |
8f42d430 |
20 | kdestroy |
21 | unlog |
0a3b3788 |
22 | KEYTAB=/etc/keytabs/user.daemon/$USER |
c3a1fc9a |
23 | |
24 | # display command-to-be-invoked as a sanity check |
0a3b3788 |
25 | echo kinit -kt $KEYTAB $USER/daemon@HCOOP.NET |
c3a1fc9a |
26 | |
0a3b3788 |
27 | kinit -kt $KEYTAB $USER/daemon@HCOOP.NET |
5092a970 |
28 | aklog |
5092a970 |
29 | |
ff958aaf |
30 | # list tokens, for the sake of debugging |
b612ef2b |
31 | #tokens |