Lines Matching refs:fp
46 FILE * fp) in render_access_mask() argument
49 fprintf(fp, "{"); in render_access_mask()
52 fprintf(fp, "%s ", perm); in render_access_mask()
53 fprintf(fp, "}"); in render_access_mask()
57 static int render_type(uint32_t type, policydb_t * p, FILE * fp) in render_type() argument
59 fprintf(fp, "%s", p->p_type_val_to_name[type - 1]); in render_type()
63 static int render_key(avtab_key_t * key, policydb_t * p, FILE * fp) in render_key() argument
70 fprintf(fp, "%s %s : %s ", stype, ttype, tclass); in render_key()
72 fprintf(fp, "%s %u : %s ", stype, key->target_type, tclass); in render_key()
74 fprintf(fp, "%u %s : %s ", key->source_type, ttype, tclass); in render_key()
76 fprintf(fp, "%u %u : %s ", key->source_type, key->target_type, in render_key()
88 policydb_t * p, FILE * fp) in render_av_rule() argument
105 fprintf(fp, "[enabled] "); in render_av_rule()
107 fprintf(fp, "[disabled] "); in render_av_rule()
112 fprintf(fp, "allow "); in render_av_rule()
113 render_key(key, p, fp); in render_av_rule()
114 render_access_mask(datum->data, key, p, fp); in render_av_rule()
115 fprintf(fp, ";\n"); in render_av_rule()
118 fprintf(fp, "auditallow "); in render_av_rule()
119 render_key(key, p, fp); in render_av_rule()
120 render_access_mask(datum->data, key, p, fp); in render_av_rule()
121 fprintf(fp, ";\n"); in render_av_rule()
124 fprintf(fp, "dontaudit "); in render_av_rule()
125 render_key(key, p, fp); in render_av_rule()
128 render_access_mask(~datum->data, key, p, fp); in render_av_rule()
129 fprintf(fp, ";\n"); in render_av_rule()
133 fprintf(fp, "type_transition "); in render_av_rule()
134 render_key(key, p, fp); in render_av_rule()
135 render_type(datum->data, p, fp); in render_av_rule()
136 fprintf(fp, ";\n"); in render_av_rule()
139 fprintf(fp, "type_member "); in render_av_rule()
140 render_key(key, p, fp); in render_av_rule()
141 render_type(datum->data, p, fp); in render_av_rule()
142 fprintf(fp, ";\n"); in render_av_rule()
145 fprintf(fp, "type_change "); in render_av_rule()
146 render_key(key, p, fp); in render_av_rule()
147 render_type(datum->data, p, fp); in render_av_rule()
148 fprintf(fp, ";\n"); in render_av_rule()
152 fprintf(fp, "allowxperm "); in render_av_rule()
154 fprintf(fp, "auditallowxperm "); in render_av_rule()
156 fprintf(fp, "dontauditxperm "); in render_av_rule()
157 render_key(key, p, fp); in render_av_rule()
158 fprintf(fp, "%s;\n", sepol_extended_perms_to_string(datum->xperms)); in render_av_rule()
160 fprintf(fp, " ERROR: no valid rule type specified\n"); in render_av_rule()
166 static int display_avtab(avtab_t * a, uint32_t what, policydb_t * p, FILE * fp) in display_avtab() argument
174 render_av_rule(&cur->key, &cur->datum, what, p, fp); in display_avtab()
177 fprintf(fp, "\n"); in display_avtab()
181 static int display_bools(policydb_t * p, FILE * fp) in display_bools() argument
186 fprintf(fp, "%s : %d\n", p->p_bool_val_to_name[i], in display_bools()
192 static void display_expr(policydb_t * p, cond_expr_t * exp, FILE * fp) in display_expr() argument
199 fprintf(fp, "%s ", in display_expr()
203 fprintf(fp, "! "); in display_expr()
206 fprintf(fp, "|| "); in display_expr()
209 fprintf(fp, "&& "); in display_expr()
212 fprintf(fp, "^ "); in display_expr()
215 fprintf(fp, "== "); in display_expr()
218 fprintf(fp, "!= "); in display_expr()
221 fprintf(fp, "error!"); in display_expr()
227 static int display_cond_expressions(policydb_t * p, FILE * fp) in display_cond_expressions() argument
233 fprintf(fp, "expression: "); in display_cond_expressions()
234 display_expr(p, cur->expr, fp); in display_cond_expressions()
235 fprintf(fp, "current state: %d\n", cur->cur_state); in display_cond_expressions()
236 fprintf(fp, "True list:\n"); in display_cond_expressions()
238 fprintf(fp, "\t"); in display_cond_expressions()
240 RENDER_CONDITIONAL, p, fp); in display_cond_expressions()
242 fprintf(fp, "False list:\n"); in display_cond_expressions()
244 fprintf(fp, "\t"); in display_cond_expressions()
246 RENDER_CONDITIONAL, p, fp); in display_cond_expressions()
263 static int change_bool(char *name, int state, policydb_t * p, FILE * fp) in change_bool() argument
269 fprintf(fp, "Could not find bool %s\n", name); in change_bool()
277 static void display_policycaps(policydb_t * p, FILE * fp) in display_policycaps() argument
284 fprintf(fp, "policy capabilities:\n"); in display_policycaps()
291 fprintf(fp, "\t%s\n", capname); in display_policycaps()
295 static void display_id(policydb_t *p, FILE *fp, uint32_t symbol_type, in display_id() argument
299 fprintf(fp, " %s%s", prefix, id); in display_id()
302 static void display_permissive(policydb_t *p, FILE *fp) in display_permissive() argument
307 fprintf(fp, "permissive sids:\n"); in display_permissive()
309 fprintf(fp, "\t"); in display_permissive()
310 display_id(p, fp, SYM_TYPES, i - 1, ""); in display_permissive()
311 fprintf(fp, "\n"); in display_permissive()
315 static void display_role_trans(policydb_t *p, FILE *fp) in display_role_trans() argument
319 fprintf(fp, "role_trans rules:\n"); in display_role_trans()
321 display_id(p, fp, SYM_ROLES, rt->role - 1, ""); in display_role_trans()
322 display_id(p, fp, SYM_TYPES, rt->type - 1, ""); in display_role_trans()
323 display_id(p, fp, SYM_CLASSES, rt->tclass - 1, ":"); in display_role_trans()
324 display_id(p, fp, SYM_ROLES, rt->new_role - 1, ""); in display_role_trans()
325 fprintf(fp, "\n"); in display_role_trans()
331 FILE *fp; member
342 FILE *fp = args->fp; in filenametr_display() local
348 display_id(p, fp, SYM_TYPES, bit, ""); in filenametr_display()
349 display_id(p, fp, SYM_TYPES, ft->ttype - 1, ""); in filenametr_display()
350 display_id(p, fp, SYM_CLASSES, ft->tclass - 1, ":"); in filenametr_display()
351 display_id(p, fp, SYM_TYPES, ftdatum->otype - 1, ""); in filenametr_display()
352 fprintf(fp, " %s\n", ft->name); in filenametr_display()
361 static void display_filename_trans(policydb_t *p, FILE *fp) in display_filename_trans() argument
365 fprintf(fp, "filename_trans rules:\n"); in display_filename_trans()
367 args.fp = fp; in display_filename_trans()