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:
Petr Vorel 2021-10-08 11:14:30 +02:00 committed by Mimi Zohar
parent 61868acb07
commit cc4299ea03
2 changed files with 2 additions and 2 deletions

View File

@ -403,7 +403,7 @@ const char *ima_d_path(const struct path *path, char **pathbuf, char *namebuf)
}
if (!pathname) {
strlcpy(namebuf, path->dentry->d_name.name, NAME_MAX);
strscpy(namebuf, path->dentry->d_name.name, NAME_MAX);
pathname = namebuf;
}

View File

@ -870,7 +870,7 @@ static int __init ima_init_arch_policy(void)
char rule[255];
int result;
result = strlcpy(rule, *rules, sizeof(rule));
result = strscpy(rule, *rules, sizeof(rule));
INIT_LIST_HEAD(&arch_policy_entry[i].list);
result = ima_parse_rule(rule, &arch_policy_entry[i]);