From e63c9b133d480495cd3abb124dcb523b5b963d3c Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Mon, 16 Mar 2020 11:36:53 +0100 Subject: [PATCH] main: stop ino lookup without an open fd stop the lookup for the dev/ino if there is not an ino open as it also prevents reading the origin xattr. Signed-off-by: Giuseppe Scrivano --- main.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index 5b00d80..149a490 100644 --- a/main.c +++ b/main.c @@ -1259,7 +1259,8 @@ make_ovl_node (struct ovl_data *lo, const char *path, struct ovl_layer *layer, c } ret->last_layer = it; } - goto no_fd; + has_origin = false; + goto no_fd; } /* It is an open FD, stat the file and read the origin xattrs. */ @@ -1276,7 +1277,10 @@ make_ovl_node (struct ovl_data *lo, const char *path, struct ovl_layer *layer, c } if (stat_only) - goto no_fd; + { + has_origin = false; + goto no_fd; + } s = safe_read_xattr (&val, fd, PRIVILEGED_ORIGIN_XATTR, PATH_MAX); if (s > 0)