]> git.michaelhowe.org Git - packages/m/mh-sysadmin-tools.git/commitdiff
* with-creds: use /dev/shm for ccaches if exists, fall back to /tmp
authorMichael Howe <michael@michaelhowe.org>
Sat, 1 Mar 2014 10:34:35 +0000 (10:34 +0000)
committerMichael Howe <michael@michaelhowe.org>
Sat, 1 Mar 2014 10:34:35 +0000 (10:34 +0000)
  otherwise.  This solves the issue of NFS picking the wrong credentials to
  identify the user.
* with-creds: set -e so failures cause it to stop

bin/with-creds
debian/changelog

index a8724eea1192efd0646638fe52ea5e7d59cdd1a4..f91549b5e9ea968dadf25ba31ce2b44ef88d4daf 100755 (executable)
@@ -6,6 +6,8 @@
 # $LastChangedBy$
 #
 
+set -e
+
 function usage {
     cat >&2 <<EOH
 Usage: $0 -i service_part -r REALM -u user [command]"
@@ -68,7 +70,12 @@ if [ -n "$aklog" ]; then
     EXTRAOPTS="-t"
 fi
 
-export KRB5CCNAME=/var/tmp/krb5cc_${UID}_${KRBUSER}_${userpart}
+TMPDIR=/tmp
+if [ -w /dev/shm ]; then
+    TMPDIR="/dev/shm"
+fi
+
+export KRB5CCNAME=${TMPDIR}/krb5cc_${UID}_${KRBUSER}_${userpart}
 
 k5start -H 30 -u "$PRINC" $EXTRAOPTS
 
index 06f9cdfbb7e6d81b62d7f2855ce77b5075131394..51a24b70fa792cbae28257f0121e6889eba95f6b 100644 (file)
@@ -1,6 +1,9 @@
 mh-sysadmin-tools (1.5) unstable; urgency=low
 
-  * with-creds: use /var/tmp for ccaches 
+  * with-creds: use /dev/shm for ccaches if exists, fall back to /tmp
+    otherwise.  This solves the issue of NFS picking the wrong credentials to
+    identify the user.
+  * with-creds: set -e so failures cause it to stop
 
  -- Michael Howe <michael@michaelhowe.org>  Mon, 09 Dec 2013 20:32:42 +0000