diff options
-rw-r--r-- | pkg/p9/handlers.go | 16 |
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} } |