From 647e7023ce05b720e9de6ccd4b8eb62836bcfb7b Mon Sep 17 00:00:00 2001
From: =?utf8?q?P=C3=A1draig=20Brady?=
Date: Wed, 27 Nov 2013 21:53:19 +0000
Subject: [PATCH] selinux-h: improve stub types and add more stub functions
* lib/se-selinux.in.h: Change security_context_t to a typedef
rather than a define, as it's a pointer type and so is better
as a typedef to avoid issues declaring multiple variables
with the comma operator. Also add stub for string_to_security_class().
* lib/se-context.in.h: Add stub functions for
context_{type,range,role,user}_get().
---
ChangeLog | 11 +++++++++++
lib/se-context.in.h | 8 ++++++++
lib/se-selinux.in.h | 5 ++++-
3 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 2e99de8d1a..61b5f40fcf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2013-11-27 Pádraig Brady
+
+ selinux-h: improve stub types and add more stub functions
+
+ * lib/se-selinux.in.h: Change security_context_t to a typedef
+ rather than a define, as it's a pointer type and so is better
+ as a typedef to avoid issues declaring multiple variables
+ with the comma operator. Also add stub for string_to_security_class().
+ * lib/se-context.in.h: Add stub functions for
+ context_{type,range,role,user}_get().
+
2013-11-27 Paul Eggert
ignore-value: prefer GCC version back through 2.0
diff --git a/lib/se-context.in.h b/lib/se-context.in.h
index bd586e8b10..c3890a2bf3 100644
--- a/lib/se-context.in.h
+++ b/lib/se-context.in.h
@@ -32,6 +32,14 @@ SE_CONTEXT_INLINE int context_range_set (context_t sc _GL_UNUSED_PARAMETER,
SE_CONTEXT_INLINE int context_type_set (context_t sc _GL_UNUSED_PARAMETER,
char const *s _GL_UNUSED_PARAMETER)
{ errno = ENOTSUP; return -1; }
+SE_CONTEXT_INLINE char *context_type_get (context_t sc _GL_UNUSED_PARAMETER)
+ { errno = ENOTSUP; return (void *) 0; }
+SE_CONTEXT_INLINE char *context_range_get (context_t sc _GL_UNUSED_PARAMETER)
+ { errno = ENOTSUP; return (void *) 0; }
+SE_CONTEXT_INLINE char *context_role_get (context_t sc _GL_UNUSED_PARAMETER)
+ { errno = ENOTSUP; return (void *) 0; }
+SE_CONTEXT_INLINE char *context_user_get (context_t sc _GL_UNUSED_PARAMETER)
+ { errno = ENOTSUP; return (void *) 0; }
_GL_INLINE_HEADER_END
diff --git a/lib/se-selinux.in.h b/lib/se-selinux.in.h
index 62a5d86747..43690c0f18 100644
--- a/lib/se-selinux.in.h
+++ b/lib/se-selinux.in.h
@@ -44,7 +44,7 @@ _GL_INLINE_HEADER_BEGIN
# if !GNULIB_defined_security_types
typedef unsigned short security_class_t;
-# define security_context_t char*
+typedef char *security_context_t;
# define is_selinux_enabled() 0
SE_SELINUX_INLINE int
@@ -103,6 +103,9 @@ security_compute_create (security_context_t scon _GL_UNUSED_PARAMETER,
security_class_t tclass _GL_UNUSED_PARAMETER,
security_context_t *newcon _GL_UNUSED_PARAMETER)
{ errno = ENOTSUP; return -1; }
+SE_SELINUX_INLINE security_class_t
+string_to_security_class (char const *name)
+ { errno = ENOTSUP; return 0; }
SE_SELINUX_INLINE int
matchpathcon_init_prefix (char const *path _GL_UNUSED_PARAMETER,
char const *prefix _GL_UNUSED_PARAMETER)
--
2.39.5