Skip to content
Snippets Groups Projects
Select Git revision
  • nougat-cts-dev
  • master default protected
  • android-7.1.2_r28_klist
  • pie-cts-release
  • pie-vts-release
  • pie-cts-dev
  • oreo-mr1-iot-release
  • sdk-release
  • oreo-m6-s4-release
  • oreo-m4-s12-release
  • pie-release
  • pie-r2-release
  • pie-r2-s1-release
  • oreo-vts-release
  • oreo-cts-release
  • oreo-dev
  • oreo-mr1-dev
  • pie-gsi
  • pie-platform-release
  • pie-dev
  • oreo-cts-dev
  • android-o-mr1-iot-release-1.0.4
  • android-9.0.0_r8
  • android-9.0.0_r7
  • android-9.0.0_r6
  • android-9.0.0_r5
  • android-8.1.0_r46
  • android-8.1.0_r45
  • android-n-iot-release-smart-display-r2
  • android-vts-8.1_r5
  • android-cts-8.1_r8
  • android-cts-8.0_r12
  • android-cts-7.1_r20
  • android-cts-7.0_r24
  • android-o-mr1-iot-release-1.0.3
  • android-cts-9.0_r1
  • android-8.1.0_r43
  • android-8.1.0_r42
  • android-n-iot-release-smart-display
  • android-p-preview-5
  • android-9.0.0_r3
41 results

lmkd.te

Blame
  • check_seapp.c 28.17 KiB
    #include <stdio.h>
    #include <stdarg.h>
    #include <ctype.h>
    #include <stdio.h>
    #include <stdlib.h>
    #include <unistd.h>
    #include <string.h>
    #include <errno.h>
    #include <stdint.h>
    #include <search.h>
    #include <stdbool.h>
    #include <sepol/sepol.h>
    #include <sepol/policydb/policydb.h>
    #include <pcre.h>
    
    #define TABLE_SIZE 1024
    #define KVP_NUM_OF_RULES (sizeof(rules) / sizeof(key_map))
    #define log_set_verbose() do { logging_verbose = 1; log_info("Enabling verbose\n"); } while(0)
    #define log_error(fmt, ...) log_msg(stderr, "Error: ", fmt, ##__VA_ARGS__)
    #define log_warn(fmt, ...) log_msg(stderr, "Warning: ", fmt, ##__VA_ARGS__)
    #define log_info(fmt, ...) if (logging_verbose ) { log_msg(stdout, "Info: ", fmt, ##__VA_ARGS__); }
    
    /**
     * Initializes an empty, static list.
     */
    #define list_init(free_fn) { .head = NULL, .tail = NULL, .freefn = free_fn }
    
    /**
     * given an item in the list, finds the offset for the container
     * it was stored in.
     *
     * @element The element from the list
     * @type The container type ie what you allocated that has the list_element structure in it.
     * @name The name of the field that is the list_element
     *
     */
    #define list_entry(element, type, name) \
    		(type *)(((uint8_t *)element) - (uint8_t *)&(((type *)NULL)->name))
    
    /**
     * Iterates over the list, do not free elements from the list when using this.
     * @list The list head to walk
     * @var The variable name for the cursor
     */
    #define list_for_each(list, var) \
    	for(var = (list)->head; var != NULL; var = var->next)
    
    
    typedef struct hash_entry hash_entry;
    typedef enum key_dir key_dir;
    typedef enum data_type data_type;
    typedef enum rule_map_switch rule_map_switch;
    typedef enum map_match map_match;
    typedef struct key_map key_map;
    typedef struct kvp kvp;
    typedef struct rule_map rule_map;
    typedef struct policy_info policy_info;
    typedef struct list_element list_element;
    typedef struct list list;
    typedef struct key_map_regex key_map_regex;
    typedef struct file_info file_info;
    
    enum map_match {
    	map_no_matches,
    	map_input_matched,
    	map_matched
    };
    
    const char *map_match_str[] = {
    	"do not match",