Skip to content

Commit 95ff118

Browse files
canonical-rlee287jrjohansen
authored andcommitted
apparmor: make all generated string array headers const char *const
address_family_names and sock_type_names were created as const char *a[], which declares them as (non-const) pointers to const chars. Since the pointers themselves would not be changed, they should be generated as const char *const a[]. Signed-off-by: Ryan Lee <ryan.lee@canonical.com> Signed-off-by: John Johansen <john.johansen@canonical.com>
1 parent a88db91 commit 95ff118

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

security/apparmor/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ clean-files := capability_names.h rlim_names.h net_names.h
2828
# to
2929
# #define AA_SFS_AF_MASK "local inet"
3030
quiet_cmd_make-af = GEN $@
31-
cmd_make-af = echo "static const char *address_family_names[] = {" > $@ ;\
31+
cmd_make-af = echo "static const char *const address_family_names[] = {" > $@ ;\
3232
sed $< >>$@ -r -n -e "/AF_MAX/d" -e "/AF_LOCAL/d" -e "/AF_ROUTE/d" -e \
3333
's/^\#define[ \t]+AF_([A-Z0-9_]+)[ \t]+([0-9]+)(.*)/[\2] = "\L\1",/p';\
3434
echo "};" >> $@ ;\
@@ -43,7 +43,7 @@ cmd_make-af = echo "static const char *address_family_names[] = {" > $@ ;\
4343
# to
4444
# [1] = "stream",
4545
quiet_cmd_make-sock = GEN $@
46-
cmd_make-sock = echo "static const char *sock_type_names[] = {" >> $@ ;\
46+
cmd_make-sock = echo "static const char *const sock_type_names[] = {" >> $@ ;\
4747
sed $^ >>$@ -r -n \
4848
-e 's/^\tSOCK_([A-Z0-9_]+)[\t]+=[ \t]+([0-9]+)(.*)/[\2] = "\L\1",/p';\
4949
echo "};" >> $@

0 commit comments

Comments
 (0)