env: Warn on force access if ENV_ACCESS_IGNORE_FORCE set

If the ENV_ACCESS_IGNORE_FORCE is set, inform user that the variable
cannot be force-set if such attempt happens.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
Marek Vasut 2020-07-07 20:51:33 +02:00 committed by Tom Rini
parent ef5cc2e5c6
commit 0f036bf4b8
1 changed files with 3 additions and 1 deletions

4
env/flags.c vendored
View File

@ -524,8 +524,10 @@ int env_flags_validate(const struct env_entry *item, const char *newval,
/* check for access permission */
#ifndef CONFIG_ENV_ACCESS_IGNORE_FORCE
if (flag & H_FORCE)
if (flag & H_FORCE) {
printf("## Error: Can't force access to \"%s\"\n", name);
return 0;
}
#endif
switch (op) {
case env_op_delete: