daandemeyer / rpms / systemd

Forked from rpms/systemd 2 years ago
Clone
923a60
From 95ee3c8f1ef9408543c962af5f21e01ccef544e1 Mon Sep 17 00:00:00 2001
923a60
From: Michal Sekletar <msekleta@redhat.com>
923a60
Date: Thu, 7 Sep 2017 15:46:24 +0200
923a60
Subject: [PATCH] tmpfiles: warn if we get an argument on lines that don't take
923a60
 any
923a60
923a60
(cherry picked from commit c82500c6fb37a25bc3c4b1e0be11a90a395619d9)
923a60
923a60
Related: #1299714
923a60
---
923a60
 src/tmpfiles/tmpfiles.c | 9 +++++++--
923a60
 1 file changed, 7 insertions(+), 2 deletions(-)
923a60
923a60
diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c
923a60
index 800e620bcf..70e0cc2fa3 100644
923a60
--- a/src/tmpfiles/tmpfiles.c
923a60
+++ b/src/tmpfiles/tmpfiles.c
923a60
@@ -1788,8 +1788,6 @@ static int parse_line(const char *fname, unsigned line, const char *buffer) {
923a60
 
923a60
         switch (i.type) {
923a60
 
923a60
-        case CREATE_FILE:
923a60
-        case TRUNCATE_FILE:
923a60
         case CREATE_DIRECTORY:
923a60
         case CREATE_SUBVOLUME:
923a60
         case EMPTY_DIRECTORY:
923a60
@@ -1802,6 +1800,13 @@ static int parse_line(const char *fname, unsigned line, const char *buffer) {
923a60
         case ADJUST_MODE:
923a60
         case RELABEL_PATH:
923a60
         case RECURSIVE_RELABEL_PATH:
923a60
+                if (i.argument)
923a60
+                        log_warning("[%s:%u] %c lines don't take argument field, ignoring.", fname, line, i.type);
923a60
+
923a60
+                break;
923a60
+
923a60
+        case CREATE_FILE:
923a60
+        case TRUNCATE_FILE:
923a60
                 break;
923a60
 
923a60
         case CREATE_SYMLINK: