
Dear Stefano,
In message 48F5DBB7.4070307@babic.homelinux.org you wrote:
Wolfgang Denk wrote:
Good catch. Yes, this must be prevented. Any variable named "builtin" must be ignored here - i. e. we should issue an erro when someone tries a "setenv", and ignore this variable explicitly (just in case someone sneaks this into the default environment, or uses un-fixed Linux tools to create such a variable).
I know, I wanted to know which is the preferred method to avoid that. One way is to avoid to set the variable, as you suggest. The other way is never execute a variable with the name "builtin" in the command interpreter: "setenv builtin <something>" remains possible but "builtin <command>" calls always the U-Boot commands.
We should do both: avoid that the variable gets set, and raise error messages (both in setenv() and in the fw_setenv Linux tool), but we should also be defensive and never execute it if we run into it (which could for example happen if we're being poresented an old environment where some user defined such a variable).
Best regards,
Wolfgang Denk