From: Andreas Reichel <[email protected]> Until now, providing no arguments caused bg_setenv to recalculate the CRC of the latest environment and rewrite it.
This patch prevent it from doing this rather unintuitive action and output a string to tell the user he must give further arguments instead. Signed-off-by: Andreas Reichel <[email protected]> --- tools/bg_setenv.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/bg_setenv.c b/tools/bg_setenv.c index 37f50ce..ca64b92 100644 --- a/tools/bg_setenv.c +++ b/tools/bg_setenv.c @@ -542,6 +542,14 @@ int main(int argc, char **argv) bool write_mode = (bool)strstr(argv[0], "bg_setenv"); if (write_mode) { argp = &argp_setenv; + + if (argc < 2) { + printf("No task to perform. Please specify at least one" + " optional argument. See --help for further" + " information.\n"); + return 1; + } + } else { argp = &argp_printenv; verbosity = true; -- 2.16.2 -- You received this message because you are subscribed to the Google Groups "EFI Boot Guard" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/efibootguard-dev/20180305164459.8196-1-andreas.reichel.ext%40siemens.com. For more options, visit https://groups.google.com/d/optout.
