On Sat, 10 Mar 2012, Martin Orr <mar...@martinorr.name> wrote:
> So far as I can see, restorecon 2.1.10 exits with status 1 if it
> changed the context of any files and 0 if not.
> 
> I bisected this to upstream commit 17c577ac where it appears to be a
> mistake: process_one_realpath returns 1 if it changed the context, 0
> if it did not, and something negative if an error occurred.  But the
> check for the return value being negative became a check for it being
> non-zero.  I will write a patch this weekend.

I've attached the patch that I wrote for this independently of the work that 
you are doing.

Probably just rolling back the patch would be best, but I'll leave that for 
you to determine.

Sorry for the delay, I wrote this a few days ago but got sick and didn't send 
it anywhere.

Also some help with the init script issue on upgrade would be good.

-- 
My Main Blog         http://etbe.coker.com.au/
My Documents Blog    http://doc.coker.com.au/
Description: Make restorecon return 0 when a file has changed context with no error
Author: Russell Coker <russ...@coker.com.au>
Last-Update: 2012-03-07

--- policycoreutils-2.1.10.orig/setfiles/restore.c
+++ policycoreutils-2.1.10/setfiles/restore.c
@@ -218,10 +218,9 @@ static int restore(FTSENT *ftsent)
 			r_opts->progname, my_file, newcon, strerror(errno));
 		goto skip;
 	}
-	ret = 1;
 out:
 	freecon(newcon);
-	return ret;
+	return 0;
 skip:
 	freecon(newcon);
 	return SKIP;

Reply via email to