summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDjalal Harouni <tixxdz@opendz.org>2017-03-16 03:30:15 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-03-15 22:30:15 -0400
commitd1d59eeb4720371d255fcee025e9e7d96bd625d1 (patch)
treea8bca53c81bf904779232a3a6f6ba1b34129e281 /src
parentbda99fab3104095420d3ee03593d07469153f6c4 (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/shared/base-filesystem.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/shared/base-filesystem.c b/src/shared/base-filesystem.c
index 127cbe44e3..f2d8bcf6e3 100644
--- a/src/shared/base-filesystem.c
+++ b/src/shared/base-filesystem.c
@@ -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) {