perm.c 690 B

123456789101112131415161718192021222324252627282930
  1. #include "perm.h"
  2. void permissive_usage() {
  3. fprintf(stderr, "\tpermissive\n");
  4. }
  5. static int list_permissive(policydb_t * policydb)
  6. {
  7. struct ebitmap_node *n;
  8. unsigned int bit;
  9. /*
  10. * iterate over all domains and check if domain is in permissive
  11. */
  12. ebitmap_for_each_bit(&policydb->permissive_map, n, bit)
  13. {
  14. if (ebitmap_node_get_bit(n, bit)) {
  15. printf("%s\n", policydb->p_type_val_to_name[bit -1]);
  16. }
  17. }
  18. return 0;
  19. }
  20. int permissive_func (int argc, __attribute__ ((unused)) char **argv, policydb_t *policydb) {
  21. if (argc != 1) {
  22. USAGE_ERROR = true;
  23. return -1;
  24. }
  25. return list_permissive(policydb);
  26. }