/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-07 04:50:39 UTC
  • Revision ID: teddy@fukt.bsnet.se-20090207045039-xkr6b80vtqwqrq8l
* Makefile (install-client-nokey): Move "initramfs-tools-script" from
                                   "/scripts/local-top/mandos" to
                                   "/scripts/init-premount/mandos".
  (uninstall-client): - '' -
* debian/mandos-client.dirs: - '' -
* initramfs-tools-script (PREREQ): Added "udev".

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
58
        | awk --field-separator=: '{ print $3 }'`" 
58
 
mandos_group="`{ getent group mandos \
 
59
mandos_group="`{ getent group _mandos \
 
60
                || getent group mandos \
59
61
                || getent group nogroup \
60
62
                || echo ::65534:; } \
61
63
        | awk --field-separator=: '{ print $3 }'`"
89
91
        continue
90
92
    fi
91
93
    case "$base" in
92
 
        *~|.*|\#*\#|*.dpkg-old|*.dpkg-new|*.dpkg-divert) : ;;
 
94
        *~|.*|\#*\#|*.dpkg-old|*.dpkg-bak|*.dpkg-new|*.dpkg-divert) : ;;
93
95
        "*") :;;
94
96
        *) copy_exec "$file" "${PLUGINDIR}";;
95
97
    esac
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) : ;;
 
104
        *~|.*|\#*\#|*.dpkg-old|*.dpkg-bak|*.dpkg-new|*.dpkg-divert) : ;;
103
105
        "*") :;;
104
106
        *) copy_exec "$file" "${PLUGINDIR}";;
105
107
    esac
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
    echo "--userid=${mandos_user}" >> "$PLUGINRUNNERCONF"
 
128
fi
 
129
 
 
130
if [ ${mandos_group} != 65534 ]; then
 
131
    PLUGINRUNNERCONF="${DESTDIR}${CONFDIR}/plugin-runner.conf"
 
132
    echo "--groupid=${mandos_group}" >> "$PLUGINRUNNERCONF"
 
133
fi
 
134
 
123
135
# Key files 
124
136
for file in  "$keydir"/*; do
125
137
    if [ -d "$file" ]; then
156
168
        chmod a+rX "${DESTDIR}$dir"
157
169
    fi
158
170
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
 
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
162
176
done