]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
env: Warn on force access if ENV_ACCESS_IGNORE_FORCE set
authorMarek Vasut <marex@denx.de>
Tue, 7 Jul 2020 18:51:33 +0000 (20:51 +0200)
committerTom Rini <trini@konsulko.com>
Fri, 31 Jul 2020 14:13:00 +0000 (10:13 -0400)
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>
env/flags.c

index b88fe7ba9c8a6b69443e14cea125f9a811bc2886..f7a53775c4420011aa8875a6ebff361c500d8868 100644 (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: