Skip to content

Commit

Permalink
Add -r to while read as per shellcheck
Browse files Browse the repository at this point in the history
(cherry picked from commit c8292a5)

Related: RHEL-23313
  • Loading branch information
deajan authored and jamacku committed Jan 30, 2024
1 parent 5d97423 commit a5e4ce6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions usr/libexec/readonly-root
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ if is_true "$READONLY" || is_true "$TEMPORARY_STATE"; then

for file in /etc/rwtab /etc/rwtab.d/* /run/initramfs/rwtab ; do
is_ignored_file "$file" && continue
[ -f $file ] && while read type path ; do
[ -f $file ] && while read -r type path ; do
case "$type" in
empty)
cp_empty $path
Expand Down Expand Up @@ -184,14 +184,14 @@ if is_true "$READONLY" || is_true "$TEMPORARY_STATE"; then
mount -n --bind $bindmountopts "$STATE_MOUNT/$file" "$file"
fi

while read path ; do
while read -r path ; do
mount_state "$path"
selinux_fixup "$path"
done < <(grep -v "^#" "$file" 2>/dev/null)
done

if [ -f "$STATE_MOUNT/files" ] ; then
while read path ; do
while read -r path ; do
mount_state "$path"
selinux_fixup "$path"
done < <(grep -v "^#" "$STATE_MOUNT/files" 2>/dev/null)
Expand Down

0 comments on commit a5e4ce6

Please sign in to comment.