-/* SPDX-License-Identifier: LGPL-2.1+ */
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <errno.h>
#include <fcntl.h>
strna(t), pretty);
r = acl_set_file(path, type, dup);
- if (r < 0)
- /* Return positive to indicate we already warned */
- return -log_error_errno(errno,
- "Setting %s ACL \"%s\" on %s failed: %m",
- type == ACL_TYPE_ACCESS ? "access" : "default",
- strna(t), pretty);
-
+ if (r < 0) {
+ if (ERRNO_IS_NOT_SUPPORTED(errno))
+ /* No error if filesystem doesn't support ACLs. Return negative. */
+ return -errno;
+ else
+ /* Return positive to indicate we already warned */
+ return -log_error_errno(errno,
+ "Setting %s ACL \"%s\" on %s failed: %m",
+ type == ACL_TYPE_ACCESS ? "access" : "default",
+ strna(t), pretty);
+ }
return 0;
}
#endif
if (r == 0 && item->acl_default && S_ISDIR(st->st_mode))
r = path_set_acl(procfs_path, path, ACL_TYPE_DEFAULT, item->acl_default, item->append_or_force);
+ if (ERRNO_IS_NOT_SUPPORTED(r)) {
+ log_debug_errno(r, "ACLs not supported by file system at %s", path);
+ return 0;
+ }
+
if (r > 0)
return -r; /* already warned */
if (r == -ENOENT && proc_mounted() == 0)
r = -ENOSYS;
- if (r == -EOPNOTSUPP) {
- log_debug_errno(r, "ACLs not supported by file system at %s", path);
- return 0;
- }
if (r < 0)
return log_error_errno(r, "ACL operation on \"%s\" failed: %m", path);
#endif