diff options
author | Xin Ouyang <Xin.Ouyang@windriver.com> | 2012-04-17 17:20:30 +0800 |
---|---|---|
committer | Xin Ouyang <Xin.Ouyang@windriver.com> | 2012-04-17 17:20:30 +0800 |
commit | 9a143837c45e099cb421d8415fcac7a109856212 (patch) | |
tree | 8943abe8ef081af3764a6722b8dc5a4aa7be8575 | |
parent | c74818cb9acbc1b4a185b8171c436bfe5a260c97 (diff) | |
download | meta-selinux-9a143837c45e099cb421d8415fcac7a109856212.tar.gz |
libselinux: Fix selinux_init_load_policy() for sysvinit.
With sysvinit, selinux_init_load_policy() will fail since sysfs is
still not mounted.
-rw-r--r-- | recipes-security/selinux/libselinux/libselinux-fix-init-load-policy.patch | 27 | ||||
-rw-r--r-- | recipes-security/selinux/libselinux_2.1.9.bb | 2 |
2 files changed, 29 insertions, 0 deletions
diff --git a/recipes-security/selinux/libselinux/libselinux-fix-init-load-policy.patch b/recipes-security/selinux/libselinux/libselinux-fix-init-load-policy.patch new file mode 100644 index 0000000..d959f2c --- /dev/null +++ b/recipes-security/selinux/libselinux/libselinux-fix-init-load-policy.patch | |||
@@ -0,0 +1,27 @@ | |||
1 | From ac70ca3b336b52b01cdc38157d25bf7e85098ee1 Mon Sep 17 00:00:00 2001 | ||
2 | From: Xin Ouyang <Xin.Ouyang@windriver.com> | ||
3 | Date: Thu, 12 Apr 2012 16:10:10 +0800 | ||
4 | Subject: [PATCH] libselinux: fix init load policy | ||
5 | |||
6 | selinux_init_load_policy() would fail if we use the new mount point | ||
7 | for selinuxfs(/sys/fs/selinux) while sysfs(/sys) is still not | ||
8 | mounted. | ||
9 | --- | ||
10 | src/load_policy.c | 1 + | ||
11 | 1 files changed, 1 insertions(+), 0 deletions(-) | ||
12 | |||
13 | diff --git a/src/load_policy.c b/src/load_policy.c | ||
14 | index f569664..60e7efd 100644 | ||
15 | --- a/src/load_policy.c | ||
16 | +++ b/src/load_policy.c | ||
17 | @@ -370,6 +370,7 @@ int selinux_init_load_policy(int *enforce) | ||
18 | * mount it if present for use in the calls below. | ||
19 | */ | ||
20 | char *mntpoint = NULL; | ||
21 | + rc = mount("sysfs", "/sys", "sysfs", 0, 0); | ||
22 | if (mount(SELINUXFS, SELINUXMNT, SELINUXFS, 0, 0) == 0 || errno == EBUSY) { | ||
23 | mntpoint = SELINUXMNT; | ||
24 | } else { | ||
25 | -- | ||
26 | 1.7.5.4 | ||
27 | |||
diff --git a/recipes-security/selinux/libselinux_2.1.9.bb b/recipes-security/selinux/libselinux_2.1.9.bb index 4d7d4de..d25c318 100644 --- a/recipes-security/selinux/libselinux_2.1.9.bb +++ b/recipes-security/selinux/libselinux_2.1.9.bb | |||
@@ -13,6 +13,8 @@ inherit lib_package | |||
13 | SRC_URI[md5sum] = "8ea0548dd65e9479b357ba1447f89221" | 13 | SRC_URI[md5sum] = "8ea0548dd65e9479b357ba1447f89221" |
14 | SRC_URI[sha256sum] = "749d4b39c80aa9df8247b8b3187ab72442c0dbad6e70bf312e25052bd4e7063f" | 14 | SRC_URI[sha256sum] = "749d4b39c80aa9df8247b8b3187ab72442c0dbad6e70bf312e25052bd4e7063f" |
15 | 15 | ||
16 | SRC_URI += "file://libselinux-fix-init-load-policy.patch" | ||
17 | |||
16 | DEPENDS += "libsepol python python-native swig-native" | 18 | DEPENDS += "libsepol python python-native swig-native" |
17 | 19 | ||
18 | PACKAGES += "${PN}-python" | 20 | PACKAGES += "${PN}-python" |