Skip to content

Commit 2d4cee7

Browse files
Jan Engelhardtjrjohansen
authored andcommitted
AppArmor: add const qualifiers to string arrays
Signed-off-by: Jan Engelhardt <jengelh@medozas.de> Signed-off-by: John Johansen <john.johansen@canonical.com>
1 parent ad5ff3d commit 2d4cee7

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

‎security/apparmor/audit.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include "include/audit.h"
2020
#include "include/policy.h"
2121

22-
const char *op_table[] = {
22+
const char *const op_table[] = {
2323
"null",
2424

2525
"sysctl",
@@ -73,15 +73,15 @@ const char *op_table[] = {
7373
"profile_remove"
7474
};
7575

76-
const char *audit_mode_names[] = {
76+
const char *const audit_mode_names[] = {
7777
"normal",
7878
"quiet_denied",
7979
"quiet",
8080
"noquiet",
8181
"all"
8282
};
8383

84-
static char *aa_audit_type[] = {
84+
static const char *const aa_audit_type[] = {
8585
"AUDIT",
8686
"ALLOWED",
8787
"DENIED",

‎security/apparmor/include/audit.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
struct aa_profile;
2727

28-
extern const char *audit_mode_names[];
28+
extern const char *const audit_mode_names[];
2929
#define AUDIT_MAX_INDEX 5
3030

3131
enum audit_mode {
@@ -47,7 +47,7 @@ enum audit_type {
4747
AUDIT_APPARMOR_AUTO
4848
};
4949

50-
extern const char *op_table[];
50+
extern const char *const op_table[];
5151
enum aa_ops {
5252
OP_NULL,
5353

‎security/apparmor/include/policy.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#include "file.h"
3030
#include "resource.h"
3131

32-
extern const char *profile_mode_names[];
32+
extern const char *const profile_mode_names[];
3333
#define APPARMOR_NAMES_MAX_INDEX 3
3434

3535
#define COMPLAIN_MODE(_profile) \

‎security/apparmor/policy.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
/* root profile namespace */
9494
struct aa_namespace *root_ns;
9595

96-
const char *profile_mode_names[] = {
96+
const char *const profile_mode_names[] = {
9797
"enforce",
9898
"complain",
9999
"kill",

0 commit comments

Comments
 (0)