/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: 2009-01-12 22:02:33 UTC
  • Revision ID: teddy@fukt.bsnet.se-20090112220233-lawxo4uvyzb38u1f
* README (The Plugin System): Removed redundant text about options and
                              files for the plugins, this is now
                              documented in the manuals for the
                              plugins.

* plugins.d/mandos-client.c (main): Remove comment which was copied
                                    from another program by mistake.
                                    Use "sscanf" instead of "strtol"
                                    to parse numbers; this uses the
                                    correct type instead of casting.
                                    Don't report errors when removing
                                    temporary directory if directory
                                    is already gone.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
# If prerm fails during replacement due to conflict:
16
16
#       <postinst> abort-remove in-favour <new-package> <version>
17
17
 
18
 
. /usr/share/debconf/confmodule
19
 
 
20
18
# Update the initial RAM file system image
21
19
update_initramfs()
22
20
{
27
25
 
28
26
# Add user and group
29
27
add_mandos_user(){
30
 
    if ! getent passwd mandos >/dev/null; then
31
 
        adduser --disabled-password  --quiet --system \
32
 
            --home /nonexistent --no-create-home \
33
 
            --gecos "Mandos password system" --group mandos
 
28
    # Rename old "mandos" user and group
 
29
    case "$(getent passwd mandos)" in
 
30
        *:Mandos\ password\ system,,,:/nonexistent:/bin/false)
 
31
            usermod --login _mandos mandos
 
32
            groupmod --new-name _mandos mandos
 
33
            return
 
34
            ;;
 
35
    esac
 
36
    # Create new user and group
 
37
    if ! getent passwd _mandos >/dev/null; then
 
38
        adduser --system --force-badname --quiet --home /nonexistent \
 
39
            --no-create-home --group --disabled-password \
 
40
            --gecos "Mandos password system" _mandos
34
41
    fi
35
42
}
36
43