From 7a4295ef1ae1d4e7d51d4c7072102694243873e2 Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Sep 20 2011 06:54:43 +0000 Subject: The return value of restorecon is not reliable, ignore it. https://fedorahosted.org/freeipa/ticket/1816 --- diff --git a/ipapython/platform/redhat.py b/ipapython/platform/redhat.py index 6d1d423..6bf8bf3 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"