Skip to content

Commit

Permalink
s4:libcli/raw: setup a smbXcli_session for each smbcli_session
Browse files Browse the repository at this point in the history
metze
  • Loading branch information
metze-samba committed Jul 23, 2012
1 parent cdec0c4 commit af90c71
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
14 changes: 13 additions & 1 deletion source4/libcli/raw/clisession.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions source4/libcli/raw/libcliraw.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 2 additions & 0 deletions source4/libcli/raw/rawrequest.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit af90c71

Please sign in to comment.