/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

  • Committer: Teddy Hogeborn
  • Date: 2009-03-15 04:22:14 UTC
  • mfrom: (237.2.89 mandos)
  • mto: (237.2.90 mandos)
  • mto: This revision was merged to the branch mainline in revision 264.
  • Revision ID: teddy@fukt.bsnet.se-20090315042214-gvps0knkvuyewtxl
MergeĀ fromĀ trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
                || getent passwd mandos \
56
56
                || getent passwd nobody \
57
57
                || echo ::65534::::; } \
58
 
        | awk --field-separator=: '{ print $3 }'`" 
 
58
        | cut --delimiter=: --fields=3 --only-delimited`"
59
59
mandos_group="`{ getent group _mandos \
60
60
                || getent group mandos \
61
61
                || getent group nogroup \
62
62
                || echo ::65534:; } \
63
 
        | awk --field-separator=: '{ print $3 }'`"
 
63
        | cut --delimiter=: --fields=3 --only-delimited`"
64
64
 
65
65
# The Mandos network client uses the network
66
66
auto_add_modules net
92
92
    fi
93
93
    case "$base" in
94
94
        *~|.*|\#*\#|*.dpkg-old|*.dpkg-bak|*.dpkg-new|*.dpkg-divert) : ;;
95
 
        "*") :;;
96
 
        *) copy_exec "$file" "${PLUGINDIR}";;
 
95
        */"*") echo "W: Mandos client plugin directory is empty." >&2 ;;
 
96
        *) copy_exec "$file" "${PLUGINDIR}" ;;
97
97
    esac
98
98
done
99
99
 
102
102
    base="`basename \"$file\"`"
103
103
    case "$base" in
104
104
        *~|.*|\#*\#|*.dpkg-old|*.dpkg-bak|*.dpkg-new|*.dpkg-divert) : ;;
105
 
        "*") :;;
106
 
        *) copy_exec "$file" "${PLUGINDIR}";;
 
105
        */"*") : ;;
 
106
        *) copy_exec "$file" "${PLUGINDIR}" ;;
107
107
    esac
108
108
done
109
109
 
124
124
 
125
125
if [ ${mandos_user} != 65534 ]; then
126
126
    PLUGINRUNNERCONF="${DESTDIR}${CONFDIR}/plugin-runner.conf"
127
 
    echo "--userid=${mandos_user}" >> "$PLUGINRUNNERCONF"
 
127
    cat <<-EOF >> "$PLUGINRUNNERCONF"
 
128
        
 
129
        --userid=${mandos_user}
 
130
EOF
128
131
fi
129
132
 
130
133
if [ ${mandos_group} != 65534 ]; then
131
134
    PLUGINRUNNERCONF="${DESTDIR}${CONFDIR}/plugin-runner.conf"
132
 
    echo "--groupid=${mandos_group}" >> "$PLUGINRUNNERCONF"
 
135
    cat <<-EOF >> "$PLUGINRUNNERCONF"
 
136
        
 
137
        --groupid=${mandos_group}
 
138
EOF
133
139
fi
134
140
 
135
141
# Key files 
136
 
for file in  "$keydir"/*; do
 
142
for file in "$keydir"/*; do
137
143
    if [ -d "$file" ]; then
138
144
        continue
139
145
    fi
168
174
        chmod a+rX "${DESTDIR}$dir"
169
175
    fi
170
176
done
171
 
for dir in /lib /usr/lib; do
172
 
    find "${DESTDIR}$dir" \! -perm -u+rw,g+r -prune -or -print0 \
173
 
        | 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
174
182
done