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

  • Committer: Teddy Hogeborn
  • Date: 2009-01-13 04:29:35 UTC
  • Revision ID: teddy@fukt.bsnet.se-20090113042935-ztxe47n42q5z767b
* plugin-runner.c (main): Bug fix; do not accept a "d" character after
                          user ID or group ID numbers.  Bug fix: use
                          "%u" when printing PID of coredumped plugin,
                          not "%d".
* plugins.d/password-prompt.c (main): Remove comment which was copied
                                      from another program by mistake.
* plugins.d/splashy.c: Only comment changes.
* plugins.d/usplash.c: - '' -

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh
 
1
#!/bin/bash -e
2
2
# This script can be called in the following ways:
3
3
#
4
4
# After the package was installed:
15
15
# If prerm fails during replacement due to conflict:
16
16
#       <postinst> abort-remove in-favour <new-package> <version>
17
17
 
18
 
set -e
19
 
 
20
18
case "$1" in
21
19
    configure)
22
20
        # Rename old "mandos" user and group
23
 
        if dpkg --compare-versions "$2" lt "1.0.3-1"; then
24
 
            case "`getent passwd mandos`" in
25
 
                *:Mandos\ password\ system,,,:/nonexistent:/bin/false)
26
 
                    usermod --login _mandos mandos
27
 
                    groupmod --new-name _mandos mandos
28
 
                    ;;
29
 
            esac
30
 
        fi
 
21
        case "$(getent passwd mandos)" in
 
22
            *:Mandos\ password\ system,,,:/nonexistent:/bin/false)
 
23
                usermod --login _mandos mandos
 
24
                groupmod --new-name _mandos mandos
 
25
                ;;
 
26
        esac
31
27
        # Create new user and group
32
28
        if ! getent passwd _mandos >/dev/null; then
33
29
            adduser --system --force-badname --quiet \
35
31
                --disabled-password --gecos "Mandos password system" \
36
32
                _mandos
37
33
        fi
38
 
        chown _mandos:_mandos /var/lib/mandos
39
34
        ;;
40
 
    
 
35
 
41
36
    abort-upgrade|abort-deconfigure|abort-remove)
42
37
        ;;
43
 
    
 
38
 
44
39
    *)
45
 
        echo "$0 called with unknown argument '$1'" 1>&2
 
40
        echo "$0 called with unknown argument \`$1'" 1>&2
46
41
        exit 1
47
42
        ;;
48
43
esac