5808e7
From a35a90322f8587f650aeb72bfbe1ebcc93e503aa Mon Sep 17 00:00:00 2001
5808e7
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
5808e7
Date: Mon, 22 Jul 2019 10:43:19 +0200
5808e7
Subject: [PATCH] pstore: refuse to run if arguments are specified
5808e7
5808e7
(This is why the --help chech passed.)
5808e7
5808e7
(cherry picked from commit 22d6bea8820612e6a1483d8b6cfd820f1417ae6b)
5808e7
5808e7
Related: #2158832
5808e7
---
5808e7
 src/pstore/pstore.c | 4 ++++
5808e7
 1 file changed, 4 insertions(+)
5808e7
5808e7
diff --git a/src/pstore/pstore.c b/src/pstore/pstore.c
5808e7
index cafb1804c6..b0b21dedd4 100644
5808e7
--- a/src/pstore/pstore.c
5808e7
+++ b/src/pstore/pstore.c
5808e7
@@ -358,6 +358,10 @@ static int run(int argc, char *argv[]) {
5808e7
 
5808e7
         log_open();
5808e7
 
5808e7
+        if (argc > 1)
5808e7
+                return log_error_errno(-EINVAL,
5808e7
+                                       "This program takes no arguments.");
5808e7
+
5808e7
         /* Ignore all parse errors */
5808e7
         (void) parse_config();
5808e7