]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tmpfiles: ignore EINVAL with --graceful
authorFrantisek Sumsal <frantisek@sumsal.cz>
Fri, 27 Oct 2023 19:46:18 +0000 (21:46 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Sat, 28 Oct 2023 09:14:07 +0000 (10:14 +0100)
Add EINVAL to the list of ignored errnos, since acl_from_text() returns
EINVAL if it can't translate the given string.

~# cat /tmp/tmpfiles-test.conf
a+ /tmp/foo - - - - default:group:foo:rwx
~# build/systemd-tmpfiles /tmp/tmpfiles-test.conf --create --graceful
Failed to parse ACL "default:group:foo:rwx", ignoring: Invalid argument

Resolves: #29742

src/tmpfiles/tmpfiles.c

index e18f5bd7645bf84e2f3456c39b02eac92d3e8be8..230ec09b97904b485c056fc791b345ca79a914c8 100644 (file)
@@ -1161,7 +1161,7 @@ static int parse_acls_from_arg(Item *item) {
         r = parse_acl(item->argument, &item->acl_access, &item->acl_access_exec,
                       &item->acl_default, !item->append_or_force);
         if (r < 0)
-                log_full_errno(arg_graceful && IN_SET(r, -ENOENT, -ESRCH) ? LOG_DEBUG : LOG_WARNING,
+                log_full_errno(arg_graceful && IN_SET(r, -EINVAL, -ENOENT, -ESRCH) ? LOG_DEBUG : LOG_WARNING,
                                r, "Failed to parse ACL \"%s\", ignoring: %m", item->argument);
 #else
         log_warning("ACLs are not supported, ignoring.");