This file is indexed.

postinst is in bdii 5.2.23-1.

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
#!/bin/sh

set -e

confhandler () {
    conffile=$1
    template=$2
    if [ -r $conffile ] ; then
	pwd=`grep '^rootpw ' $conffile | head -1 | sed 's/rootpw *//'`
    fi
    if [ -z "$pwd" -o "$pwd" = "secret" ] ; then
	pwd=`mkpasswd -s 0 | tr '/' 'x'`
    fi
    tempfile=`mktemp`
    sed "s/\(rootpw *\)secret/\1$pwd/" $template > $tempfile
    ucf $tempfile $conffile
    rm $tempfile
    chown openldap:openldap $conffile
}

if [ "$1" = "configure" ] ; then
    confhandler /etc/bdii/bdii-slapd.conf /usr/share/bdii/bdii-slapd.conf
    confhandler /etc/bdii/bdii-top-slapd.conf /usr/share/bdii/bdii-top-slapd.conf

    chown openldap:openldap /var/lib/bdii
    chown openldap:openldap /var/lib/bdii/gip
    chown openldap:openldap /var/lib/bdii/gip/ldif
    chown openldap:openldap /var/lib/bdii/gip/provider
    chown openldap:openldap /var/lib/bdii/gip/plugin
    chown openldap:openldap /var/log/bdii
fi

# Old versions with slapd configs listed in conffiles
dpkg-maintscript-helper rm_conffile \
    /etc/bdii/bdii-slapd.conf 5.2.5-2+wheezy1~ bdii -- "$@"
dpkg-maintscript-helper rm_conffile \
    /etc/bdii/bdii-top-slapd.conf 5.2.5-2+wheezy1~ bdii -- "$@"

# Remove obsolete cron script left behind by dpkg
dpkg-maintscript-helper rm_conffile \
    /etc/cron.d/bdii-proxy 5.2.5-2+wheezy1~ bdii -- "$@"

if [ "$1" = "configure" ] ; then
    APP_PROFILE=/etc/apparmor.d/usr.sbin.slapd
    LOCAL_APP_PROFILE=/etc/apparmor.d/local/usr.sbin.slapd

    if [ ! -r "$LOCAL_APP_PROFILE" ] ; then
	# Create the local profile if it does not yet exist
        tmp=`mktemp`
        cat <<EOM > "$tmp"
# Site-specific additions and overrides for usr.sbin.slapd.
# For more details, please see /etc/apparmor.d/local/README.
EOM
        mkdir -p `dirname $LOCAL_APP_PROFILE` 2>/dev/null || true
        mv -f "$tmp" "$LOCAL_APP_PROFILE"
        chmod 644 "$LOCAL_APP_PROFILE"
    fi

    grep -q "AppArmor profile for bdii" "$LOCAL_APP_PROFILE" || \
    cat <<EOM >> "$LOCAL_APP_PROFILE"
# AppArmor profile for bdii START
  #include <abstractions/p11-kit>
  /etc/bdii/* r,
  /var/lib/bdii/db/** rwk,
  /{,var/}run/bdii/db/* w,
# AppArmor profile for bdii END
EOM

    if [ -r "$APP_PROFILE" ] ; then
	# Reload the profile
	if aa-status --enabled 2>/dev/null ; then
            apparmor_parser -r -T -W "$APP_PROFILE" || true
	fi
    fi
fi

# Automatically added by dh_installinit
if [ -x "/etc/init.d/bdii" ]; then
	update-rc.d bdii defaults >/dev/null
	invoke-rc.d bdii start || exit $?
fi
# End automatically added section