summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2006-08-14 23:00:24 +0000
committerPeter Jones <pjones@redhat.com>2006-08-14 23:00:24 +0000
commit771b0c766bbfc697c0f35db60fc0bb6c03917fdf (patch)
treee297c3a50e7ad2ac9066e572f0c0e51c98032d3c
parenta77167455e8f2ea3c31f1e0308c8c46232f92c85 (diff)
- Fix building with newer libselinux
-rw-r--r--ChangeLog9
-rw-r--r--loader2/loader.c1
-rw-r--r--loader2/selinux.c18
-rw-r--r--loader2/selinux.h1
4 files changed, 10 insertions, 19 deletions
diff --git a/ChangeLog b/ChangeLog
index 8de9aa278..81b55bc7e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2006-08-14 Peter Jones <pjones@redhat.com>
+
+ * loader2/loader.c: include selinux-devel's selinux.h
+
+ * loader2/selinux.h: don't declare setexeccon()
+
+ * loader2/selinux.c: don't define setexeccon(), libselinux.a has it
+ now.
+
2006-08-14 Chris Lumens <clumens@redhat.com>
* anaconda: virtpconsole is a value, not a boolean (#202450).
diff --git a/loader2/loader.c b/loader2/loader.c
index 0676cb130..484ebbf23 100644
--- a/loader2/loader.c
+++ b/loader2/loader.c
@@ -83,6 +83,7 @@
#include "net.h"
#include "telnetd.h"
+#include <selinux/selinux.h>
#include "selinux.h"
#include "../isys/imount.h"
diff --git a/loader2/selinux.c b/loader2/selinux.c
index 1e50d534f..f142a7000 100644
--- a/loader2/selinux.c
+++ b/loader2/selinux.c
@@ -48,21 +48,3 @@ int loadpolicy() {
return 0;
}
-/* set a context for execution, from libselinux */
-int setexeccon(char * context) {
- int fd;
- ssize_t ret;
-
- fd = open("/proc/self/attr/exec", O_RDWR);
- if (fd < 0)
- return -1;
- if (context)
- ret = write(fd, context, strlen(context)+1);
- else
- ret = write(fd, NULL, 0); /* clear */
- close(fd);
- if (ret < 0)
- return -1;
- else
- return 0;
-}
diff --git a/loader2/selinux.h b/loader2/selinux.h
index faba65261..3cc7c8ab8 100644
--- a/loader2/selinux.h
+++ b/loader2/selinux.h
@@ -1,7 +1,6 @@
#ifndef SELINUX_H
#define SELINUX_H
-int setexeccon(char * context);
int loadpolicy();
#define ANACONDA_CONTEXT "system_u:system_r:anaconda_t:s0"