psss / rpms / libselinux

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