Blame SOURCES/koan_no_selinux_set.patch

1330ca
diff -ru cobbler-2.0.7.orig/koan/app.py cobbler-2.0.7/koan/app.py
1330ca
--- cobbler-2.0.7.orig/koan/app.py	2013-04-10 10:51:54.775900810 +0200
1330ca
+++ cobbler-2.0.7/koan/app.py	2013-04-10 10:52:36.816981814 +0200
1330ca
@@ -1491,32 +1491,8 @@
1330ca
                     if lv_create != 0:
1330ca
                         raise InfoException, "LVM creation failed"
1330ca
 
1330ca
-                # partition location
1330ca
-                partition_location = "/dev/%s/%s" % (location,name)
1330ca
-
1330ca
-                # check whether we have SELinux enabled system
1330ca
-                args = "/usr/sbin/selinuxenabled"
1330ca
-                selinuxenabled = sub_process.call(args)
1330ca
-                if selinuxenabled == 0:
1330ca
-                    # required context type
1330ca
-                    context_type = "virt_image_t"
1330ca
-
1330ca
-                    # change security context type to required one
1330ca
-                    args = "/usr/bin/chcon -t %s %s" % (context_type, partition_location)
1330ca
-                    print "%s" % args
1330ca
-                    change_context = sub_process.call(args, close_fds=True, shell=True)
1330ca
-
1330ca
-                    # modify SELinux policy in order to preserve security context
1330ca
-                    # between reboots
1330ca
-                    args = "/usr/sbin/semanage fcontext -a -t %s %s" % (context_type, partition_location)
1330ca
-                    print "%s" % args
1330ca
-                    change_context |= sub_process.call(args, close_fds=True, shell=True)
1330ca
-                    
1330ca
-                    if change_context != 0:
1330ca
-                        raise InfoException, "SELinux security context setting to LVM partition failed"
1330ca
-
1330ca
                 # return partition location
1330ca
-                return partition_location
1330ca
+                return "/dev/%s/%s" % (location,name)
1330ca
 
1330ca
             else:
1330ca
                 raise InfoException, "volume group needs %s GB free space." % virt_size