/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: 2012-05-12 15:45:57 UTC
  • Revision ID: teddy@recompile.se-20120512154557-r1yzcb8su8byp4us
* mandos (Client.enable, Client.disable, ClientDBus.approve): Call
                    self.send_changedstate() after change, not before.
  (Client.disable): Bug fix: Handle disable_initiator_tag and
                    checker_initiator_tag of 0.
  (Client.init_checker): Bug fix: Remove old checker_initiator_tag and
                         disable_initiator_tag, if any.
  (Client.bump_timeout): Bug fix: Remove old disable_initiator_tag, if
                         any.
  (ClientDBus.Timeout_dbus_property): Bug fix: Use self.expires.
  (ClientHandler.handle): Bug fix: timedelta_to_milliseconds is a
                          global function, not a class method.
* mandos-monitor (MandosClientWidget._update_timer_callback_lock):
  Removed.  All users changed.
  (MandosClientWidget.last_checked_ok): Removed (unused).
  (MandosClientWidget.__init__): Don't call self.using_timer().
  (MandosClientWidget.property_changed): Removed unused version.
  (MandosClientWidget.using_timer): Stop using the counter
                                    self._update_timer_callback_lock;
                                    be strictly boolean.
  (MandosClientWidget.need_approval): Don't call self.using_timer().
  (MandosClientWidget.update): Call self.using_timer() throughout.
                               Bug fix: Never show negative timers.

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
        ;;