summaryrefslogtreecommitdiff
path: root/internal/syscallcompat/open_nofollow.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/syscallcompat/open_nofollow.go')
-rw-r--r--internal/syscallcompat/open_nofollow.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/internal/syscallcompat/open_nofollow.go b/internal/syscallcompat/open_nofollow.go
index c804e12..1afa54c 100644
--- a/internal/syscallcompat/open_nofollow.go
+++ b/internal/syscallcompat/open_nofollow.go
@@ -27,6 +27,10 @@ func OpenNofollow(baseDir string, relPath string, flags int, mode uint32) (fd in
if err != nil {
return -1, err
}
+ // Caller wanted to open baseDir itself?
+ if relPath == "" {
+ return dirfd, nil
+ }
// Split the path into components and separate intermediate directories
// and the final basename
parts := strings.Split(relPath, "/")