libselinux/libselinux-rhat.patch

170 lines
6.1 KiB
Diff
Raw Normal View History

2006-06-01 17:25:22 +00:00
diff -Nurp libselinux-1.29.7.orig/src/canonicalize_context.c libselinux-1.29.7/src/canonicalize_context.c
--- libselinux-1.29.7.orig/src/canonicalize_context.c 2006-01-20 23:37:52.000000000 +0800
+++ libselinux-1.29.7/src/canonicalize_context.c 2006-05-31 20:42:47.000000000 +0800
@@ -18,6 +18,9 @@ int security_canonicalize_context_raw(se
size_t size;
int fd, ret;
2006-06-01 17:25:22 +00:00
+ if (!selinux_mnt)
+ return -1;
+
snprintf(path, sizeof path, "%s/context", selinux_mnt);
fd = open(path, O_RDWR);
if (fd < 0)
diff -Nurp libselinux-1.29.7.orig/src/check_context.c libselinux-1.29.7/src/check_context.c
--- libselinux-1.29.7.orig/src/check_context.c 2006-01-20 23:37:52.000000000 +0800
+++ libselinux-1.29.7/src/check_context.c 2006-05-31 20:43:24.000000000 +0800
@@ -14,6 +14,9 @@ int security_check_context_raw(security_
char path[PATH_MAX];
int fd, ret;
2006-06-01 17:25:22 +00:00
+ if (!selinux_mnt)
+ return -1;
+
2006-06-01 17:25:22 +00:00
snprintf(path, sizeof path, "%s/context", selinux_mnt);
fd = open(path, O_RDWR);
if (fd < 0)
diff -Nurp libselinux-1.29.7.orig/src/compute_av.c libselinux-1.29.7/src/compute_av.c
--- libselinux-1.29.7.orig/src/compute_av.c 2006-01-20 23:37:52.000000000 +0800
+++ libselinux-1.29.7/src/compute_av.c 2006-05-31 20:44:00.000000000 +0800
@@ -21,6 +21,9 @@ int security_compute_av_raw(security_con
size_t len;
int fd, ret;
2006-06-01 17:25:22 +00:00
+ if (!selinux_mnt)
+ return -1;
+
snprintf(path, sizeof path, "%s/access", selinux_mnt);
fd = open(path, O_RDWR);
if (fd < 0)
diff -Nurp libselinux-1.29.7.orig/src/compute_create.c libselinux-1.29.7/src/compute_create.c
--- libselinux-1.29.7.orig/src/compute_create.c 2006-01-20 23:37:52.000000000 +0800
+++ libselinux-1.29.7/src/compute_create.c 2006-05-31 20:44:53.000000000 +0800
@@ -20,6 +20,9 @@ int security_compute_create_raw(security
size_t size;
int fd, ret;
2006-06-01 17:25:22 +00:00
+ if (!selinux_mnt)
+ return -1;
+
snprintf(path, sizeof path, "%s/create", selinux_mnt);
fd = open(path, O_RDWR);
if (fd < 0)
diff -Nurp libselinux-1.29.7.orig/src/compute_member.c libselinux-1.29.7/src/compute_member.c
--- libselinux-1.29.7.orig/src/compute_member.c 2006-01-20 23:37:52.000000000 +0800
+++ libselinux-1.29.7/src/compute_member.c 2006-05-31 20:45:36.000000000 +0800
@@ -20,6 +20,9 @@ int security_compute_member_raw(security
size_t size;
int fd, ret;
2006-06-01 17:25:22 +00:00
+ if (!selinux_mnt)
+ return -1;
+
2006-06-01 17:25:22 +00:00
snprintf(path, sizeof path, "%s/member", selinux_mnt);
fd = open(path, O_RDWR);
if (fd < 0)
diff -Nurp libselinux-1.29.7.orig/src/compute_relabel.c libselinux-1.29.7/src/compute_relabel.c
--- libselinux-1.29.7.orig/src/compute_relabel.c 2006-01-20 23:37:52.000000000 +0800
+++ libselinux-1.29.7/src/compute_relabel.c 2006-05-31 20:46:04.000000000 +0800
@@ -20,6 +20,9 @@ int security_compute_relabel_raw(securit
size_t size;
int fd, ret;
2006-06-01 17:25:22 +00:00
+ if (!selinux_mnt)
+ return -1;
+
snprintf(path, sizeof path, "%s/relabel", selinux_mnt);
fd = open(path, O_RDWR);
if (fd < 0)
diff -Nurp libselinux-1.29.7.orig/src/compute_user.c libselinux-1.29.7/src/compute_user.c
--- libselinux-1.29.7.orig/src/compute_user.c 2006-01-20 23:37:52.000000000 +0800
+++ libselinux-1.29.7/src/compute_user.c 2006-05-31 20:46:32.000000000 +0800
@@ -21,6 +21,9 @@ int security_compute_user_raw(security_c
int fd, ret;
unsigned int i, nel;
2006-06-01 17:25:22 +00:00
+ if (!selinux_mnt)
+ return -1;
+
snprintf(path, sizeof path, "%s/user", selinux_mnt);
fd = open(path, O_RDWR);
if (fd < 0)
diff -Nurp libselinux-1.29.7.orig/src/disable.c libselinux-1.29.7/src/disable.c
--- libselinux-1.29.7.orig/src/disable.c 2006-01-20 23:37:52.000000000 +0800
+++ libselinux-1.29.7/src/disable.c 2006-05-31 20:47:27.000000000 +0800
@@ -15,6 +15,9 @@ int security_disable(void)
char path[PATH_MAX];
char buf[20];
2006-06-01 17:25:22 +00:00
+ if (!selinux_mnt)
+ return -1;
+
snprintf(path, sizeof path, "%s/disable", selinux_mnt);
fd = open(path, O_WRONLY);
if (fd < 0)
diff -Nurp libselinux-1.29.7.orig/src/enabled.c libselinux-1.29.7/src/enabled.c
--- libselinux-1.29.7.orig/src/enabled.c 2006-01-20 23:37:52.000000000 +0800
+++ libselinux-1.29.7/src/enabled.c 2006-05-31 20:48:30.000000000 +0800
@@ -65,6 +65,9 @@ int is_selinux_mls_enabled(void)
char buf[20], path[PATH_MAX];
int fd, ret, enabled = 0;
2006-06-01 17:25:22 +00:00
+ if (!selinux_mnt)
+ return enabled;
+
snprintf(path, sizeof path, "%s/mls", selinux_mnt);
fd = open(path, O_RDONLY);
if (fd < 0)
diff -Nurp libselinux-1.29.7.orig/src/getenforce.c libselinux-1.29.7/src/getenforce.c
--- libselinux-1.29.7.orig/src/getenforce.c 2006-01-20 23:37:52.000000000 +0800
+++ libselinux-1.29.7/src/getenforce.c 2006-05-31 20:48:56.000000000 +0800
@@ -15,6 +15,9 @@ int security_getenforce(void)
char path[PATH_MAX];
char buf[20];
2006-06-01 17:25:22 +00:00
+ if (!selinux_mnt)
+ return -1;
+
snprintf(path, sizeof path, "%s/enforce", selinux_mnt);
fd = open(path, O_RDONLY);
if (fd < 0)
diff -Nurp libselinux-1.29.7.orig/src/load_policy.c libselinux-1.29.7/src/load_policy.c
--- libselinux-1.29.7.orig/src/load_policy.c 2006-01-20 23:37:52.000000000 +0800
+++ libselinux-1.29.7/src/load_policy.c 2006-05-31 20:49:33.000000000 +0800
@@ -20,6 +20,9 @@ int security_load_policy(void *data, siz
char path[PATH_MAX];
int fd, ret;
+ if (!selinux_mnt)
+ return -1;
+
snprintf(path, sizeof path, "%s/load", selinux_mnt);
fd = open(path, O_RDWR);
if (fd < 0)
diff -Nurp libselinux-1.29.7.orig/src/policyvers.c libselinux-1.29.7/src/policyvers.c
--- libselinux-1.29.7.orig/src/policyvers.c 2006-01-20 23:37:52.000000000 +0800
+++ libselinux-1.29.7/src/policyvers.c 2006-05-31 20:50:22.000000000 +0800
@@ -19,6 +19,9 @@ int security_policyvers(void)
char buf[20];
unsigned vers = DEFAULT_POLICY_VERSION;
2006-06-01 17:25:22 +00:00
+ if (!selinux_mnt)
+ return -1;
+
snprintf(path, sizeof path, "%s/policyvers", selinux_mnt);
fd = open(path, O_RDONLY);
if (fd < 0) {
diff -Nurp libselinux-1.29.7.orig/src/setenforce.c libselinux-1.29.7/src/setenforce.c
--- libselinux-1.29.7.orig/src/setenforce.c 2006-01-20 23:37:52.000000000 +0800
+++ libselinux-1.29.7/src/setenforce.c 2006-05-31 20:50:51.000000000 +0800
@@ -15,6 +15,9 @@ int security_setenforce(int value)
char path[PATH_MAX];
char buf[20];
2006-06-01 17:25:22 +00:00
+ if (!selinux_mnt)
+ return -1;
+
snprintf(path, sizeof path, "%s/enforce", selinux_mnt);
fd = open(path, O_RDWR);
if (fd < 0)