Hello Team,

According to current functionality for config files "rhncfg-client verify" and 
WebUI compare displays different results for selinux context if selinux is 
disabled on client server.
from cli it doesn't check weather selinux is enabled or not on the target 
system, but for GUI it does

So if selinux is disabled on client server, it end up with different results.

Bugzilla - https://bugzilla.redhat.com/show_bug.cgi?id=1003459


Attached the proposed patch to make cli results compatible to GUI. Please share 
your feedback on this.

Thanks,
Neha
From 8e077c5f05e5776d2271aa1509ae409cf11a58fe Mon Sep 17 00:00:00 2001
From: Neha Rawat <[email protected]>
Date: Fri, 30 Aug 2013 15:18:09 +0530
Subject: [PATCH] Signed-off-by: Neha Rawat <[email protected]>

1002880 - Selinux status check for diff function from cli
---
 client/tools/rhncfg/config_client/rhncfgcli_verify.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/client/tools/rhncfg/config_client/rhncfgcli_verify.py b/client/tools/rhncfg/config_client/rhncfgcli_verify.py
index 22d6195..1980f05 100644
--- a/client/tools/rhncfg/config_client/rhncfgcli_verify.py
+++ b/client/tools/rhncfg/config_client/rhncfgcli_verify.py
@@ -21,11 +21,14 @@ import os
 import stat
 import pwd, grp
 try:
-    from selinux import lgetfilecon
+    from selinux import lgetfilecon, is_selinux_enabled
 except:
     # on rhel4 we do not support selinux
     def lgetfilecon(path):
         return [0, '']
+    def is_selinux_enabled():
+        return 0
+
 
 class Handler(handler_base.HandlerBase):
     _usage_options = handler_base.HandlerBase._usage_options + " [ files ... ]"
@@ -251,6 +254,8 @@ class Handler(handler_base.HandlerBase):
                         dst_selinux = lgetfilecon(dst)[1]
                     except OSError:
                         dst_selinux = ""
+		    if not is_selinux_enabled():
+			dst_selinux = ""
                     if dst_selinux == None:
                         dst_selinux = ""
                 else:
-- 
1.8.3.1

_______________________________________________
Spacewalk-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Reply via email to