kdumpctl will restore files default SELinux security contexts via restorecon
command, but the files in /tmp don't have a default label, restorecon will
complain like below:
"Warning no default label for /tmp/mkfadumprd.XXXXXX/fadump.img"
Redirect the stdout to /dev/null for ignoring the harmless warning.
Signed-off-by: Lichen Liu <lichliu(a)redhat.com>
---
kdumpctl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kdumpctl b/kdumpctl
index 9fd76ac..3928bda 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -906,7 +906,7 @@ selinux_relabel()
while IFS= read -r -d '' _i; do
_attr=$(getfattr -m "security.selinux" "$_i" 2> /dev/null)
if [[ -z $_attr ]]; then
- restorecon "$_i"
+ restorecon "$_i" > /dev/null
fi
done < <(find "$_path" -print0)
}
--
2.27.0