/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: 2026-05-17 20:20:09 UTC
  • Revision ID: teddy@recompile.se-20260517202009-tnh5ptu1492xbc66
Use "IFS= read" in shell scripts

In shell scripts, when using the "read" built-in, prefix it with IFS=
whenever we want to avoid stripping white space from start and end of
input.

* initramfs-tools-hook: Use "IFS= read" when reading file names from
  network hooks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
160
160
    if [ -x "$hook" ]; then
161
161
        # Copy any files needed by the network hook
162
162
        MANDOSNETHOOKDIR=/etc/mandos/network-hooks.d MODE=files \
163
 
            VERBOSITY=0 "$hook" files | while read -r file target; do
 
163
            VERBOSITY=0 "$hook" files | while IFS= read -r file target; do
164
164
            if [ ! -e "${file}" ]; then
165
165
                echo "WARNING: file ${file} not found, requested by Mandos network hook '${hook##*/}'" >&2
166
166
            fi
172
172
        done
173
173
        # Copy and load any modules needed by the network hook
174
174
        MANDOSNETHOOKDIR=/etc/mandos/network-hooks.d MODE=modules \
175
 
            VERBOSITY=0 "$hook" modules | while read -r module; do
 
175
            VERBOSITY=0 "$hook" modules | while IFS= read -r module; do
176
176
            force_load "$module"
177
177
        done
178
178
    fi