/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.postrm

  • Committer: Teddy Hogeborn
  • Date: 2008-07-21 15:34:44 UTC
  • Revision ID: teddy@fukt.bsnet.se-20080721153444-lugbjkj1oq65ugq3
* Makefile (CFLAGS): Changed to use $(WARN), $(DEBUG), $(COVERAGE) and
                     $(LANGUAGE).
  (WARN, DEBUG, COVERAGE, LANGUAGE): New.
  (LDFLAGS): New; use $(COVERAGE)

* plugbasedclient.c: Added copyright header.
  (process.buffer_size, process.buffer_length): Changed to "size_t".
  (main): Cast arguments to malloc and realloc.  Detect read errors
          from processes.

* mandosclient.c: Added copyright header.
  (interface): Moved to inside "main".
  (gpg_packet_decrypt): Renamed to "pgp_packet_decrypt"; all callers
                        changed.  Changed "new_packet_capacity" and
                        "new_packet_length" to be ssize_t.  Cast
                        arguments to realloc.
  (debuggnutls): Attribute "level" argument as unused.
  (empty_log): Attribute "level" and "txt" arguments as unused.
  (start_mandos_communication): New argument "if_index".  Bug fix:
                                check ret, no tcp_sd, for errors from
                                setsockopt.  Use "if_index" directly
                                instead of looking up the index.  Loop
                                around fwrite until all data is written.
  (resolve_callback): Attribute "txt", and "flags" as usused.  Added
                      default case to switch.  Also show server host
                      name.  Call start_mandos_communication with
                      "interface".
  (browse_callback): Added default case to switch.
  (main): Variable "interface" moved here.  Cast "srand" argument.
          Bug fix: Call avahi_s_service_browser_new with index of
          "interface", not "eth0".

* passprompt.c: Added copyright header.
  (termination_handler): Attribute "signum" argument as unused.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh
2
 
# This script can be called in the following ways:
3
 
#
4
 
# After the package was removed:
5
 
#       <postrm> remove
6
 
#
7
 
# After the package was purged:
8
 
#       <postrm> purge
9
 
#
10
 
# After the package was upgraded:
11
 
#       <old-postrm> upgrade <new-version>
12
 
# if that fails:
13
 
#       <new-postrm> failed-upgrade <old-version>
14
 
#
15
 
#
16
 
# After all of the packages files have been replaced:
17
 
#       <postrm> disappear <overwriting-package> <version>
18
 
#
19
 
#
20
 
# If preinst fails during install:
21
 
#       <new-postrm> abort-install
22
 
#
23
 
# If preinst fails during upgrade of removed package:
24
 
#       <new-postrm> abort-install <old-version>
25
 
#
26
 
# If preinst fails during upgrade:
27
 
#       <new-postrm> abort-upgrade <old-version>
28
 
 
29
 
set -e
30
 
 
31
 
# Update the initial RAM file system image
32
 
update_initramfs()
33
 
{
34
 
    if command -v update-initramfs >/dev/null; then
35
 
        update-initramfs -k all -u
36
 
    elif command -v dracut >/dev/null; then
37
 
        # Logic taken from dracut.postinst
38
 
        for kernel in /boot/vmlinu[xz]-*; do
39
 
            kversion="${kernel#/boot/vmlinu[xz]-}"
40
 
            if [ "$kversion" != "*" ]; then
41
 
                /etc/kernel/postinst.d/dracut "$kversion"
42
 
            fi
43
 
        done
44
 
    fi
45
 
}
46
 
 
47
 
case "$1" in
48
 
    remove)
49
 
        update_initramfs
50
 
        ;;
51
 
 
52
 
    purge)
53
 
        shred --remove /etc/keys/mandos/seckey.txt 2>/dev/null || :
54
 
        rm --force /etc/mandos/plugin-runner.conf \
55
 
            /etc/keys/mandos/pubkey.txt \
56
 
            /etc/keys/mandos/seckey.txt \
57
 
            /etc/keys/mandos/tls-privkey.pem \
58
 
            /etc/keys/mandos/tls-pubkey.pem \
59
 
            /etc/keys/mandos/dhparams.pem 2>/dev/null
60
 
        update_initramfs
61
 
        ;;
62
 
    upgrade|failed-upgrade|disappear|abort-install|abort-upgrade)
63
 
        ;;
64
 
 
65
 
    *)
66
 
        echo "$0 called with unknown argument '$1'" 1>&2
67
 
        exit 1
68
 
        ;;
69
 
esac
70
 
 
71
 
#DEBHELPER#
72
 
 
73
 
exit 0