summaryrefslogtreecommitdiff
path: root/gl/lib/se-context_.h
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2007-01-04 16:33:43 +0100
committerJim Meyering <jim@meyering.net>2007-03-29 21:37:05 +0200
commit87516b80a5dcbfc4c2a8bb2193037a249c96674f (patch)
treee2093ff352ca9c0c55ce8916b4a9b779fd4e3361 /gl/lib/se-context_.h
parent56fc172d1133f9c97547818ea4c4c156cd431a16 (diff)
downloadcoreutils-87516b80a5dcbfc4c2a8bb2193037a249c96674f.tar.xz
New program: chcon
* gl/modules/selinux-at: New module. Check for libselinux and set LIB_SELINUX here, unconditionally, rather than depending on the configure-time --enable-selinux option. * gl/modules/selinux-h: New module. * bootstrap.conf (gnulib_modules): Add selinux-at. * gl/lib/selinux-at.c, gl/lib/selinux-at.h: New files. * gl/lib/se-selinux_.h: New file. * gl/lib/se-context_.h: New file. * gl/m4/selinux-selinux-h.m4: New file. * gl/m4/selinux-context-h.m4: New file. * src/Makefile.am (bin_PROGRAMS): Add chcon. (chcon_LDADD): Define. * README: Add chcon to the list of programs. * src/chcon.c: Rewrite the original (Red Hat) chcon to use fts.
Diffstat (limited to 'gl/lib/se-context_.h')
-rw-r--r--gl/lib/se-context_.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/gl/lib/se-context_.h b/gl/lib/se-context_.h
new file mode 100644
index 000000000..26e1709f1
--- /dev/null
+++ b/gl/lib/se-context_.h
@@ -0,0 +1,31 @@
+#ifndef SELINUX_CONTEXT_H
+# define SELINUX_CONTEXT_H
+
+# include <errno.h>
+/* Some systems don't have ENOSYS. */
+# ifndef ENOSYS
+# ifdef ENOTSUP
+# define ENOSYS ENOTSUP
+# else
+/* Some systems don't have ENOTSUP either. */
+# define ENOSYS EINVAL
+# endif
+# endif
+
+typedef int context_t;
+static inline context_t context_new (char const *s)
+ { errno = ENOTSUP; return 0; }
+static inline char *context_str (context_t con)
+ { errno = ENOTSUP; return (void *) 0; }
+static inline void context_free (context_t c) {}
+
+static inline int context_user_set (context_t sc, char const *s)
+ { errno = ENOTSUP; return -1; }
+static inline int context_role_set (context_t sc, char const *s)
+ { errno = ENOTSUP; return -1; }
+static inline int context_range_set (context_t sc, char const *s)
+ { errno = ENOTSUP; return -1; }
+static inline int context_type_set (context_t sc, char const *s)
+ { errno = ENOTSUP; return -1; }
+
+#endif