Compare commits

...

2 Commits

Author SHA1 Message Date
Daan De Meyer 304c179a2c
Merge 9c7fcdcb24 into d80a9042ca 2024-09-17 19:19:29 +09:00
Daan De Meyer 9c7fcdcb24 tmpfiles: Gracefully handle EROFS from fchownat() 2024-09-16 12:59:49 +02:00
1 changed files with 6 additions and 2 deletions

View File

@ -1057,8 +1057,12 @@ static int fd_set_perms(
fchownat(fd, "",
new_uid != st->st_uid ? new_uid : UID_INVALID,
new_gid != st->st_gid ? new_gid : GID_INVALID,
AT_EMPTY_PATH) < 0)
return log_error_errno(errno, "fchownat() of %s failed: %m", path);
AT_EMPTY_PATH) < 0) {
if (errno != EROFS)
return log_error_errno(errno, "fchownat() of %s failed: %m", path);
log_notice_errno(errno, "%s is read-only, not changing owner to "UID_FMT":"GID_FMT, path, new_uid, new_gid);
}
}
/* Now, apply the final mode. We do this in two cases: when the user set a mode explicitly, or after a