/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: 2008-09-19 00:00:51 UTC
  • Revision ID: teddy@fukt.bsnet.se-20080919000051-tgm5erxuj0zhs867
* debian/mandos-client.README.Debian: Document "eth0" default and how
                                      to change it.

* debian/mandos-client.postrm (update_initramfs): Use "type" instead
                                                  of "which".

* plugin-runner.c (handle_sigchld, print_out_password): Declared
                                                        static.

* plugin-runner.xml (SYNOPSIS, OPTIONS): Changed "VAR" to "ENV" in the
                                         "--global-env" option to be
                                         consistent with the
                                         "--env-for" 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 nobody \
 
56
                || echo ::65534::::; } \
 
57
        | awk --field-separator=: '{ print $3 }'`" 
 
58
mandos_group="`{ getent group mandos \
 
59
                || getent group nogroup \
 
60
                || echo ::65534:; } \
 
61
        | awk --field-separator=: '{ print $3 }'`"
61
62
 
62
63
# The Mandos network client uses the network
63
64
auto_add_modules net
88
89
        continue
89
90
    fi
90
91
    case "$base" in
91
 
        *~|.*|\#*\#|*.dpkg-old|*.dpkg-bak|*.dpkg-new|*.dpkg-divert)
92
 
            : ;;
93
 
        "*") echo "W: Mandos client plugin directory is empty." >&2 ;;
94
 
        *) copy_exec "$file" "${PLUGINDIR}" ;;
 
92
        *~|.*|\#*\#|*.dpkg-old|*.dpkg-new|*.dpkg-divert) : ;;
 
93
        "*") :;;
 
94
        *) copy_exec "$file" "${PLUGINDIR}";;
95
95
    esac
96
96
done
97
97
 
99
99
for file in /etc/mandos/plugins.d/*; do
100
100
    base="`basename \"$file\"`"
101
101
    case "$base" in
102
 
        *~|.*|\#*\#|*.dpkg-old|*.dpkg-bak|*.dpkg-new|*.dpkg-divert)
103
 
            : ;;
104
 
        "*") : ;;
105
 
        *) copy_exec "$file" "${PLUGINDIR}" ;;
 
102
        *~|.*|\#*\#|*.dpkg-old|*.dpkg-new|*.dpkg-divert) : ;;
 
103
        "*") :;;
 
104
        *) copy_exec "$file" "${PLUGINDIR}";;
106
105
    esac
107
106
done
108
107
 
114
113
fi
115
114
 
116
115
# Config files
117
 
for file in /etc/mandos/plugin-runner.conf; do
 
116
for file in /etc/mandos/*; do
118
117
    if [ -d "$file" ]; then
119
118
        continue
120
119
    fi
121
120
    cp --archive --sparse=always "$file" "${DESTDIR}${CONFDIR}"
122
121
done
123
122
 
124
 
if [ ${mandos_user} != 65534 ]; then
125
 
    sed --in-place --expression="1i--userid=${mandos_user}" \
126
 
        "${DESTDIR}${CONFDIR}/plugin-runner.conf"
127
 
fi
128
 
 
129
 
if [ ${mandos_group} != 65534 ]; then
130
 
    sed --in-place --expression="1i--groupid=${mandos_group}" \
131
 
        "${DESTDIR}${CONFDIR}/plugin-runner.conf"
132
 
fi
133
 
 
134
123
# Key files 
135
 
for file in "$keydir"/*; do
 
124
for file in  "$keydir"/*; do
136
125
    if [ -d "$file" ]; then
137
126
        continue
138
127
    fi
167
156
        chmod a+rX "${DESTDIR}$dir"
168
157
    fi
169
158
done
170
 
for dir in "${DESTDIR}"/lib* "${DESTDIR}"/usr/lib*; do
171
 
    if [ -d "$dir" ]; then
172
 
        find "$dir" \! -perm -u+rw,g+r -prune -or -print0 \
173
 
            | xargs --null --no-run-if-empty chmod a+rX
174
 
    fi
 
159
for dir in /lib /usr/lib; do
 
160
    find "${DESTDIR}$dir" \! -perm -u+rw,g+r -prune -or -print0 \
 
161
        | xargs --null --no-run-if-empty chmod a+rX
175
162
done