[PATCH 05/10] policycoreutils: fixfiles: if restorecon aborts, we should too

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



New users may try something like `fixfiles restore -v /dir/file` -
not realizing they are required to use `fixfiles -v restore /dir/file`.

Detect that `restorecon` aborts due to being run on the non-existent file
`-v`, and stop immediately.  This will show the error much more clearly,
instead of continuing to restore `/dir/file` *without* verbose messages.
---
 policycoreutils/scripts/fixfiles | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/policycoreutils/scripts/fixfiles b/policycoreutils/scripts/fixfiles
index 014ab04..1b173e6 100755
--- a/policycoreutils/scripts/fixfiles
+++ b/policycoreutils/scripts/fixfiles
@@ -387,7 +387,7 @@ else
     else
 	while [ -n "$1" ]; do
 	    FILEPATH="$1"
-	    process "$command"
+	    process "$command" || exit $?
 	    shift
 	done
     fi
-- 
2.9.3




[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux