mirror of
https://github.com/systemd/systemd.git
synced 2024-11-05 06:52:22 +03:00
base-filesystem: skip fchownat() if the previous mkdirat() on same path failed (#5548)
If we are working on a path that was marked to be ignored on errors, and the mkdirat() fails then add a continue statement and skip fchownat() call. This avoids the case where UID/GID are valid and we run fchownat() on non existent path which will fail hard even on paths that we want to ignore in case of errors.
This commit is contained in:
parent
bda99fab31
commit
d1d59eeb47
@ -117,6 +117,8 @@ int base_filesystem_create(const char *root, uid_t uid, gid_t gid) {
|
||||
|
||||
if (!table[i].ignore_failure)
|
||||
return -errno;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if (uid != UID_INVALID || gid != UID_INVALID) {
|
||||
|
Loading…
Reference in New Issue
Block a user