code: func checkFilename(name string) error {
  	cleanedName := path.Clean(name)
  	if cleanedName != name {
  		// The filename on the wire should be in canonical format. If
  		// Clean() managed to clean it up, there was something wrong with
  		// it.
  		return errUncleanFilename
  	}
  
  	switch name {
  	case "", ".", "..":
  		// These names are always invalid.
  		return errInvalidFilename
  	}
  	if strings.HasPrefix(name, "/") {
  		// Names are folder relative, not absolute.
  		return errInvalidFilename
  	}
  	if strings.HasPrefix(name, "../") {
  		// Starting with a dotdot is not allowed. Any other dotdots would
  		// have been handled by the Clean() call at the top.
  		return errInvalidFilename
  	}
  	return nil
  }
docs: // checkFilename verifies that the given filename is valid according to the
  // spec on what's allowed over the wire. A filename failing this test is
  // grounds for disconnecting the device.