diff options
Diffstat (limited to 'linuxnamespaces')
-rw-r--r-- | linuxnamespaces/atlocation.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/linuxnamespaces/atlocation.py b/linuxnamespaces/atlocation.py index 79f55bb..66b0947 100644 --- a/linuxnamespaces/atlocation.py +++ b/linuxnamespaces/atlocation.py @@ -413,7 +413,9 @@ class AtLocation: def readlink(self) -> str: """Wrapper for os.readlink supplying path and dir_fd.""" - if self.flags & ~AtFlags.AT_EMPTY_PATH != AtFlags.NONE: + if self.flags & AtFlags.AT_SYMLINK_NOFOLLOW == AtFlags.NONE: + raise NotImplementedError("cannot read a link after following it") + if self.flags & ~AtFlags.AT_EMPTY_PATH != AtFlags.AT_SYMLINK_NOFOLLOW: raise NotImplementedError( "readlink on AtLocation only support flag AT_EMPTY_PATH" ) |