pstore: refuse to run if arguments are specified
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 22 Jul 2019 08:43:19 +0000 (10:43 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 22 Jul 2019 08:43:19 +0000 (10:43 +0200)
(This is why the --help chech passed.)

src/pstore/pstore.c

index 0c4e2f0..60519e1 100644 (file)
@@ -361,6 +361,10 @@ static int run(int argc, char *argv[]) {
 
         log_open();
 
+        if (argc > 1)
+                return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
+                                       "This program takes no arguments.");
+
         /* Ignore all parse errors */
         (void) parse_config();