-# handle openldap upgrade
-upgrade_openldap () {
- # aai discovers database type from debconf
- if [ -f /etc/ldap/slapd.conf ] && grep -q ^database.*bdb /etc/ldap/slapd.conf
- then
- echo set slapd/backend BDB | debconf-communicate >/dev/null
+ # sync localhost passwords
+ if pkg libpam-radius-auth && [ -f "/etc/pam_radius_auth.conf" ]; then
+ pkgadd libpam-radius-auth
+ password=$(
+ sed -n '/^[[:space:]]*client[[:space:]]\+localhost/,/^[[:space:]]*}/ { /^[[:space:]]*secret[[:space:]]*=[[:space:]]*\([^[:space:]]*\)/s//\1/p }' /etc/freeradius/clients.conf
+ )
+ if [ "$password" ] \
+ && ! grep -q "^127.0.0.1[[:space:]]\+$password[[:space:]]\+" \
+ /etc/pam_radius_auth.conf
+ then
+ sed -i.$backup_ext "s/^\(127.0.0.1[[:space:]]*\)[^[:space:]]*\(.*\)/\1$password\2/" /etc/pam_radius_auth.conf
+ fi