From: Lukas Funke <lukas.fu...@weidmueller.com>
This series extends the flags-variable with ranges for environment variables. The range is appended to the variable flags using the '@'-character. A range can be decimal (min/max), bitmask or regular expression (64 byte). Value ranges for variables can be used to make the environment more robust against faults such as invalid user input or attacks. Decimal-range: foo:da@<min>-<max> Hexadecimal-range(bitmask): bar:xa@0xdeadbeed Regex-range: mystring:sa@r"klaus|haus|maus" Example: "decimalvalue:dw@100-200," ... => env set decimalvalue 1 1 < 100 || 1 > 200 => env set decimalvalue 150 => Lukas Funke (1): env: introduce variable ranges cmd/nvedit.c | 30 +++--- env/flags.c | 217 +++++++++++++++++++++++++++++++++++++- include/configs/sandbox.h | 5 + include/env_flags.h | 27 ++++- include/search.h | 1 + test/env/Makefile | 1 + test/env/range.c | 113 ++++++++++++++++++++ 7 files changed, 377 insertions(+), 17 deletions(-) create mode 100644 test/env/range.c -- 2.30.2