/mandos/release

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/release

« back to all changes in this revision

Viewing changes to initramfs-tools-hook

* plugin-runner.c: Minor stylistic changes.

* plugins.d/askpass-fifo.c: Changed contact information and did minor
                            stylistic changes.

* plugins.d/mandos-client.c: Minor stylistic changes.

* plugins.d/password-prompt.c: Changed contact information.

* plugins.d/splashy.c: Changed contact information.
  (main): Changed error handling design.  Bug fix: Will now be much
          more tolerant against signals.  Bug fix: Will now re-raise
          signal received.

* plugins.d/usplash.c: Changed contact information and did minor
                       stylistic changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
    exit 1
41
41
fi
42
42
 
43
 
for d in /etc/keys/mandos /usr/local/lib/mandos/keys; do
 
43
for d in /etc/keys/mandos /etc/mandos/keys; do
44
44
    if [ -d "$d" ]; then
45
45
        keydir="$d"
46
46
        break
51
51
    exit 1
52
52
fi
53
53
 
54
 
mandos_user="`{ getent passwd mandos \
55
 
        || getent passwd nobody \
56
 
        || echo ::65534::::; } | awk -F: '{ print $3 }'`" 
57
 
mandos_group="`{ getent group mandos \
58
 
        || getent group nogroup \
59
 
        || echo ::65534:; } | awk -F: '{ print $3 }'`"
 
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"
60
61
 
61
62
# The Mandos network client uses the network
62
63
auto_add_modules net
87
88
        continue
88
89
    fi
89
90
    case "$base" in
90
 
        *~|.*|\#*\#|*.dpkg-old|*.dpkg-new|*.dpkg-divert) : ;;
91
 
        "*") :;;
92
 
        *) copy_exec "$file" "${PLUGINDIR}";;
 
91
        *~|.*|\#*\#|*.dpkg-old|*.dpkg-bak|*.dpkg-new|*.dpkg-divert)
 
92
            : ;;
 
93
        */"*")
 
94
            echo "W: Mandos client plugin directory is empty." >&2 ;;
 
95
        *) copy_exec "$file" "${PLUGINDIR}" ;;
93
96
    esac
94
97
done
95
98
 
97
100
for file in /etc/mandos/plugins.d/*; do
98
101
    base="`basename \"$file\"`"
99
102
    case "$base" in
100
 
        *~|.*|\#*\#|*.dpkg-old|*.dpkg-new|*.dpkg-divert) : ;;
101
 
        "*") :;;
102
 
        *) copy_exec "$file" "${PLUGINDIR}";;
 
103
        *~|.*|\#*\#|*.dpkg-old|*.dpkg-bak|*.dpkg-new|*.dpkg-divert)
 
104
            : ;;
 
105
        */"*") : ;;
 
106
        *) copy_exec "$file" "${PLUGINDIR}" ;;
103
107
    esac
104
108
done
105
109
 
106
110
# GPGME needs /usr/bin/gpg
107
 
if ! [ -e "${DESTDIR}/usr/bin/gpg" ] \
108
 
    && [ -n "`ls \"${DESTDIR}\"/usr/lib/libgpgme.so* 2>/dev/null`" ]; then
 
111
if [ ! -e "${DESTDIR}/usr/bin/gpg" \
 
112
    -a -n "`ls \"${DESTDIR}\"/usr/lib/libgpgme.so* \
 
113
                2>/dev/null`" ]; then
109
114
    copy_exec /usr/bin/gpg
110
115
fi
111
116
 
117
122
    cp --archive --sparse=always "$file" "${DESTDIR}${CONFDIR}"
118
123
done
119
124
 
 
125
if [ ${mandos_user} != 65534 ]; then
 
126
    sed --in-place --expression="1i--userid=${mandos_user}" \
 
127
        "${DESTDIR}${CONFDIR}/plugin-runner.conf"
 
128
fi
 
129
 
 
130
if [ ${mandos_group} != 65534 ]; then
 
131
    sed --in-place --expression="1i--groupid=${mandos_group}" \
 
132
        "${DESTDIR}${CONFDIR}/plugin-runner.conf"
 
133
fi
 
134
 
120
135
# Key files 
121
 
for file in  "$keydir"/*; do
 
136
for file in "$keydir"/*; do
122
137
    if [ -d "$file" ]; then
123
138
        continue
124
139
    fi
153
168
        chmod a+rX "${DESTDIR}$dir"
154
169
    fi
155
170
done
156
 
for dir in /lib /usr/lib; do
157
 
    find "${DESTDIR}$dir" \! -perm -u+rw,g+r -prune -o -print0 \
158
 
        | xargs --null --no-run-if-empty chmod a+rX
 
171
for dir in "${DESTDIR}"/lib* "${DESTDIR}"/usr/lib*; do
 
172
    if [ -d "$dir" ]; then
 
173
        find "$dir" \! -perm -u+rw,g+r -prune -or -print0 \
 
174
            | xargs --null --no-run-if-empty chmod a+rX
 
175
    fi
159
176
done