summaryrefslogtreecommitdiffhomepage
path: root/pkg/p9
diff options
context:
space:
mode:
authorAdin Scannell <ascannell@google.com>2018-10-23 11:26:31 -0700
committerShentubot <shentubot@google.com>2018-10-23 11:27:28 -0700
commitce3a762038006429b1eb3b855d4e9c5d700edfda (patch)
tree8eb0f259059c0e4b08bbd1b40890729d5fd96fac /pkg/p9
parent692df85673e2398a1a9393029b2a9b72448619f4 (diff)
Remove artificial name length check.
This should be determined by the filesystem. PiperOrigin-RevId: 218376553 Change-Id: I55d176e2cdf8acdd6642789af057b98bb8ca25b8
Diffstat (limited to 'pkg/p9')
-rw-r--r--pkg/p9/handlers.go16
1 files changed, 3 insertions, 13 deletions
diff --git a/pkg/p9/handlers.go b/pkg/p9/handlers.go
index 0d7a6138f..d3f38e4bf 100644
--- a/pkg/p9/handlers.go
+++ b/pkg/p9/handlers.go
@@ -27,8 +27,6 @@ import (
"gvisor.googlesource.com/gvisor/pkg/log"
)
-const maximumNameLength = 255
-
// ExtractErrno extracts a syscall.Errno from a error, best effort.
func ExtractErrno(err error) syscall.Errno {
switch err {
@@ -109,13 +107,10 @@ func (t *Tflush) handle(cs *connState) message {
// checkSafeName validates the name and returns nil or returns an error.
func checkSafeName(name string) error {
- if name == "" || strings.Contains(name, "/") || name == "." || name == ".." {
- return syscall.EINVAL
- }
- if len(name) > maximumNameLength {
- return syscall.ENAMETOOLONG
+ if name != "" && !strings.Contains(name, "/") && name != "." && name != ".." {
+ return nil
}
- return nil
+ return syscall.EINVAL
}
// handle implements handler.handle.
@@ -979,11 +974,6 @@ func (t *Tstatfs) handle(cs *connState) message {
return newErr(err)
}
- // Constrain the name length.
- if st.NameLength > maximumNameLength {
- st.NameLength = maximumNameLength
- }
-
return &Rstatfs{st}
}