Skip to content

Commit bbe4a7c

Browse files
committed
apparmor: constify policy name and hname
Signed-off-by: John Johansen <john.johansen@canonical.com>
1 parent 6e474e3 commit bbe4a7c

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎security/apparmor/apparmorfs.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
*
3939
* Returns: length of mangled name
4040
*/
41-
static int mangle_name(char *name, char *target)
41+
static int mangle_name(const char *name, char *target)
4242
{
4343
char *t = target;
4444

‎security/apparmor/include/lib.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ static inline bool path_mediated_fs(struct dentry *dentry)
123123
* @profiles: head of the profiles list contained in the object
124124
*/
125125
struct aa_policy {
126-
char *name;
127-
char *hname;
126+
const char *name;
127+
const char *hname;
128128
struct list_head list;
129129
struct list_head profiles;
130130
};

‎security/apparmor/lib.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ bool aa_policy_init(struct aa_policy *policy, const char *prefix,
178178
policy->hname = kmalloc(strlen(prefix) + strlen(name) + 3,
179179
GFP_KERNEL);
180180
if (policy->hname)
181-
sprintf(policy->hname, "%s//%s", prefix, name);
181+
sprintf((char *)policy->hname, "%s//%s", prefix, name);
182182
} else
183183
policy->hname = kstrdup(name, GFP_KERNEL);
184184
if (!policy->hname)

0 commit comments

Comments
 (0)