policycoreutils: fixfiles: honor last exclude line without newline
Stephen Smalley
maintainerPATCH 1/1 policycoreutils: fixfiles: honor last exclude line without newline
From: Vaibhav Bhope <[email protected]>
exclude_dirs_from_relabelling() uses while read, which exits with status 1 at EOF when the final line lacks a trailing newline, so that entry is silently dropped from -e exclusions. Process the leftover buffer with || [ -n "$i" ] so the last path is still applied.
--- policycoreutils/scripts/fixfiles | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
policycoreutils/scripts/fixfiles +1 -1
@@ -81,7 +81,7 @@ exclude_dirs_from_relabelling() { local f exclude_from_relabelling= f=$(selinux_resolve fixfiles_exclude_dirs) || return 0 - while read i + while read -r i || [ -n "$i" ] do # skip blank line and comment # skip not absolute path
Signature · 1 line
2.56.0
Quoted 9 lines · Stephen Smalley
From: Vaibhav Bhope <[email protected]>
exclude_dirs_from_relabelling()useswhile read, which exits with status 1 at EOF when the final line lacks a trailing newline, so that entry is silently dropped from -e exclusions. Process the leftover buffer with|| [ -n "$i" ]so the last path is still applied.Signed-off-by Vaibhav Bhope <[email protected]>
Stephen Smalley
maintainerQuoted 6 lines · Stephen Smalley
Quoted 3 lines · Stephen Smalley
From: Vaibhav Bhope <[email protected]>
Quoted 8 lines
Quoted 6 lines
exclude_dirs_from_relabelling()useswhile read, which exits with status 1 at EOF when the final line lacks a trailing newline, so that entry is silently dropped from -e exclusions. Process the leftover buffer with|| [ -n "$i" ]so the last path is still applied.Signed-off-by Vaibhav Bhope <[email protected]>Acked-by Stephen Smalley <[email protected]>
This has been merged.