summaryrefslogtreecommitdiff
path: root/source3/smbd/smb2_getinfo.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2012-06-08 10:46:13 +0200
committerStefan Metzmacher <metze@samba.org>2012-06-09 21:23:44 +0200
commit4bc10b5b72db0b874ce8171386ca9d66d973fe3c (patch)
tree30e87e8276783aa4eb26b44baa2c95ee9066d744 /source3/smbd/smb2_getinfo.c
parent4dfadfc61d2f860847dcbde100127d7b6cd9d06d (diff)
downloadsamba-4bc10b5b72db0b874ce8171386ca9d66d973fe3c.tar.gz
samba-4bc10b5b72db0b874ce8171386ca9d66d973fe3c.tar.bz2
samba-4bc10b5b72db0b874ce8171386ca9d66d973fe3c.zip
s3:smb2_getinfo: make use of file_fsp_smb2()
metze
Diffstat (limited to 'source3/smbd/smb2_getinfo.c')
-rw-r--r--source3/smbd/smb2_getinfo.c41
1 files changed, 12 insertions, 29 deletions
diff --git a/source3/smbd/smb2_getinfo.c b/source3/smbd/smb2_getinfo.c
index e7ccdfd00f..1e0f24cf75 100644
--- a/source3/smbd/smb2_getinfo.c
+++ b/source3/smbd/smb2_getinfo.c
@@ -29,13 +29,13 @@
static struct tevent_req *smbd_smb2_getinfo_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
struct smbd_smb2_request *smb2req,
+ struct files_struct *in_fsp,
uint8_t in_info_type,
uint8_t in_file_info_class,
uint32_t in_output_buffer_length,
DATA_BLOB in_input_buffer,
uint32_t in_additional_information,
- uint32_t in_flags,
- uint64_t in_file_id_volatile);
+ uint32_t in_flags);
static NTSTATUS smbd_smb2_getinfo_recv(struct tevent_req *req,
TALLOC_CTX *mem_ctx,
DATA_BLOB *out_output_buffer,
@@ -57,6 +57,7 @@ NTSTATUS smbd_smb2_request_process_getinfo(struct smbd_smb2_request *req)
uint32_t in_flags;
uint64_t in_file_id_persistent;
uint64_t in_file_id_volatile;
+ struct files_struct *in_fsp;
struct tevent_req *subreq;
status = smbd_smb2_request_verify_sizes(req, 0x29);
@@ -111,22 +112,19 @@ NTSTATUS smbd_smb2_request_process_getinfo(struct smbd_smb2_request *req)
return smbd_smb2_request_error(req, status);
}
- if (req->compat_chain_fsp) {
- /* skip check */
- } else if (in_file_id_persistent != in_file_id_volatile) {
+ in_fsp = file_fsp_smb2(req, in_file_id_persistent, in_file_id_volatile);
+ if (in_fsp == NULL) {
return smbd_smb2_request_error(req, NT_STATUS_FILE_CLOSED);
}
- subreq = smbd_smb2_getinfo_send(req,
- req->sconn->ev_ctx,
- req,
+ subreq = smbd_smb2_getinfo_send(req, req->sconn->ev_ctx,
+ req, in_fsp,
in_info_type,
in_file_info_class,
in_output_buffer_length,
in_input_buffer,
in_additional_information,
- in_flags,
- in_file_id_volatile);
+ in_flags);
if (subreq == NULL) {
return smbd_smb2_request_error(req, NT_STATUS_NO_MEMORY);
}
@@ -244,19 +242,18 @@ static void smb2_ipc_getinfo(struct tevent_req *req,
static struct tevent_req *smbd_smb2_getinfo_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
struct smbd_smb2_request *smb2req,
+ struct files_struct *fsp,
uint8_t in_info_type,
uint8_t in_file_info_class,
uint32_t in_output_buffer_length,
DATA_BLOB in_input_buffer,
uint32_t in_additional_information,
- uint32_t in_flags,
- uint64_t in_file_id_volatile)
+ uint32_t in_flags)
{
struct tevent_req *req;
struct smbd_smb2_getinfo_state *state;
struct smb_request *smbreq;
connection_struct *conn = smb2req->tcon->compat_conn;
- files_struct *fsp;
NTSTATUS status;
req = tevent_req_create(mem_ctx, &state,
@@ -268,28 +265,14 @@ static struct tevent_req *smbd_smb2_getinfo_send(TALLOC_CTX *mem_ctx,
state->status = NT_STATUS_OK;
state->out_output_buffer = data_blob_null;
- DEBUG(10,("smbd_smb2_getinfo_send: file_id[0x%016llX]\n",
- (unsigned long long)in_file_id_volatile));
+ DEBUG(10,("smbd_smb2_getinfo_send: %s - fnum[%d]\n",
+ fsp_str_dbg(fsp), fsp->fnum));
smbreq = smbd_smb2_fake_smb_request(smb2req);
if (tevent_req_nomem(smbreq, req)) {
return tevent_req_post(req, ev);
}
- fsp = file_fsp(smbreq, (uint16_t)in_file_id_volatile);
- if (fsp == NULL) {
- tevent_req_nterror(req, NT_STATUS_FILE_CLOSED);
- return tevent_req_post(req, ev);
- }
- if (conn != fsp->conn) {
- tevent_req_nterror(req, NT_STATUS_FILE_CLOSED);
- return tevent_req_post(req, ev);
- }
- if (smb2req->session->vuid != fsp->vuid) {
- tevent_req_nterror(req, NT_STATUS_FILE_CLOSED);
- return tevent_req_post(req, ev);
- }
-
if (IS_IPC(conn)) {
smb2_ipc_getinfo(req, state, ev,
in_info_type, in_file_info_class);