diff options
author | Simo Sorce <simo@redhat.com> | 2015-01-07 15:59:53 -0500 |
---|---|---|
committer | Simo Sorce <simo@redhat.com> | 2015-03-24 11:48:06 -0400 |
commit | 59bb1a554c09a342fcdcb47395283e1252a53541 (patch) | |
tree | f3b3b9fa90a1e35be4bdbdc8fd78609d0e7130b1 | |
parent | aa4fc60117a35a56735fdca533d0169c9c5f76d0 (diff) | |
download | gss-proxy-59bb1a554c09a342fcdcb47395283e1252a53541.tar.gz gss-proxy-59bb1a554c09a342fcdcb47395283e1252a53541.tar.xz gss-proxy-59bb1a554c09a342fcdcb47395283e1252a53541.zip |
Fix error in compiling without SELinux
Fixes: #131
Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-by: Nathaniel McCallum <npmccallum@redhat.com>
Reviewed-by: Roland Mainz <rmainz@redhat.com>
-rw-r--r-- | proxy/src/gp_selinux.h | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/proxy/src/gp_selinux.h b/proxy/src/gp_selinux.h index 693a124..f53da5a 100644 --- a/proxy/src/gp_selinux.h +++ b/proxy/src/gp_selinux.h @@ -48,9 +48,9 @@ #define SELINUX_CTX void * #define SEC_CTX void * -void *SELINUX_context_new(const char *str) { return NULL; } -#define SELINUX_context_free(x) (x) = NULL; -const char *SELINUX_context_dummy_get(void *) { return NULL; } +#define SELINUX_context_new(x) NULL +#define SELINUX_context_free(x) (x) = NULL +#define SELINUX_context_dummy_get(x) "<SELinux not compiled in>" #define SELINUX_context_str SELINUX_context_dummy_get #define SELINUX_context_type_get SELINUX_context_dummy_get #define SELINUX_context_user_get SELINUX_context_dummy_get @@ -58,13 +58,12 @@ const char *SELINUX_context_dummy_get(void *) { return NULL; } #define SELINUX_context_range_get SELINUX_context_dummy_get #include <errno.h> -int SELINUX_getpeercon(int fd, SEC_CTX *con) -{ - *con = NULL; - errno = ENOTSUP; - return -1; -} -#define SELINUX_freecon(x) (x) = NULL; +#define SELINUX_getpeercon(x, y) -1; do { \ + *(y) = NULL; \ + errno = ENOTSUP; \ +} while(0) + +#define SELINUX_freecon(x) (x) = NULL #endif /* done HAVE_SELINUX */ |