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(" S_(\"null\")\n") > debugfile;
32
printf("/* This file is automatically generated. Do not edit. */\n") > debugfile2;
33
printf("static char *initial_sid_to_string[] =\n{\n") > debugfile2;
34
printf(" \"null\",\n") > debugfile2;
40
if (nextstate != "CLASS")
42
printf("Parse error: Unexpected class definition on line %d\n", NR);
46
if ($2 in class_found)
48
printf("Duplicate class definition for %s on line %d.\n", $2, NR);
55
printf("#define SECCLASS_%s", toupper($2)) > outfile;
56
for (i = 0; i < 40 - length($2); i++)
57
printf(" ") > outfile;
58
printf("%d\n", class_value) > outfile;
60
printf(" S_(\"%s\")\n", $2) > debugfile;
63
if (nextstate == "CLASS")
66
printf("\n/*\n * Security identifier indices for initial entities\n */\n") > outfile;
71
printf("Duplicate SID definition for %s on line %d.\n", $2, NR);
77
printf("#define SECINITSID_%s", toupper($2)) > outfile;
78
for (i = 0; i < 37 - length($2); i++)
79
printf(" ") > outfile;
80
printf("%d\n", sid_value) > outfile;
81
printf(" \"%s\",\n", $2) > debugfile2;
84
if (nextstate != "SID")
85
printf("Parse error: Unexpected end of file\n");
87
printf("\n#define SECINITSID_NUM") > outfile;
88
for (i = 0; i < 34; i++)
89
printf(" ") > outfile;
90
printf("%d\n", sid_value) > outfile;
91
printf("\n#endif\n") > outfile;
92
printf("};\n\n") > debugfile2;