From ff3d733095f23068056e8e3273a343d10149e87e Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Wed, 3 Apr 2024 09:24:33 +0200 Subject: AtLocation.walk: add support for AT_EMPTY_PATH --- linuxnamespaces/atlocation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linuxnamespaces/atlocation.py b/linuxnamespaces/atlocation.py index 24c2cce..6aada55 100644 --- a/linuxnamespaces/atlocation.py +++ b/linuxnamespaces/atlocation.py @@ -505,7 +505,7 @@ class AtLocation: AtLocations referencing the same object as the dirpath though as an AT_EMPTY_PATH with temporary fd. """ - if self.flags != AtFlags.NONE: + if self.flags & ~AtFlags.AT_EMPTY_PATH != AtFlags.NONE: raise NotImplementedError( "walk is not supported for an AtLocation with flags" ) @@ -513,7 +513,7 @@ class AtLocation: if follow_symlinks: flags = AtFlags.NONE for dirpath, dirnames, filenames, dirfd in os.fwalk( - self.location, + "." if self.flags & AtFlags.AT_EMPTY_PATH else self.location, topdown=topdown, onerror=onerror, follow_symlinks=follow_symlinks, -- cgit v1.2.3