forked from Minki/linux
ima: Use strscpy instead of strlcpy
strlcpy is deprecated, use its safer replacement. Signed-off-by: Petr Vorel <pvorel@suse.cz> Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
This commit is contained in:
parent
61868acb07
commit
cc4299ea03
@ -403,7 +403,7 @@ const char *ima_d_path(const struct path *path, char **pathbuf, char *namebuf)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!pathname) {
|
if (!pathname) {
|
||||||
strlcpy(namebuf, path->dentry->d_name.name, NAME_MAX);
|
strscpy(namebuf, path->dentry->d_name.name, NAME_MAX);
|
||||||
pathname = namebuf;
|
pathname = namebuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -870,7 +870,7 @@ static int __init ima_init_arch_policy(void)
|
|||||||
char rule[255];
|
char rule[255];
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
result = strlcpy(rule, *rules, sizeof(rule));
|
result = strscpy(rule, *rules, sizeof(rule));
|
||||||
|
|
||||||
INIT_LIST_HEAD(&arch_policy_entry[i].list);
|
INIT_LIST_HEAD(&arch_policy_entry[i].list);
|
||||||
result = ima_parse_rule(rule, &arch_policy_entry[i]);
|
result = ima_parse_rule(rule, &arch_policy_entry[i]);
|
||||||
|
Loading…
Reference in New Issue
Block a user