13
debug_file="class_to_string.h"
14
debug_file2="initial_sid_to_string.h"
18
outfile = \"$output_file\"
19
debugfile = \"$debug_file\"
20
debugfile2 = \"$debug_file2\"
24
printf("/* This file is automatically generated. Do not edit. */\n") > outfile;
26
printf("#ifndef _SELINUX_FLASK_H_\n") > outfile;
27
printf("#define _SELINUX_FLASK_H_\n") > outfile;
28
printf("\n/*\n * Security object class definitions\n */\n") > outfile;
29
printf("/* This file is automatically generated. Do not edit. */\n") > debugfile;
30
printf("/*\n * Security object class definitions\n */\n") > debugfile;
31
printf("static char *class_to_string[] =\n{\n") > debugfile;
32
printf(" \"null\",\n") > debugfile;
33
printf("/* This file is automatically generated. Do not edit. */\n") > debugfile2;
34
printf("static char *initial_sid_to_string[] =\n{\n") > debugfile2;
35
printf(" \"null\",\n") > debugfile2;
41
if (nextstate != "CLASS")
43
printf("Parse error: Unexpected class definition on line %d\n", NR);
47
if ($2 in class_found)
49
printf("Duplicate class definition for %s on line %d.\n", $2, NR);
56
printf("#define SECCLASS_%s", toupper($2)) > outfile;
57
for (i = 0; i < 40 - length($2); i++)
58
printf(" ") > outfile;
59
printf("%d\n", class_value) > outfile;
61
printf(" \"%s\",\n", $2) > debugfile;
64
if (nextstate == "CLASS")
67
printf("};\n\n") > debugfile;
68
printf("\n/*\n * Security identifier indices for initial entities\n */\n") > outfile;
73
printf("Duplicate SID definition for %s on line %d.\n", $2, NR);
79
printf("#define SECINITSID_%s", toupper($2)) > outfile;
80
for (i = 0; i < 37 - length($2); i++)
81
printf(" ") > outfile;
82
printf("%d\n", sid_value) > outfile;
83
printf(" \"%s\",\n", $2) > debugfile2;
86
if (nextstate != "SID")
87
printf("Parse error: Unexpected end of file\n");
89
printf("\n#define SECINITSID_NUM") > outfile;
90
for (i = 0; i < 34; i++)
91
printf(" ") > outfile;
92
printf("%d\n", sid_value) > outfile;
93
printf("\n#endif\n") > outfile;
94
printf("};\n\n") > debugfile2;