aboutsummaryrefslogtreecommitdiff
path: root/perl/t/data/keytab-fake
diff options
context:
space:
mode:
authorRuss Allbery <rra@stanford.edu>2007-09-19 22:43:15 +0000
committerRuss Allbery <rra@stanford.edu>2007-09-19 22:43:15 +0000
commit9d5ee8d947433edd542ed441136d19e4f4033af4 (patch)
treed8cab026fbeca63f1c28b9c41d449cd8348b294b /perl/t/data/keytab-fake
parente86a7a0569e84ebcb769855ece2417c2ccce9b45 (diff)
Implement unchanging support in the keytab object backend, which retrieves
keytabs via remctl from the KDC.
Diffstat (limited to 'perl/t/data/keytab-fake')
-rwxr-xr-xperl/t/data/keytab-fake29
1 files changed, 29 insertions, 0 deletions
diff --git a/perl/t/data/keytab-fake b/perl/t/data/keytab-fake
new file mode 100755
index 0000000..df21294
--- /dev/null
+++ b/perl/t/data/keytab-fake
@@ -0,0 +1,29 @@
+#!/bin/sh
+# $Id$
+#
+# keytab-fake -- Fake keytab-backend implementation.
+#
+# This keytab-fake script is meant to be run by remctld during testing of
+# the keytab object implementation. It returns a fixed string for
+# wallet/one and returns an error for wallet/two.
+
+set -e
+
+if [ "$1" != "retrieve" ] ; then
+ echo "Invalid command $1" >&2
+ exit 1
+fi
+
+case "$2" in
+wallet/one@*)
+ printf 'Keytab for wallet/one'
+ ;;
+wallet/two@*)
+ echo 'bite me' >&2
+ exit 1
+ ;;
+*)
+ echo "Unknown principal $2" >&2
+ exit 1
+ ;;
+esac