]> git.pld-linux.org Git - packages/SysVinit.git/blob - 64_init_selinux_enabled.patch
- rel 19; multiple console output + few small fixes from debian (kfreebsd patch only...
[packages/SysVinit.git] / 64_init_selinux_enabled.patch
1 Purpose: Try to fix the logic used to enable SELinux
2 Authour: Petter Reinholdtsen
3 Fixes:   #580272
4 Status:  applied upstream
5
6 --- a/src/init.c
7 +++ b/src/init.c
8 @@ -54,10 +54,6 @@
9  
10  #ifdef WITH_SELINUX
11  #  include <selinux/selinux.h>
12 -#  include <sys/mount.h>
13 -#  ifndef MNT_DETACH /* present in glibc 2.10, missing in 2.7 */
14 -#    define MNT_DETACH 2
15 -#  endif
16  #endif
17  
18  #ifdef __i386__
19 @@ -2872,11 +2868,9 @@ int main(int argc, char **argv)
20  
21  #ifdef WITH_SELINUX
22         if (getenv("SELINUX_INIT") == NULL) {
23 -         const int rc = mount("proc", "/proc", "proc", 0, 0);
24 -         if (is_selinux_enabled() > 0) {
25 -           putenv("SELINUX_INIT=YES");
26 -           if (rc == 0) umount2("/proc", MNT_DETACH);
27 +         if (is_selinux_enabled() != 1) {
28             if (selinux_init_load_policy(&enforce) == 0) {
29 +             putenv("SELINUX_INIT=YES");
30               execv(myname, argv);
31             } else {
32               if (enforce > 0) {
33 @@ -2887,7 +2881,6 @@ int main(int argc, char **argv)
34               }
35             }
36           }
37 -         if (rc == 0) umount2("/proc", MNT_DETACH);
38         }
39  #endif  
40         /* Start booting. */
This page took 0.191598 seconds and 4 git commands to generate.