]> xenbits.xensource.com Git - people/dwmw2/xen.git/commitdiff
xsm/flask: mkflash.sh: Use const when generating initial_sid_to_string[]
authorJulien Grall <jgrall@amazon.com>
Mon, 12 Dec 2022 09:36:31 +0000 (09:36 +0000)
committerJulien Grall <jgrall@amazon.com>
Tue, 20 Dec 2022 09:28:06 +0000 (09:28 +0000)
The array initial_sid_to_string is storing pointer to literal strings
and is not meant to be modified. So change the type of the variable
to "const char * const ...[]".

Signed-off-by: Julien Grall <jgrall@amazon.com>
Ack-by: Daniel P. Smith <dpsmith@apertussolutions.com>
xen/xsm/flask/policy/mkflask.sh

index 591ce832a1d10be716461fdc7162c45bb2b8ff46..61168976816745504d237f0a3f3d6f8d4951bbae 100755 (executable)
@@ -34,7 +34,7 @@ BEGIN {
                printf("/*\n * Security object class definitions\n */\n") > debugfile;
                printf("    S_(\"null\")\n") > debugfile;
                printf("/* This file is automatically generated.  Do not edit. */\n") > debugfile2;
-               printf("static char *initial_sid_to_string[] =\n{\n") > debugfile2;
+               printf("static const char * const initial_sid_to_string[] =\n{\n") > debugfile2;
                printf("    \"null\",\n") > debugfile2;
        }
 /^[ \t]*#/     {