diff mbox

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

Message ID 20170507110556.7740-5-alan.christopher.jenkins@gmail.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Alan Jenkins May 7, 2017, 11:05 a.m. UTC
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 mbox

Patch

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