find-provides.ksyms, find-requires.ksyms: use "read -r"

To avoid all kinds of fun that might stem from interpreting the user-supplied
input.

* find-provides.ksyms: Supply -r option to the read call.
* find-requires.ksyms (all_provides): Likewise.

Fixes: fd79794323 "find-provides.ksyms, find-requires.ksyms: rewrite indirect CRC parsing"
Resolves: #2178935
Signed-off-by: Eugene Syromiatnikov <esyr@redhat.com>
This commit is contained in:
Eugene Syromiatnikov 2023-05-23 14:47:26 +02:00
parent c0a9b49b96
commit 45ce51d5ff
2 changed files with 2 additions and 2 deletions

View File

@ -49,7 +49,7 @@ for module in $(grep -E '/lib/modules/.+\.ko(\.gz|\.bz2|\.xz|\.zst)?$') "$@"; do
objdump -t "$module" \ objdump -t "$module" \
| sed -n 's/^[0-9a-f][0-9a-f]* [gl]...... \(.*\) [0-9a-f][0-9a-f]* __crc_.*$/\1/p' \ | sed -n 's/^[0-9a-f][0-9a-f]* [gl]...... \(.*\) [0-9a-f][0-9a-f]* __crc_.*$/\1/p' \
| sort -u \ | sort -u \
| while read sectname; do | while read -r sectname; do
[ -n "$sectname" ] || continue [ -n "$sectname" ] || continue
ELFSECTDATA=$(readelf -R "$sectname" "$module" | awk '/0x/{printf $2$3$4$5}') ELFSECTDATA=$(readelf -R "$sectname" "$module" | awk '/0x/{printf $2$3$4$5}')

View File

@ -49,7 +49,7 @@ all_provides() {
objdump -t "$module" \ objdump -t "$module" \
| sed -n 's/^[0-9a-f][0-9a-f]* [gl]...... \(.*\) [0-9a-f][0-9a-f]* __crc_.*$/\1/p' \ | sed -n 's/^[0-9a-f][0-9a-f]* [gl]...... \(.*\) [0-9a-f][0-9a-f]* __crc_.*$/\1/p' \
| sort -u \ | sort -u \
| while read sectname; do | while read -r sectname; do
[ -n "$sectname" ] || continue [ -n "$sectname" ] || continue
ELFSECTDATA=$(readelf -R "$sectname" "$module" | awk '/0x/{printf $2$3$4$5}') ELFSECTDATA=$(readelf -R "$sectname" "$module" | awk '/0x/{printf $2$3$4$5}')