tmpfiles: reject unused argument fields

Line types which do not use the argument field used to warn and ignore
a non-empty field. Treat that as invalid configuration instead, so typos
are not silently accepted.

Follow-up for: 614cc34f3a
This commit is contained in:
dongshengyuan
2026-07-29 15:29:54 +08:00
parent d47b07d05f
commit e347f63b0f
6 changed files with 24 additions and 7 deletions
+5 -3
View File
@@ -4043,9 +4043,11 @@ static int parse_line(
case ADJUST_MODE:
case RELABEL_PATH:
case RECURSIVE_RELABEL_PATH:
if (i.argument)
log_syntax(NULL, LOG_WARNING, fname, line, 0,
"%c lines don't take argument fields, ignoring.", (char) i.type);
if (i.argument) {
*invalid_config = true;
return log_syntax(NULL, LOG_ERR, fname, line, SYNTHETIC_ERRNO(EBADMSG),
"%c lines don't take argument fields.", (char) i.type);
}
break;
case CREATE_FILE: