/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 initramfs-tools-hook

  • Committer: Teddy Hogeborn
  • Date: 2009-02-13 05:38:21 UTC
  • Revision ID: teddy@fukt.bsnet.se-20090213053821-03e696gckk4nbjps
Support not using IPv6 in server:

* mandos (AvahiService.__init__): Take new "protocol" parameter.  All
                                  callers changed.
  (IPv6_TCPServer.__init__): Take new "use_ipv6" parameter.  All
                             callers changed.
  (IPv6_TCPServer.server_bind): Create IPv4 socket if not using IPv6.
  (main): New "--no-ipv6" command line option.  New "use_ipv6" config
          option.
* mandos-options.xml ([@id="address"]): Document conditional IPv4
                                        address support.
  ([@id="ipv6"]): New paragraph.
* mandos.conf (use_ipv6): New config option.
* mandos.conf.xml (OPTIONS): Document new "use_dbus" option.
  (EXAMPLE): Changed to use IPv6 link-local address.  Added "use_ipv6"
             option.
* mandos.xml (SYNOPSIS): New "--no-ipv6" option.
  (OPTIONS): Document new "--no-ipv6" option.

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
    exit 1
52
52
fi
53
53
 
54
 
set `{ getent passwd _mandos \
55
 
    || getent passwd nobody \
56
 
    || echo ::65534:65534:::; } \
57
 
    | cut --delimiter=: --fields=3,4 --only-delimited \
58
 
    --output-delimiter=" "`
59
 
mandos_user="$1"
60
 
mandos_group="$2"
 
54
mandos_user="`{ getent passwd _mandos \
 
55
                || getent passwd mandos \
 
56
                || getent passwd nobody \
 
57
                || echo ::65534::::; } \
 
58
        | awk --field-separator=: '{ print $3 }'`" 
 
59
mandos_group="`{ getent group _mandos \
 
60
                || getent group mandos \
 
61
                || getent group nogroup \
 
62
                || echo ::65534:; } \
 
63
        | awk --field-separator=: '{ print $3 }'`"
61
64
 
62
65
# The Mandos network client uses the network
63
66
auto_add_modules net
88
91
        continue
89
92
    fi
90
93
    case "$base" in
91
 
        *~|.*|\#*\#|*.dpkg-old|*.dpkg-bak|*.dpkg-new|*.dpkg-divert)
92
 
            : ;;
93
 
        "*") echo "W: Mandos client plugin directory is empty." >&2 ;;
 
94
        *~|.*|\#*\#|*.dpkg-old|*.dpkg-bak|*.dpkg-new|*.dpkg-divert) : ;;
 
95
        "*") : ;;
94
96
        *) copy_exec "$file" "${PLUGINDIR}" ;;
95
97
    esac
96
98
done
99
101
for file in /etc/mandos/plugins.d/*; do
100
102
    base="`basename \"$file\"`"
101
103
    case "$base" in
102
 
        *~|.*|\#*\#|*.dpkg-old|*.dpkg-bak|*.dpkg-new|*.dpkg-divert)
103
 
            : ;;
 
104
        *~|.*|\#*\#|*.dpkg-old|*.dpkg-bak|*.dpkg-new|*.dpkg-divert) : ;;
104
105
        "*") : ;;
105
106
        *) copy_exec "$file" "${PLUGINDIR}" ;;
106
107
    esac
114
115
fi
115
116
 
116
117
# Config files
117
 
for file in /etc/mandos/plugin-runner.conf; do
 
118
for file in /etc/mandos/*; do
118
119
    if [ -d "$file" ]; then
119
120
        continue
120
121
    fi
122
123
done
123
124
 
124
125
if [ ${mandos_user} != 65534 ]; then
125
 
    sed --in-place --expression="1i--userid=${mandos_user}" \
126
 
        "${DESTDIR}${CONFDIR}/plugin-runner.conf"
 
126
    PLUGINRUNNERCONF="${DESTDIR}${CONFDIR}/plugin-runner.conf"
 
127
    cat <<-EOF >> "$PLUGINRUNNERCONF"
 
128
        
 
129
        --userid=${mandos_user}
 
130
EOF
127
131
fi
128
132
 
129
133
if [ ${mandos_group} != 65534 ]; then
130
 
    sed --in-place --expression="1i--groupid=${mandos_group}" \
131
 
        "${DESTDIR}${CONFDIR}/plugin-runner.conf"
 
134
    PLUGINRUNNERCONF="${DESTDIR}${CONFDIR}/plugin-runner.conf"
 
135
    cat <<-EOF >> "$PLUGINRUNNERCONF"
 
136
        
 
137
        --groupid=${mandos_group}
 
138
EOF
132
139
fi
133
140
 
134
141
# Key files