/[gentoo-x86]/sys-libs/libselinux/files/libselinux-2.1.9-mountsys.patch
Gentoo

Contents of /sys-libs/libselinux/files/libselinux-2.1.9-mountsys.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Sun May 13 08:47:37 2012 UTC (2 years, 3 months ago) by swift
Branch: MAIN
Mount /sys before /sys/fs/selinux, bug #414779

(Portage version: 2.1.10.49/cvs/Linux x86_64)

1 diff -ur libselinux-2.1.9.orig/src/load_policy.c libselinux-2.1.9/src/load_policy.c
2 --- libselinux-2.1.9.orig/src/load_policy.c 2012-05-05 10:33:06.130719282 +0200
3 +++ libselinux-2.1.9/src/load_policy.c 2012-05-05 10:43:45.024720646 +0200
4 @@ -370,8 +370,16 @@
5 * mount it if present for use in the calls below.
6 */
7 char *mntpoint = NULL;
8 - if (mount(SELINUXFS, SELINUXMNT, SELINUXFS, 0, 0) == 0 || errno == EBUSY) {
9 - mntpoint = SELINUXMNT;
10 + /* First make sure /sys is mounted */
11 + if (mount("sysfs", "/sys", "sysfs", 0, 0) == 0 || errno == EBUSY) {
12 + if (mount(SELINUXFS, SELINUXMNT, SELINUXFS, 0, 0) == 0 || errno == EBUSY) {
13 + mntpoint = SELINUXMNT;
14 + } else {
15 + /* check old mountpoint */
16 + if (mount(SELINUXFS, OLDSELINUXMNT, SELINUXFS, 0, 0) == 0 || errno == EBUSY) {
17 + mntpoint = OLDSELINUXMNT;
18 + }
19 + }
20 } else {
21 /* check old mountpoint */
22 if (mount(SELINUXFS, OLDSELINUXMNT, SELINUXFS, 0, 0) == 0 || errno == EBUSY) {

  ViewVC Help
Powered by ViewVC 1.1.20