s4:libcli/raw: setup a smbXcli_session for each smbcli_session
authorStefan Metzmacher <metze@samba.org>
Mon, 23 Jul 2012 17:47:05 +0000 (19:47 +0200)
committerStefan Metzmacher <metze@samba.org>
Mon, 23 Jul 2012 20:13:29 +0000 (22:13 +0200)
metze

source4/libcli/raw/clisession.c
source4/libcli/raw/libcliraw.h
source4/libcli/raw/rawrequest.c

index d68f309519055cb98d54c1c8f520024e5575e1a2..23d7fd128707d0b27fa0edb5dc0e4411fb4343ae 100644 (file)
@@ -55,7 +55,19 @@ struct smbcli_session *smbcli_session_init(struct smbcli_transport *transport,
        session->pid = (uint16_t)getpid();
        session->vuid = UID_FIELD_INVALID;
        session->options = options;
-       
+
+       /*
+        * for now session->vuid is still used by the callers, but we call:
+        * smb1cli_session_set_id(session->smbXcli, session->vuid);
+        * before using session->smbXcli, in future we should remove
+        * session->vuid.
+        */
+       session->smbXcli = smbXcli_session_create(session, transport->conn);
+       if (session->smbXcli == NULL) {
+               talloc_free(session);
+               return NULL;
+       }
+
        capabilities = transport->negotiate.capabilities;
 
        flags2 = FLAGS2_LONG_PATH_COMPONENTS | FLAGS2_EXTENDED_ATTRIBUTES;
index b7e5e21a928283bac3dc9bd85539b18be9120a6c..8cdccc1f4516a851ff9d6eb226c1ff58a1833864 100644 (file)
@@ -156,6 +156,7 @@ struct smbcli_session {
        
        /* after a session setup the server provides us with
           a vuid identifying the security context */
+       struct smbXcli_session *smbXcli;
        uint16_t vuid;
 
        /* default pid for this session */
index 1b4c8c7524aa926a21217e0002b6d611cd39a2ae..56bbf259e1805dc7f89be7ab54501cc0e487dba9 100644 (file)
@@ -146,6 +146,8 @@ struct smbcli_request *smbcli_request_setup_session(struct smbcli_session *sessi
 
        if (!req) return NULL;
 
+       smb1cli_session_set_id(session->smbXcli, session->vuid);
+
        req->session = session;
 
        SSVAL(req->out.hdr, HDR_FLG2, session->flags2);