/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

Tags: version-1.0.10-1
* Makefile (version): Changed to "1.0.10".
* NEWS (Version 1.0.10): New entry.
* debian/changelog (1.0.10-1): - '' -

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
 
122
124
 
123
125
if [ ${mandos_user} != 65534 ]; then
124
126
    PLUGINRUNNERCONF="${DESTDIR}${CONFDIR}/plugin-runner.conf"
125
 
    echo "--userid=${mandos_user}" >> "$PLUGINRUNNERCONF"
 
127
    cat <<-EOF >> "$PLUGINRUNNERCONF"
 
128
        
 
129
        --userid=${mandos_user}
 
130
EOF
126
131
fi
127
132
 
128
133
if [ ${mandos_group} != 65534 ]; then
129
134
    PLUGINRUNNERCONF="${DESTDIR}${CONFDIR}/plugin-runner.conf"
130
 
    echo "--groupid=${mandos_group}" >> "$PLUGINRUNNERCONF"
 
135
    cat <<-EOF >> "$PLUGINRUNNERCONF"
 
136
        
 
137
        --groupid=${mandos_group}
 
138
EOF
131
139
fi
132
140
 
133
141
# Key files 
134
 
for file in  "$keydir"/*; do
 
142
for file in "$keydir"/*; do
135
143
    if [ -d "$file" ]; then
136
144
        continue
137
145
    fi
166
174
        chmod a+rX "${DESTDIR}$dir"
167
175
    fi
168
176
done
169
 
for dir in /lib /usr/lib; do
170
 
    find "${DESTDIR}$dir" \! -perm -u+rw,g+r -prune -or -print0 \
171
 
        | 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
172
182
done