/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

* README (The Plugin System): Improve wording.

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
    exit 1
52
52
fi
53
53
 
54
 
mandos_user="`{ getent passwd mandos \
 
54
mandos_user="`{ getent passwd _mandos \
 
55
                || getent passwd mandos \
55
56
                || getent passwd nobody \
56
57
                || echo ::65534::::; } \
57
 
        | awk --field-separator=: '{ print $3 }'`" 
58
 
mandos_group="`{ getent group mandos \
 
58
        | cut --delimiter=: --fields=3 --only-delimited
 
59
mandos_group="`{ getent group _mandos \
 
60
                || getent group mandos \
59
61
                || getent group nogroup \
60
62
                || echo ::65534:; } \
61
 
        | awk --field-separator=: '{ print $3 }'`"
 
63
        | cut --delimiter=: --fields=3 --only-delimited
62
64
 
63
65
# The Mandos network client uses the network
64
66
auto_add_modules net
89
91
        continue
90
92
    fi
91
93
    case "$base" in
92
 
        *~|.*|\#*\#|*.dpkg-old|*.dpkg-new|*.dpkg-divert) : ;;
93
 
        "*") :;;
94
 
        *) copy_exec "$file" "${PLUGINDIR}";;
 
94
        *~|.*|\#*\#|*.dpkg-old|*.dpkg-bak|*.dpkg-new|*.dpkg-divert) : ;;
 
95
        "*") : ;;
 
96
        *) copy_exec "$file" "${PLUGINDIR}" ;;
95
97
    esac
96
98
done
97
99
 
99
101
for file in /etc/mandos/plugins.d/*; do
100
102
    base="`basename \"$file\"`"
101
103
    case "$base" in
102
 
        *~|.*|\#*\#|*.dpkg-old|*.dpkg-new|*.dpkg-divert) : ;;
103
 
        "*") :;;
104
 
        *) copy_exec "$file" "${PLUGINDIR}";;
 
104
        *~|.*|\#*\#|*.dpkg-old|*.dpkg-bak|*.dpkg-new|*.dpkg-divert) : ;;
 
105
        "*") : ;;
 
106
        *) copy_exec "$file" "${PLUGINDIR}" ;;
105
107
    esac
106
108
done
107
109
 
120
122
    cp --archive --sparse=always "$file" "${DESTDIR}${CONFDIR}"
121
123
done
122
124
 
 
125
if [ ${mandos_user} != 65534 ]; then
 
126
    PLUGINRUNNERCONF="${DESTDIR}${CONFDIR}/plugin-runner.conf"
 
127
    cat <<-EOF >> "$PLUGINRUNNERCONF"
 
128
        
 
129
        --userid=${mandos_user}
 
130
EOF
 
131
fi
 
132
 
 
133
if [ ${mandos_group} != 65534 ]; then
 
134
    PLUGINRUNNERCONF="${DESTDIR}${CONFDIR}/plugin-runner.conf"
 
135
    cat <<-EOF >> "$PLUGINRUNNERCONF"
 
136
        
 
137
        --groupid=${mandos_group}
 
138
EOF
 
139
fi
 
140
 
123
141
# Key files 
124
 
for file in  "$keydir"/*; do
 
142
for file in "$keydir"/*; do
125
143
    if [ -d "$file" ]; then
126
144
        continue
127
145
    fi
156
174
        chmod a+rX "${DESTDIR}$dir"
157
175
    fi
158
176
done
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
 
177
for dir in "${DESTDIR}"/lib* "${DESTDIR}"/usr/lib*; do
 
178
    if [ -d "$dir" ]; then
 
179
        find "$dir" \! -perm -u+rw,g+r -prune -or -print0 \
 
180
            | xargs --null --no-run-if-empty chmod a+rX
 
181
    fi
162
182
done