selinuxenabled.c 890 B

123456789101112131415161718192021222324252627282930
  1. /*
  2. * selinuxenabled
  3. *
  4. * Based on libselinux 1.33.1
  5. * Port to BusyBox Hiroshi Shinji <shiroshi@my.email.ne.jp>
  6. *
  7. * Licensed under GPLv2, see file LICENSE in this source tree.
  8. */
  9. //config:config SELINUXENABLED
  10. //config: bool "selinuxenabled (321 bytes)"
  11. //config: default n
  12. //config: depends on SELINUX
  13. //config: help
  14. //config: Enable support for this command to be used within shell scripts
  15. //config: to determine if selinux is enabled.
  16. //applet:IF_SELINUXENABLED(APPLET(selinuxenabled, BB_DIR_USR_SBIN, BB_SUID_DROP))
  17. //kbuild:lib-$(CONFIG_SELINUXENABLED) += selinuxenabled.o
  18. //usage:#define selinuxenabled_trivial_usage NOUSAGE_STR
  19. //usage:#define selinuxenabled_full_usage ""
  20. #include "libbb.h"
  21. int selinuxenabled_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
  22. int selinuxenabled_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
  23. {
  24. return !is_selinux_enabled();
  25. }