git.annexia.org
/
libguestfs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
77b9dc0
)
selinux: Don't fail if libselinux is not found.
author
Richard Jones
<rjones@centos5x32.home.annexia.org>
Thu, 13 Aug 2009 13:43:57 +0000
(14:43 +0100)
committer
Richard Jones
<rjones@trick.home.annexia.org>
Thu, 13 Aug 2009 15:19:21 +0000
(16:19 +0100)
daemon/selinux.c
patch
|
blob
|
history
diff --git
a/daemon/selinux.c
b/daemon/selinux.c
index
ad5eaa1
..
3b4b9ba
100644
(file)
--- a/
daemon/selinux.c
+++ b/
daemon/selinux.c
@@
-30,8
+30,6
@@
#include "daemon.h"
#include "actions.h"
#include "daemon.h"
#include "actions.h"
-#ifdef HAVE_LIBSELINUX
-
/* setcon is only valid under the following circumstances:
* - single threaded
* - enforcing=0
/* setcon is only valid under the following circumstances:
* - single threaded
* - enforcing=0
@@
-39,7
+37,7
@@
int
do_setcon (const char *context)
{
int
do_setcon (const char *context)
{
-#if
def HAVE_SETCON
+#if
defined(HAVE_LIBSELINUX) && defined(HAVE_SETCON)
if (setcon ((char *) context) == -1) {
reply_with_perror ("setcon");
return -1;
if (setcon ((char *) context) == -1) {
reply_with_perror ("setcon");
return -1;
@@
-55,7
+53,7
@@
do_setcon (const char *context)
char *
do_getcon (void)
{
char *
do_getcon (void)
{
-#if
def HAVE_GETCON
+#if
defined(HAVE_LIBSELINUX) && defined(HAVE_GETCON)
security_context_t context;
char *r;
security_context_t context;
char *r;
@@
-74,8
+72,6
@@
do_getcon (void)
return r; /* caller frees */
#else
reply_with_error ("%s is not available", __func__);
return r; /* caller frees */
#else
reply_with_error ("%s is not available", __func__);
- return
-1
;
+ return
NULL
;
#endif
}
#endif
}
-
-#endif /* HAVE_LIBSELINUX */