Blame SOURCES/cobbler-bz1052857.patch

1330ca
diff -rupN cobbler-2.0.7.old/cobbler/api.py cobbler-2.0.7/cobbler/api.py
1330ca
--- cobbler-2.0.7.old/cobbler/api.py	2015-05-06 14:47:57.860206615 -0400
1330ca
+++ cobbler-2.0.7/cobbler/api.py	2015-05-06 15:09:40.455772584 -0400
1330ca
@@ -179,11 +179,9 @@ class BootAPI:
1330ca
         API instance, regardless of the serializer type.
1330ca
         """
1330ca
         if not os.path.exists("/var/lib/cobbler/.mtime"):
1330ca
-            old = os.umask(0x777)
1330ca
-            fd = open("/var/lib/cobbler/.mtime","w")
1330ca
-            fd.write("0")
1330ca
-            fd.close()
1330ca
-            os.umask(old)
1330ca
+            fd = os.open("/var/lib/cobbler/.mtime", os.O_CREAT|os.O_RDWR, 0200)
1330ca
+            os.write(fd, "0")
1330ca
+            os.close(fd)
1330ca
             return 0
1330ca
         fd = open("/var/lib/cobbler/.mtime")
1330ca
         data = fd.read().strip()
1330ca
diff -rupN cobbler-2.0.7.old/cobbler/cobblerd.py cobbler-2.0.7/cobbler/cobblerd.py
1330ca
--- cobbler-2.0.7.old/cobbler/cobblerd.py	2015-05-06 14:47:57.856206586 -0400
1330ca
+++ cobbler-2.0.7/cobbler/cobblerd.py	2015-05-06 15:23:17.605662935 -0400
1330ca
@@ -58,10 +58,9 @@ def regen_ss_file():
1330ca
     fd = open("/dev/urandom")
1330ca
     data = fd.read(512)
1330ca
     fd.close()
1330ca
-    fd = open("/var/lib/cobbler/web.ss","w+")
1330ca
-    fd.write(binascii.hexlify(data))
1330ca
-    fd.close()
1330ca
-    utils.os_system("chmod 700 /var/lib/cobbler/web.ss")
1330ca
+    fd = os.open("/var/lib/cobbler/web.ss", os.O_CREAT|os.O_RDWR, 0600)
1330ca
+    os.write(fd, binascii.hexlify(data))
1330ca
+    os.close(fd)
1330ca
     utils.os_system("chown apache /var/lib/cobbler/web.ss")
1330ca
     return 1
1330ca
 
1330ca
diff -rupN cobbler-2.0.7.old/cobbler/serializer.py cobbler-2.0.7/cobbler/serializer.py
1330ca
--- cobbler-2.0.7.old/cobbler/serializer.py	2015-05-06 14:47:57.858206601 -0400
1330ca
+++ cobbler-2.0.7/cobbler/serializer.py	2015-05-06 15:24:31.318192455 -0400
1330ca
@@ -64,11 +64,9 @@ def __release_lock(with_changes=False):
1330ca
         # this file is used to know when the last config change
1330ca
         # was made -- allowing the API to work more smoothly without
1330ca
         # a lot of unneccessary reloads.  
1330ca
-        old = os.umask(0x777)
1330ca
-        fd = open("/var/lib/cobbler/.mtime","w")
1330ca
-        fd.write("%f" % time.time())
1330ca
-        fd.close()
1330ca
-        os.umask(old)
1330ca
+        fd = os.open("/var/lib/cobbler/.mtime", os.O_CREAT|os.O_RDWR, 0200)
1330ca
+        os.write(fd, "%f" % time.time())
1330ca
+        os.close(fd)
1330ca
     if LOCK_ENABLED:
1330ca
         LOCK_HANDLE = open("/var/lib/cobbler/lock","r")
1330ca
         fcntl.flock(LOCK_HANDLE.fileno(), fcntl.LOCK_UN)