Skip to content
Snippets Groups Projects
  • Arash Payan's avatar
    Updated Dialer.Dial* methods to fix Mount() related bugs and improve usability · f3ec8ae2
    Arash Payan authored
    
    The TREECONNECT command requires a share path (\servername\sharename) as an
    argument, but when calling Mount() users typically just pass in the share name.
    When that happens, go-smb2 creates a share path using the IP address of the
    tcpConn that was passed to it and the share name, but this sometimes creates
    problems for servers that expect the original fully qualified domain name of
    the server in the server name component of the share path.
    
    To address this, this commit replaces the existing Dialer.Dial* methods with
    versions that are harder to use incorrectly. The new methods also require an
    address argument so when a full share path is not passed to Mount(), the
    address value from Dial* will be used as the servername in the share path.
    
    Fixes issue #18
    Unverified
    f3ec8ae2