aboutsummaryrefslogtreecommitdiff
path: root/weed/filesys/xattr.go
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2022-01-12 00:16:00 -0800
committerchrislu <chris.lu@gmail.com>2022-01-12 00:16:00 -0800
commitcd1ad88f30419f330af22333e1621b92d3a9b695 (patch)
tree02850d7ed2193b155ed6d356a08c5719b21d167c /weed/filesys/xattr.go
parent2dcb8cb93b951bd8457cdb670edf2146b068a836 (diff)
downloadseaweedfs-cd1ad88f30419f330af22333e1621b92d3a9b695.tar.xz
seaweedfs-cd1ad88f30419f330af22333e1621b92d3a9b695.zip
POSIX: check name is too long ENAMETOOLONG
Diffstat (limited to 'weed/filesys/xattr.go')
-rw-r--r--weed/filesys/xattr.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/weed/filesys/xattr.go b/weed/filesys/xattr.go
index 6021fd8ec..818652f64 100644
--- a/weed/filesys/xattr.go
+++ b/weed/filesys/xattr.go
@@ -3,6 +3,7 @@ package filesys
import (
"context"
"strings"
+ "syscall"
"github.com/seaweedfs/fuse"
@@ -143,3 +144,10 @@ func (wfs *WFS) maybeLoadEntry(dir, name string) (entry *filer_pb.Entry, err err
}
return cachedEntry.ToProtoEntry(), cacheErr
}
+
+func checkName(name string) error {
+ if len(name) >= 256 {
+ return syscall.ENAMETOOLONG
+ }
+ return nil
+}