[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] xsm/flask: mkflash.sh: Use const when generating initial_sid_to_string[]
- To: Julien Grall <julien@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
- From: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 12 Dec 2022 06:31:41 -0500
- Arc-authentication-results: i=1; mx.zohomail.com; dkim=pass header.i=apertussolutions.com; spf=pass smtp.mailfrom=dpsmith@xxxxxxxxxxxxxxxxxxxx; dmarc=pass header.from=<dpsmith@xxxxxxxxxxxxxxxxxxxx>
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1670844705; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=A1lN9Op5XdwBekxwxyKSk7QHsWn0d6DzrHYzjjeX2go=; b=TMtE8ApPl9Bx1/gnbTWdi7FwGWVLuvPbwHYfmQaDCaYJf0HiY9R5vA1Gju+z/BDYUvKPgnR4AG8/oVJzCjAjKNJ8p708+bdl6JcSaqz+b8rB54u1pe6vpPxs92TZAuwhqJbeRK4jio14oGjDpE6OLAP6GR9R0QxEM+YN9a3WZcg=
- Arc-seal: i=1; a=rsa-sha256; t=1670844705; cv=none; d=zohomail.com; s=zohoarc; b=RRo4IxUK5qftydASyZjADfjaO9qHe486UWix+GlHL/4T465GTLKvIcbzrG5poEZdsYFAlrYvFzfiBCETNhfoiF80hEz1qkMKnJNiPBvOZy/v27MUQ9PwQ08nB/mQtJeza7C40g0m1bI5J9HyLg3VVZDcEU0twpViZ16h4EF+mUg=
- Cc: Julien Grall <jgrall@xxxxxxxxxx>
- Delivery-date: Mon, 12 Dec 2022 11:31:58 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 12/12/22 04:36, Julien Grall wrote:
From: Julien Grall <jgrall@xxxxxxxxxx>
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@xxxxxxxxxx>
---
xen/xsm/flask/policy/mkflask.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/xen/xsm/flask/policy/mkflask.sh b/xen/xsm/flask/policy/mkflask.sh
index 591ce832a1d1..611689768167 100755
--- a/xen/xsm/flask/policy/mkflask.sh
+++ b/xen/xsm/flask/policy/mkflask.sh
@@ -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]*#/ {
Ack-by: Daniel P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>
|