Where in smbmount does the Extended Security Negotiation get set?

David Wuertele dave-gnus at bfnet.com
Fri Nov 19 18:04:27 GMT 2004


I have written my own version of smbmount, but I can't seem to turn
off Extended Security Negotiation.  In an attempt to debug my problem
I've tried cutting and pasting from smbmount, but I still can't seem
to get it to stop trying to do Extended Security Negotiation.  Here's
my code, in the function analogous to smbmount's do_connection():

  /* This should be right for current smbfs. Future versions will support
    large files as well as unicode and oplocks. */
  c->capabilities &= ~(CAP_EXTENDED_SECURITY | CAP_NT_SMBS | CAP_NT_FIND | CAP_LEVEL_II_OPLOCKS | CAP_UNICODE | CAP_STATUS32);
  c->capabilities |= CAP_LARGE_FILES;

  if (!cli_session_setup(c, username, password, strlen(password),
                         password, strlen(password), workgroup)) {
          /* if a password was not supplied then try again with a null username */
          if (password[0] || !username[0] ||
                          !cli_session_setup(c, "", "", 0, "", 0, workgroup)) {
                  DBGPRINT (0, "%d: session setup failed: %s\n",
                          sys_getpid(), cli_errstr(c));
                  cli_shutdown(c);
                  return NULL;
          }
          DBGPRINT (0, "%s", "Anonymous login successful\n");
  }

Why doesn't this disable Extended Security Negotiation?  When I use
ethereal to look at my Negotiate Protocol packet, here's what I see:

SMB (Server Message Block Protocol)
    SMB Header
        Server Component: SMB
        SMB Command: Negotiate Protocol (0x72)
        NT Status: STATUS_SUCCESS (0x00000000)
        Flags: 0x08
            0... .... = Request/Response: Message is a request to the server
            .0.. .... = Notify: Notify client only on open
            ..0. .... = Oplocks: OpLock not requested/granted
            ...0 .... = Canonicalized Pathnames: Pathnames are not canonicalized
            .... 1... = Case Sensitivity: Path names are caseless
            .... ..0. = Receive Buffer Posted: Receive buffer has not been posted
            .... ...0 = Lock and Read: Lock&Read, Write&Unlock are not supported
        Flags2: 0xc801
            1... .... .... .... = Unicode Strings: Strings are Unicode
            .1.. .... .... .... = Error Code Type: Error codes are NT error codes
            ..0. .... .... .... = Execute-only Reads: Don't permit reads if execute-only
            ...0 .... .... .... = Dfs: Don't resolve pathnames with Dfs
            .... 1... .... .... = Extended Security Negotiation: Extended security negotiation is supported
            .... .... .0.. .... = Long Names Used: Path names in request are not long file names
            .... .... .... .0.. = Security Signatures: Security signatures are not supported
            .... .... .... ..0. = Extended Attributes: Extended attributes are not supported
            .... .... .... ...1 = Long Names Allowed: Long file names are allowed in the response
        Reserved: 000000000000000000000000
        Tree ID: 0
        Process ID: 29524
        User ID: 0
        Multiplex ID: 1

What is up with that?  Is there somewhere else in smbmount or smbmnt
where it turns off Extended Security Negotiation for suresies?

Dave



More information about the samba-technical mailing list