diff options
author | Jeremy Allison <jra@samba.org> | 2011-07-08 10:44:29 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2011-07-08 21:01:40 +0200 |
commit | fe3992541d6f86efb32a63d01bc1814650618cae (patch) | |
tree | 11e2bcf19281b6a5a3918570d720c8f0a66b1043 /source3/smbd/smb2_tcon.c | |
parent | f4add4fbf545313f5d24e0d9e5c9eb0f8fac630a (diff) | |
download | samba-fe3992541d6f86efb32a63d01bc1814650618cae.tar.gz |
Move smbd_smb2_request_check_tcon() smbd_smb2_request_check_session() next to their only user and make them static. Add comments.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Jul 8 21:01:40 CEST 2011 on sn-devel-104
Diffstat (limited to 'source3/smbd/smb2_tcon.c')
-rw-r--r-- | source3/smbd/smb2_tcon.c | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/source3/smbd/smb2_tcon.c b/source3/smbd/smb2_tcon.c index 7c2014c90c1..946bc5639b2 100644 --- a/source3/smbd/smb2_tcon.c +++ b/source3/smbd/smb2_tcon.c @@ -278,66 +278,6 @@ static NTSTATUS smbd_smb2_tree_connect(struct smbd_smb2_request *req, return NT_STATUS_OK; } -NTSTATUS smbd_smb2_request_check_tcon(struct smbd_smb2_request *req) -{ - const uint8_t *inhdr; - const uint8_t *outhdr; - int i = req->current_idx; - uint32_t in_tid; - void *p; - struct smbd_smb2_tcon *tcon; - bool chained_fixup = false; - - inhdr = (const uint8_t *)req->in.vector[i+0].iov_base; - - in_tid = IVAL(inhdr, SMB2_HDR_TID); - - if (in_tid == (0xFFFFFFFF)) { - if (req->async) { - /* - * async request - fill in tid from - * already setup out.vector[].iov_base. - */ - outhdr = (const uint8_t *)req->out.vector[i].iov_base; - in_tid = IVAL(outhdr, SMB2_HDR_TID); - } else if (i > 2) { - /* - * Chained request - fill in tid from - * the previous request out.vector[].iov_base. - */ - outhdr = (const uint8_t *)req->out.vector[i-3].iov_base; - in_tid = IVAL(outhdr, SMB2_HDR_TID); - chained_fixup = true; - } - } - - /* lookup an existing session */ - p = idr_find(req->session->tcons.idtree, in_tid); - if (p == NULL) { - return NT_STATUS_NETWORK_NAME_DELETED; - } - tcon = talloc_get_type_abort(p, struct smbd_smb2_tcon); - - if (!change_to_user(tcon->compat_conn,req->session->vuid)) { - return NT_STATUS_ACCESS_DENIED; - } - - /* should we pass FLAG_CASELESS_PATHNAMES here? */ - if (!set_current_service(tcon->compat_conn, 0, true)) { - return NT_STATUS_ACCESS_DENIED; - } - - req->tcon = tcon; - - if (chained_fixup) { - /* Fix up our own outhdr. */ - outhdr = (const uint8_t *)req->out.vector[i].iov_base; - SIVAL(discard_const_p(uint8_t, outhdr), SMB2_HDR_TID, in_tid); - } - - return NT_STATUS_OK; -} - NTSTATUS smbd_smb2_request_process_tdis(struct smbd_smb2_request *req) { const uint8_t *inbody; |