postinst is in heimdal-kdc 1.6~git20120311.dfsg.1-2.
This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | #!/bin/sh -e
. /usr/share/debconf/confmodule
if [ ! -f /var/log/heimdal-kdc.log ]
then
touch /var/log/heimdal-kdc.log
chmod 600 /var/log/heimdal-kdc.log
fi
add_servers() {
kadmin_entry="kerberos-adm stream tcp nowait root /usr/sbin/tcpd /usr/lib/heimdal-servers/kadmind"
hprop_entry="#krb_prop stream tcp nowait root /usr/sbin/tcpd /usr/sbin/hpropd"
update-inetd --group KRB5 --add "$kadmin_entry"
update-inetd --group KRB5 --add "$hprop_entry"
}
enable_servers() {
update-inetd --pattern '[ \t]/usr/lib/heimdal-servers/kadmind' --enable kerberos-adm
}
# if not configured but config exists in wrong place, try moving existing configuration
if [ ! -f /etc/heimdal-kdc/.configured ] &&
[ -f /var/lib/heimdal-kdc/.configured ]
then
for i in kdc.conf kadmind.acl
do
if [ -f /var/lib/heimdal-kdc/$i ]
then
mv /var/lib/heimdal-kdc/$i /etc/heimdal-kdc/$i
ln -s /etc/heimdal-kdc/$i /var/lib/heimdal-kdc/$i
fi
done
mv /var/lib/heimdal-kdc/.configured /etc/heimdal-kdc/.configured
fi
# Sample kdc.conf was broken in older versions, create symlink to kadmind.acl
# as a work around
if [ -n "$2" ] && dpkg --compare-versions "$2" lt 1.2.dfsg.1-3; then
# also check to make sure that the symlink to kdc.conf exists - it is
# required
for i in kdc.conf kadmind.acl
do
if [ ! -e /var/lib/heimdal-kdc/$i ]
then
ln -s /etc/heimdal-kdc/$i /var/lib/heimdal-kdc/$i
fi
done
fi
# if already configured - dont reconfigure
if [ ! -f /etc/heimdal-kdc/.configured ]
then
db_get heimdal/realm; REALM="$RET"
# get password
db_get heimdal-kdc/password; PASSWORD="$RET"
db_set heimdal-kdc/password ""
# do stuff
DST=/etc/heimdal-kdc/kdc.conf
zcat /usr/share/doc/heimdal-kdc/examples/kdc.conf.gz > "$DST"
# note this symlink is required as we haven't patched the source
if [ ! -e /var/lib/heimdal-kdc/kdc.conf ]
then
ln -s "$DST" /var/lib/heimdal-kdc/kdc.conf
fi
DST=/etc/heimdal-kdc/kadmind.acl
cp -a /usr/share/doc/heimdal-kdc/examples/kadmind.acl "$DST"
kstash --master-key-fd=0 <<EOF
$PASSWORD
EOF
kadmin -l init --realm-max-ticket-life=unlimited --realm-max-renewable-life=unlimited "$REALM"
touch /etc/heimdal-kdc/.configured
fi
case "$1" in
abort-upgrade | abort-deconfigure | abort-remove)
;;
configure)
if [ -z "$2" ]
then
add_servers
elif dpkg --compare-versions "$2" le "0.7.2.dfsg.1-6"
then
enable_servers
fi
;;
*)
printf "$0: incorrect arguments: $*\n" >&2
exit 1
;;
esac
# Automatically added by dh_installinit
if [ -x "/etc/init.d/heimdal-kdc" ]; then
if [ ! -e "/etc/init/heimdal-kdc.conf" ]; then
update-rc.d heimdal-kdc defaults >/dev/null
fi
invoke-rc.d heimdal-kdc start || exit $?
fi
# End automatically added section
|