
Enable validation of the values given to enviroment variables when calling env set. Variables can be restricted to only decimal, hexadecimal, or boolean. If CONFIG_CMD_NET is also defined, the variables can also be restricted to IP address or MAC address.
The format of the list is: type_attribute = [s|d|x|b|i|m] access_atribute = [a|r|o] attributes = type_attribute[access_atribute] entry = variable_name[:attributes] list = entry[,list]
The type attributes are: s - String (default) d - Decimal x - Hexadecimal b - Boolean i - IP address m - MAC address
The access attributes are: a - Any (default) r - Read-only o - Write-once (change default)
- CONFIG_ENV_ACL_DEFAULT Define this to a list (string) to define the "acl" envirnoment variable in the default or embedded environment.
- CONFIG_ENV_ACL_STATIC Define this to a list (string) to define validation that should be done if an entry is not found in the "acl" environment variable. To override a setting in the static list, simply add an entry for the same variable name to the "acl" variable.
Joe Hershberger (12): tools/env: Use a board-specific default env tools/env: Remove unneeded complexity tools/env: Don't call env_init() in fw_getenv() tools/env: Reduce the impact on real-time processes tools/env: Serialize calls to fw_*env env: Make the "silent" env var take effect immediately env: Update serial baudrate in env_relocate() env: Check for NULL pointer in envmatch() env: Clarify the cases for env set env: acl: Add environment variable access control list env: acl: Add support for access control to env ACL env: cosmetic: Consilidate the default env definition
README | 42 +++++++ common/Makefile | 1 + common/cmd_nvedit.c | 171 ++++++++++++++++++++------- common/env_acl.c | 308 ++++++++++++++++++++++++++++++++++++++++++++++++ common/env_common.c | 123 +++++-------------- common/env_embedded.c | 111 +---------------- doc/README.silent | 14 ++- include/env_acl.h | 63 ++++++++++ include/env_default.h | 142 ++++++++++++++++++++++ tools/env/Makefile | 7 +- tools/env/fw_env.c | 305 ++++++++++++++++++++++++----------------------- tools/env/fw_env.h | 25 ++++ tools/env/fw_env_main.c | 59 ++++++---- 13 files changed, 943 insertions(+), 428 deletions(-) create mode 100644 common/env_acl.c create mode 100644 include/env_acl.h create mode 100644 include/env_default.h