changeset 37240:8c0f23afb519

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().
author Pádraig Brady <P@draigBrady.com>
date Wed, 27 Nov 2013 21:53:19 +0000
parents 3bc441308c14
children 0f5e6eb69134
files ChangeLog lib/se-context.in.h lib/se-selinux.in.h
diffstat 3 files changed, 23 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Nov 27 14:52:17 2013 -0800
+++ b/ChangeLog	Wed Nov 27 21:53:19 2013 +0000
@@ -1,3 +1,14 @@
+2013-11-27  Pádraig Brady <P@draigBrady.com>
+
+	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  <eggert@cs.ucla.edu>
 
 	ignore-value: prefer GCC version back through 2.0
--- a/lib/se-context.in.h	Wed Nov 27 14:52:17 2013 -0800
+++ b/lib/se-context.in.h	Wed Nov 27 21:53:19 2013 +0000
@@ -32,6 +32,14 @@
 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
 
--- a/lib/se-selinux.in.h	Wed Nov 27 14:52:17 2013 -0800
+++ b/lib/se-selinux.in.h	Wed Nov 27 21:53:19 2013 +0000
@@ -44,7 +44,7 @@
 #  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_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)