summaryrefslogtreecommitdiff
path: root/gl/modules
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/modules
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/modules')
-rw-r--r--gl/modules/selinux-at32
-rw-r--r--gl/modules/selinux-h54
2 files changed, 86 insertions, 0 deletions
diff --git a/gl/modules/selinux-at b/gl/modules/selinux-at
new file mode 100644
index 000000000..759908397
--- /dev/null
+++ b/gl/modules/selinux-at
@@ -0,0 +1,32 @@
+Description:
+openat-style fd-relative functions for SE Linux
+
+Files:
+lib/selinux-at.c
+lib/selinux-at.h
+
+Depends-on:
+selinux-h
+
+configure.ac:
+# FIXME: put this in an .m4 file?
+# For runcon.
+AC_CHECK_HEADERS([selinux/flask.h])
+AC_LIBOBJ([selinux-at])
+ac_save_LIBS="$LIBS"
+ AC_SEARCH_LIBS(setfilecon, selinux,
+ [test "$ac_cv_search_setfilecon" = "none required" ||
+ LIB_SELINUX=$ac_cv_search_setfilecon])
+ AC_SUBST(LIB_SELINUX)
+LIBS="$ac_save_LIBS"
+
+Makefile.am:
+
+Include:
+selinux-at.h
+
+License:
+LGPL
+
+Maintainer:
+Jim Meyering
diff --git a/gl/modules/selinux-h b/gl/modules/selinux-h
new file mode 100644
index 000000000..915b9d276
--- /dev/null
+++ b/gl/modules/selinux-h
@@ -0,0 +1,54 @@
+Description:
+SELinux-related headers for systems that lack them.
+
+Files:
+lib/se-context_.h
+lib/se-selinux_.h
+m4/selinux-context-h.m4
+m4/selinux-selinux-h.m4
+
+Depends-on:
+
+configure.ac:
+gl_HEADERS_SELINUX_SELINUX_H
+gl_HEADERS_SELINUX_CONTEXT_H
+
+Makefile.am:
+BUILT_SOURCES += $(SELINUX_SELINUX_H)
+selinux/selinux.h: se-selinux_.h
+ mkdir -p selinux
+ cp $(srcdir)/se-selinux_.h $@-t
+ chmod a-x $@-t
+ mv $@-t $@
+MOSTLYCLEANFILES += selinux/selinux.h selinux/selinux.h-t
+
+BUILT_SOURCES += $(SELINUX_CONTEXT_H)
+selinux/context.h: se-context_.h
+ mkdir -p selinux
+ cp $(srcdir)/se-context_.h $@-t
+ chmod a-x $@-t
+ mv $@-t $@
+MOSTLYCLEANFILES += selinux/context.h selinux/context.h-t
+MOSTLYCLEANDIRS += selinux
+
+Include:
+#include <selinux/selinux.h>
+#include <selinux/context.h>
+
+License:
+LGPL
+
+Maintainer:
+Jim Meyering
+
+# lib/selinux-at.c
+#
+# # For runcon.
+# AC_CHECK_HEADERS([selinux/flask.h])
+#
+# ac_save_LIBS="$LIBS"
+# AC_SEARCH_LIBS(setfilecon, selinux,
+# [test "$ac_cv_search_setfilecon" = "none required" ||
+# LIB_SELINUX=$ac_cv_search_setfilecon])
+# AC_SUBST(LIB_SELINUX)
+# LIBS="$ac_save_LIBS"