/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: 2015-07-05 18:36:23 UTC
  • mto: This revision was merged to the branch mainline in revision 759.
  • Revision ID: teddy@recompile.se-20150705183623-k7yokhi0wpvs61iw
Add plugin for mandos-client to add and delete local routes.

* Makefile (LIBNL3_CFLAGS, LIBNL3_LIBS): New; add for netlink library.
  (PLUGIN_HELPERS): Add "plugin-helpers/mandos-client-iprouteadddel".
  (plugin-helpers/mandos-client-iprouteadddel): New.
* plugin-helpers/mandos-client-iprouteadddel.c: New.
* plugins.d/mandos_client (add_remove_local_route): Rename
                                                    "remove_arg" to
                                                    "delete_arg".  All
                                                    users changed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
70
70
CONFDIR="/conf/conf.d/mandos"
71
71
MANDOSDIR="/lib/mandos"
72
72
PLUGINDIR="${MANDOSDIR}/plugins.d"
73
 
PLUGINHELPERDIR="${MANDOSDIR}/plugin-helpers"
 
73
PLUGINHELPERDIR="${MANDOSDIR}/plugins-helpers"
74
74
HOOKDIR="${MANDOSDIR}/network-hooks.d"
75
75
 
76
76
# Make directories
219
219
    if [ -d "$file" ]; then
220
220
        continue
221
221
    fi
222
 
    case "$file" in
223
 
        *~|.*|\#*\#|*.dpkg-old|*.dpkg-bak|*.dpkg-new|*.dpkg-divert)
224
 
            : ;;
225
 
        "*") : ;;
226
 
        *)
227
 
            cp --archive --sparse=always "$file" \
228
 
               "${DESTDIR}${CONFDIR}"
229
 
            chown ${mandos_user}:${mandos_group} \
230
 
                  "${DESTDIR}${CONFDIR}/`basename \"$file\"`"
231
 
            ;;
232
 
    esac
 
222
    cp --archive --sparse=always "$file" "${DESTDIR}${CONFDIR}"
 
223
    chown ${mandos_user}:${mandos_group} \
 
224
        "${DESTDIR}${CONFDIR}/`basename \"$file\"`"
233
225
done
234
 
# Use Diffie-Hellman parameters file if available
235
 
if [ -e "${DESTDIR}${CONFDIR}"/dhparams.pem ]; then
236
 
    sed --in-place \
237
 
        --expression="1i--options-for=mandos-client:--dh-params=${CONFDIR}/dhparams.pem" \
238
 
        "${DESTDIR}/${CONFDIR}/plugin-runner.conf"
239
 
fi
240
226
 
241
227
# /lib/mandos/plugin-runner will drop priviliges, but needs access to
242
228
# its plugin directory and its config file.  However, since almost all
266
252
done
267
253
for dir in "${DESTDIR}"/lib* "${DESTDIR}"/usr/lib*; do
268
254
    if [ -d "$dir" ]; then
269
 
        find "$dir" \! -perm -u+rw,g+r -prune -or \! -type l -print0 \
270
 
            | xargs --null --no-run-if-empty chmod a+rX --
 
255
        find "$dir" \! -perm -u+rw,g+r -prune -or -print0 \
 
256
            | xargs --null --no-run-if-empty chmod a+rX
271
257
    fi
272
258
done