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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Tue Oct 9 20:00:12 2012 UTC (23 months, 1 week ago) by swift
Branch: MAIN
New upstream SELinux utilities release

(Portage version: 2.1.11.9/cvs/Linux x86_64)

1 diff -ur libselinux-2.1.12.orig/src/load_policy.c libselinux-2.1.12/src/load_policy.c
2 --- libselinux-2.1.12.orig/src/load_policy.c 2012-09-29 09:32:18.374170451 +0200
3 +++ libselinux-2.1.12/src/load_policy.c 2012-09-29 09:34:05.130172917 +0200
4 @@ -370,8 +370,16 @@
5 * mount it if present for use in the calls below.
6 */
7 const 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