diff mbox series

[1/6] env: Warn on force access if ENV_ACCESS_IGNORE_FORCE set

Message ID 20200603000111.7919-1-marex@denx.de
State Accepted
Commit 0f036bf4b87e6416f5c4d23865a62a62d9073c20
Headers show
Series [1/6] env: Warn on force access if ENV_ACCESS_IGNORE_FORCE set | expand

Commit Message

Marek Vasut June 3, 2020, 12:01 a.m. UTC
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 at denx.de>
---
 env/flags.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Tom Rini June 5, 2020, 7:07 p.m. UTC | #1
On Wed, Jun 03, 2020 at 02:01:06AM +0200, Marek Vasut wrote:

> 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 at denx.de>

Reviewed-by: Tom Rini <trini at konsulko.com>
diff mbox series

Patch

diff --git a/env/flags.c b/env/flags.c
index b88fe7ba9c..f7a53775c4 100644
--- a/env/flags.c
+++ b/env/flags.c
@@ -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: