dryang / rpms / systemd

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