POSIX: check name is too long ENAMETOOLONG

This commit is contained in:
chrislu
2022-01-12 00:16:00 -08:00
parent 2dcb8cb93b
commit cd1ad88f30
4 changed files with 39 additions and 0 deletions

View File

@@ -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
}