diff options
author | Jakob Unterwurzacher | 2018-11-04 22:01:18 +0100 |
---|---|---|
committer | Jakob Unterwurzacher | 2019-01-01 16:24:25 +0100 |
commit | 4fae240153a5300b7108bf5c2de2b6581c8ee7fd (patch) | |
tree | 383ae37643dbec97ae786358ad22488f7eb351d0 /internal/syscallcompat | |
parent | 21f1f858b9bebb20fdb9bb3f99189279bb6c6976 (diff) |
fusefrontend: make Readlink() symlink-safe
Now symlink-safe through Readlinkat().
Diffstat (limited to 'internal/syscallcompat')
-rw-r--r-- | internal/syscallcompat/sys_common.go | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/internal/syscallcompat/sys_common.go b/internal/syscallcompat/sys_common.go index c1fd00a..33ed807 100644 --- a/internal/syscallcompat/sys_common.go +++ b/internal/syscallcompat/sys_common.go @@ -10,10 +10,8 @@ import ( // It is not defined on Darwin, so we use the Linux value. const PATH_MAX = 4096 -// Readlinkat exists both in Linux and in MacOS 10.10+. We may add an -// emulated version for users on older MacOS versions if there is -// demand. -// Buffer allocation is handled internally, unlike the bare unix.Readlinkat. +// Readlinkat is a convenience wrapper around unix.Readlinkat() that takes +// care of buffer sizing. Implemented like os.Readlink(). func Readlinkat(dirfd int, path string) (string, error) { // Allocate the buffer exponentially like os.Readlink does. for bufsz := 128; ; bufsz *= 2 { |