/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to debian/mandos-client.postinst

  • Committer: Teddy Hogeborn
  • Date: 2013-10-20 15:25:09 UTC
  • Revision ID: teddy@recompile.se-20131020152509-zkhuy2yse76w10hg
* Makefile (CFLAGS, LDFLAGS): Keep default flags from environment.
  (purge-server): PID file changed to "/run/mandos.pid".
* debian/compat: Changed to "9".
* debian/control (Standards-Version): Updated to "3.9.4".
  (DM-Upload-Allowed): Removed.
  (mandos/Depends): Add "initscripts (>= 2.88dsf-13.3)" to be able to
                    use the "/run" directory (for mandos.pid).
* debian/copyright (Copyright): Update year.
* init.d-mandos (PIDFILE): Changed to "/run/mandos.pid".
* mandos: Update copyright year.
  (pidfilename): Changed to "/run/mandos.pid".
* mandos-clients.conf.xml (OPTIONS/approval_delay): Bug fix: default
                                                    is "PT0S" - using
                                                    the new RFC 3339
                                                    duration syntax.
* mandos-keygen: Update copyright year.
* mandos-monitor: - '' -
* mandos.conf.xml: - '' -
* mandos.xml: - '' -
  (FILES): PID file changed to "/run/mandos.pid".
* plugin-runner.c: Update copyright year.
* plugins.d/mandos-client.c: - '' -
* plugins.d/mandos-client.xml: - '' -
* plugins.d/password-prompt.c: - '' -
* plugins.d/plymouth.c: - '' -

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
# Update the initial RAM file system image
21
21
update_initramfs()
22
22
{
23
 
    update-initramfs -u -k all
 
23
    if [ -x /usr/sbin/update-initramfs ]; then
 
24
        update-initramfs -u -k all
 
25
    fi
24
26
    
25
27
    if dpkg --compare-versions "$2" lt-nl "1.0.10-1"; then
26
28
        # Make old initrd.img files unreadable too, in case they were
56
58
        -a -r /etc/keys/mandos/seckey.txt ]; then
57
59
        return 0
58
60
    fi
59
 
    mandos-keygen
60
 
    gpg-connect-agent KILLAGENT /bye || :
61
 
}
62
 
 
63
 
create_dh_params(){
64
 
    if [ -r /etc/keys/mandos/dhparams.pem ]; then
65
 
        return 0
66
 
    fi
67
 
    # Create a Diffe-Hellman parameters file
68
 
    DHFILE="`mktemp -t mandos-client-dh-parameters.XXXXXXXXXX.pem`"
69
 
    # First try certtool from GnuTLS
70
 
    if ! certtool --generate-dh-params --sec-param high \
71
 
         --outfile "$DHFILE"; then
72
 
        # Otherwise try OpenSSL
73
 
        if ! openssl genpkey -genparam -algorithm DH -out "$DHFILE" \
74
 
             -pkeyopt dh_paramgen_prime_len:3072; then
75
 
            # None of the commands succeded; give up
76
 
            rm -- "$DHFILE"
77
 
            return 1
78
 
        fi
79
 
    fi
80
 
    sed --in-place --expression='0,/^-----BEGIN DH PARAMETERS-----$/d' \
81
 
        "$DHFILE"
82
 
    sed --in-place --expression='1i-----BEGIN DH PARAMETERS-----' \
83
 
            "$DHFILE"
84
 
    cp --archive "$DHFILE" /etc/keys/mandos/dhparams.pem
85
 
    rm -- "$DHFILE"
 
61
    if [ -x /usr/sbin/mandos-keygen ]; then
 
62
        mandos-keygen
 
63
    fi
86
64
}
87
65
 
88
66
case "$1" in
89
67
    configure)
90
68
        add_mandos_user "$@"
91
69
        create_key "$@"
92
 
        create_dh_params "$@" || :
93
70
        update_initramfs "$@"
94
 
        if dpkg --compare-versions "$2" lt-nl "1.7.10-1"; then
95
 
            PLUGINHELPERDIR=/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null)/mandos/plugin-helpers
96
 
            if ! dpkg-statoverride --list "$PLUGINHELPERDIR" \
97
 
                 >/dev/null 2>&1; then
98
 
                chmod u=rwx,go= -- "$PLUGINHELPERDIR"
99
 
            fi
100
 
            if ! dpkg-statoverride --list /etc/mandos/plugin-helpers \
101
 
                 >/dev/null 2>&1; then
102
 
                chmod u=rwx,go= -- /etc/mandos/plugin-helpers
103
 
            fi
104
 
        fi
105
71
        ;;
106
72
    abort-upgrade|abort-deconfigure|abort-remove)
107
73
        ;;