Lines Matching refs:fp
74 FILE * fp)
77 fprintf(fp, "{");
80 fprintf(fp, "%s ", perm);
81 fprintf(fp, "}");
85 policydb_t * p, FILE * fp)
89 fprintf(fp, "{");
94 fprintf(fp, " %s", perm);
97 fprintf(fp, " }");
100 static void display_id(policydb_t * p, FILE * fp, uint32_t symbol_type,
108 fprintf(fp, " [%s%s]", prefix, id);
110 fprintf(fp, " %s%s", prefix, id);
115 FILE * fp)
120 fprintf(fp, " * ");
123 fprintf(fp, " ~");
152 fprintf(fp, "{");
158 display_id(policy, fp, SYM_TYPES, i, "");
165 display_id(policy, fp, SYM_TYPES, i, "-");
169 fprintf(fp, " self");
173 fprintf(fp, " }");
178 static int display_mod_role_set(role_set_t * roles, policydb_t * p, FILE * fp)
183 fprintf(fp, " * ");
186 fprintf(fp, " ~");
195 fprintf(fp, "{");
203 display_id(p, fp, SYM_ROLES, i, "");
207 fprintf(fp, " }");
214 FILE * fp)
220 fprintf(fp, " <empty>\n");
225 fprintf(fp, " allow");
228 fprintf(fp, " auditallow ");
231 fprintf(fp, " dontaudit");
235 fprintf(fp, " type_transition");
238 fprintf(fp, " type_member");
241 fprintf(fp, " type_change");
244 fprintf(fp, " neverallow");
247 fprintf(fp, "allowxperm ");
249 fprintf(fp, "auditallowxperm ");
251 fprintf(fp, "dontauditxperm ");
253 fprintf(fp, " ERROR: no valid rule type specified\n");
257 if (display_type_set(&avrule->stypes, 0, policy, fp))
260 if (display_type_set(&avrule->ttypes, avrule->flags, policy, fp))
263 fprintf(fp, " :");
274 fprintf(fp, " {");
278 display_id(policy, fp, SYM_CLASSES, cur->tclass - 1, "");
283 fprintf(fp, " }");
284 fprintf(fp, " ");
288 policy, fp);
290 display_id(policy, fp, SYM_TYPES, avrule->perms->data - 1, "");
300 fprintf(fp, " ERROR: no valid xperms specified\n");
308 fprintf(fp, "%s", sepol_extended_perms_to_string(&xperms));
311 fprintf(fp, ";\n");
319 FILE *fp;
323 fp = (FILE *) data;
326 display_id(&policydb, fp, SYM_TYPES, type->s.value - 1, "");
327 fprintf(fp, " [%d]: ", type->s.value);
332 fprintf(fp, " %s [%d]: ", (char *)key, type->s.value);
335 fprintf(fp, "attribute for types");
343 fprintf(fp, ",");
345 display_id(&policydb, fp, SYM_TYPES, i, "");
348 fprintf(fp, "type");
350 fprintf(fp, "alias for type");
351 display_id(&policydb, fp, SYM_TYPES, type->s.value - 1, "");
353 fprintf(fp, " flags:%x\n", type->flags);
358 static int display_types(policydb_t * p, FILE * fp)
360 if (hashtab_map(p->p_types.table, display_type_callback, fp))
365 static int display_users(policydb_t * p, FILE * fp)
370 display_id(p, fp, SYM_USERS, i, "");
371 fprintf(fp, ":");
376 display_id(p, fp, SYM_ROLES, j, "");
379 fprintf(fp, "\n");
384 static int display_bools(policydb_t * p, FILE * fp)
389 display_id(p, fp, SYM_BOOLS, i, "");
390 fprintf(fp, " : %d\n", p->bool_val_to_struct[i]->state);
395 static void display_expr(policydb_t * p, cond_expr_t * exp, FILE * fp)
402 fprintf(fp, "%s ",
406 fprintf(fp, "! ");
409 fprintf(fp, "|| ");
412 fprintf(fp, "&& ");
415 fprintf(fp, "^ ");
418 fprintf(fp, "== ");
421 fprintf(fp, "!= ");
424 fprintf(fp, "error!");
430 static void display_policycon(FILE * fp)
434 fprintf(fp, "Sorry, not implemented\n");
437 static void display_initial_sids(policydb_t * p, FILE * fp)
442 fprintf(fp, "Initial SIDs:\n");
447 fprintf(fp, "\tsid %d, context %s:%s:%s\n",
451 fprintf(fp, "Policy Initial SIDs:\n");
456 fprintf(fp, "\t%s: sid %d, context %s:%s:%s\n",
462 static void display_class_set(ebitmap_t *classes, policydb_t *p, FILE *fp)
471 fprintf(fp, "{");
478 display_id(p, fp, SYM_CLASSES, i, "");
482 fprintf(fp, " }");
485 static void display_role_trans(role_trans_rule_t * tr, policydb_t * p, FILE * fp)
488 fprintf(fp, "role transition ");
489 display_mod_role_set(&tr->roles, p, fp);
490 display_type_set(&tr->types, 0, p, fp);
491 fprintf(fp, " :");
492 display_class_set(&tr->classes, p, fp);
493 display_id(p, fp, SYM_ROLES, tr->new_role - 1, "");
494 fprintf(fp, "\n");
498 static void display_role_allow(role_allow_rule_t * ra, policydb_t * p, FILE * fp)
501 fprintf(fp, "role allow ");
502 display_mod_role_set(&ra->roles, p, fp);
503 display_mod_role_set(&ra->new_roles, p, fp);
504 fprintf(fp, "\n");
508 static void display_filename_trans(filename_trans_rule_t * tr, policydb_t * p, FILE * fp)
510 fprintf(fp, "filename transition");
512 display_type_set(&tr->stypes, 0, p, fp);
513 display_type_set(&tr->ttypes, 0, p, fp);
514 display_id(p, fp, SYM_CLASSES, tr->tclass - 1, ":");
515 display_id(p, fp, SYM_TYPES, tr->otype - 1, "");
516 fprintf(fp, " %s\n", tr->name);
524 FILE *fp;
527 fp = (FILE *) data;
529 fprintf(fp, "role:");
530 display_id(&policydb, fp, SYM_ROLES, role->s.value - 1, "");
531 fprintf(fp, " types: ");
532 display_type_set(&role->types, 0, &policydb, fp);
533 fprintf(fp, "\n");
573 int display_cond_expressions(policydb_t * p, FILE * fp)
578 fprintf(fp, "expression: ");
579 display_expr(p, cur->expr, fp);
580 fprintf(fp, "current state: %d\n", cur->cur_state);
581 fprintf(fp, "True list:\n");
584 fprintf(fp, "\t");
586 RENDER_CONDITIONAL, p, fp);
588 fprintf(fp, "False list:\n");
591 fprintf(fp, "\t");
593 RENDER_CONDITIONAL, p, fp);
599 int change_bool(char *name, int state, policydb_t * p, FILE * fp)
605 fprintf(fp, "Could not find bool %s\n", name);
738 f.fp = in_fp;
821 static void display_policycaps(policydb_t * p, FILE * fp)
828 fprintf(fp, "policy capabilities:\n");
835 fprintf(fp, "\t%s\n", capname);