From f9ad13d59429ac96a26dd65cca5ee1ebe8efcf82 Mon Sep 17 00:00:00 2001 From: Manuel Montecelo Date: Wed, 23 Sep 2020 15:04:42 +0200 Subject: [PATCH] TT#47113 Change check of /var/log/messages The check of /var/log/messages was not strict enough, and it failed: 22 - - Command: find /var/log/ -type f -name messages ! -group adm: stdout: patterns not found: [!/./] 0 ms 34 - - Command: find /var/log/ -type f -name messages ! -perm 640: stdout: patterns not found: [!/./] 0 ms 51 - - Command: find /var/log/ -type f -name messages ! -user root: stdout: patterns not found: [!/./] 0 ms due to matches of /var/log/asterisk/messages which were not intended, and doesn't follow the same ownership and permissions rules: root@spce:~# ls -l /var/log/asterisk/messages -rw-rw---- 1 asterisk asterisk 0 Dec 10 2019 /var/log/asterisk/messages So convert /var/log/messages back to be a basic check of type "file", as it was initially, because now it's guaranteed to be created (by systemd-tmpfiles). Change-Id: Ibd392a0adef78d09e7b232ef3ccae7f9a7e83f56 (cherry picked from commit 4cd3d9bb9fcdab1ab20710f6d717dcf7afe93d84) (cherry picked from commit 588da9c5eeccf86529b30d9621422dfecb995670) --- templates/135_filesys-logfiles.yaml.tt2 | 30 ++++++------------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/templates/135_filesys-logfiles.yaml.tt2 b/templates/135_filesys-logfiles.yaml.tt2 index bc14f99..f21121a 100644 --- a/templates/135_filesys-logfiles.yaml.tt2 +++ b/templates/135_filesys-logfiles.yaml.tt2 @@ -1,5 +1,12 @@ file: + /var/log/messages: + exists: true + mode: "0640" + owner: root + group: adm + filetype: file + /var/log/syslog: exists: true mode: "0640" @@ -170,26 +177,3 @@ command: - '!/./' stderr: - '!/./' - - # /var/log/messages - - "find /var/log/ -type f -name messages ! -user root": - exit-status: 0 - stdout: - - '!/./' - stderr: - - '!/./' - - "find /var/log/ -type f -name messages ! -group adm": - exit-status: 0 - stdout: - - '!/./' - stderr: - - '!/./' - - "find /var/log/ -type f -name messages ! -perm 640": - exit-status: 0 - stdout: - - '!/./' - stderr: - - '!/./'