From 1d8a891844ad8505e376c473f42055368ba00767 Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Mon, 19 Sep 2011 16:31:57 -0400 Subject: The return value of restorecon is not reliable, ignore it. https://fedorahosted.org/freeipa/ticket/1816 --- ipapython/platform/redhat.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'ipapython/platform') diff --git a/ipapython/platform/redhat.py b/ipapython/platform/redhat.py index 6d1d42368..6bf8bf348 100644 --- a/ipapython/platform/redhat.py +++ b/ipapython/platform/redhat.py @@ -123,10 +123,14 @@ knownservices = RedHatServices() def restore_context(filepath): """ restore security context on the file path - SE Linux equivalent is /sbin/restorecon - """ - ipautil.run(["/sbin/restorecon", filepath]) + SELinux equivalent is /sbin/restorecon + + restorecon's return values are not reliable so we have to + ignore them (BZ #739604). + ipautil.run() will do the logging. + """ + ipautil.run(["/sbin/restorecon", filepath], raiseonerr=False) def backup_and_replace_hostname(fstore, statestore, hostname): network_filename = "/etc/sysconfig/network" -- cgit