3 # Generate a krb5.conf file with an [appdefault] password_dictionary setting
4 # pointing to the password dictionary we generated for the build. This script
5 # is used by C tests to set up the environment.
7 # Written by Russ Allbery <rra@stanford.edu>
9 # The Board of Trustees of the Leland Stanford Junior University
11 # See LICENSE for licensing terms.
15 # Command-line arguments are the source krb5.conf template, the directory into
16 # which to write the resulting krb5.conf file, and then any number of key and
17 # value pairs to put into krb5.conf.
20 if [ -z "$tmpdir" ] ; then
21 echo 'Syntax: make-krb5-conf <source> <tmpdir> <key> <value> ...' >&2
27 # Copy over the template.
28 cp "$source" "$tmpdir"/krb5.conf
30 # Add the appdefaults section.
31 cat <<EOF >>"$tmpdir"/krb5.conf
37 # Add the key-value pairs.
38 while [ -n "$1" ] ; do
39 echo " $1 = $2" >>"$tmpdir"/krb5.conf
44 # End the appdefaults section.
45 echo ' }' >>"$tmpdir"/krb5.conf