summaryrefslogtreecommitdiff
path: root/linuxnamespaces
diff options
context:
space:
mode:
Diffstat (limited to 'linuxnamespaces')
-rw-r--r--linuxnamespaces/atlocation.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/linuxnamespaces/atlocation.py b/linuxnamespaces/atlocation.py
index 66b0947..24c2cce 100644
--- a/linuxnamespaces/atlocation.py
+++ b/linuxnamespaces/atlocation.py
@@ -509,6 +509,9 @@ class AtLocation:
raise NotImplementedError(
"walk is not supported for an AtLocation with flags"
)
+ flags = AtFlags.AT_SYMLINK_NOFOLLOW
+ if follow_symlinks:
+ flags = AtFlags.NONE
for dirpath, dirnames, filenames, dirfd in os.fwalk(
self.location,
topdown=topdown,
@@ -517,9 +520,9 @@ class AtLocation:
dir_fd=self.fd_or_none,
):
yield (
- AtLocation(self.fd, dirpath),
- [AtLocation(dirfd, dirname) for dirname in dirnames],
- [AtLocation(dirfd, filename) for filename in filenames],
+ AtLocation(self.fd, dirpath, flags),
+ [AtLocation(dirfd, dirname, flags) for dirname in dirnames],
+ [AtLocation(dirfd, filename, flags) for filename in filenames],
AtLocation(dirfd),
)