Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 7f1b28058b9f625dd403c572029ddadb > files > 9

denyhosts-2.6-23.fc15.src.rpm

--- DenyHosts-2.6/DenyHosts/denyfileutil.py.orig	2009-03-04 19:21:28.000000000 -0600
+++ DenyHosts-2.6/DenyHosts/denyfileutil.py	2009-03-04 19:23:45.000000000 -0600
@@ -8,6 +8,7 @@
 from util import parse_host
 import plugin
 from purgecounter import PurgeCounter
+import selinux
 
 debug = logging.getLogger("denyfileutil").debug
 info = logging.getLogger("denyfileutil").info
@@ -166,6 +167,10 @@
         try:
             fp = open(self.temp_file, "w")
             os.chmod(self.temp_file, 0644)
+            # Fedora patch - create the temp file with the proper context, so
+            # we don't hose the context on the hosts.deny file.
+            if selinux.is_seliux_enabled():
+                selinux.restorecon(self.temp_file)
             offset = 0
             num_lines = len(data)
             while offset < num_lines: