summaryrefslogtreecommitdiff
path: root/source3/smbd/smb2_notify.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2012-06-08 11:05:58 +0200
committerStefan Metzmacher <metze@samba.org>2012-06-09 21:23:44 +0200
commit0bf3b8a09ca7a35cd42ea19d7d0bf8f2645c5b80 (patch)
tree1ba59d27deda8c92df7c3b18facd6ea27446f939 /source3/smbd/smb2_notify.c
parent26f37cba82e15872ce2b80044afd11b344b0f9c9 (diff)
downloadsamba-0bf3b8a09ca7a35cd42ea19d7d0bf8f2645c5b80.tar.gz
samba-0bf3b8a09ca7a35cd42ea19d7d0bf8f2645c5b80.tar.bz2
samba-0bf3b8a09ca7a35cd42ea19d7d0bf8f2645c5b80.zip
s3:smb2_notify: make use of file_fsp_smb2()
metze
Diffstat (limited to 'source3/smbd/smb2_notify.c')
-rw-r--r--source3/smbd/smb2_notify.c35
1 files changed, 9 insertions, 26 deletions
diff --git a/source3/smbd/smb2_notify.c b/source3/smbd/smb2_notify.c
index c0315b2948..6a5df016a4 100644
--- a/source3/smbd/smb2_notify.c
+++ b/source3/smbd/smb2_notify.c
@@ -36,9 +36,9 @@ struct smbd_smb2_notify_state {
static struct tevent_req *smbd_smb2_notify_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
struct smbd_smb2_request *smb2req,
+ struct files_struct *in_fsp,
uint16_t in_flags,
uint32_t in_output_buffer_length,
- uint64_t in_file_id_volatile,
uint64_t in_completion_filter);
static NTSTATUS smbd_smb2_notify_recv(struct tevent_req *req,
TALLOC_CTX *mem_ctx,
@@ -54,6 +54,7 @@ NTSTATUS smbd_smb2_request_process_notify(struct smbd_smb2_request *req)
uint32_t in_output_buffer_length;
uint64_t in_file_id_persistent;
uint64_t in_file_id_volatile;
+ struct files_struct *in_fsp;
uint64_t in_completion_filter;
struct tevent_req *subreq;
@@ -84,18 +85,15 @@ NTSTATUS smbd_smb2_request_process_notify(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_notify_send(req,
- req->sconn->ev_ctx,
- req,
+ subreq = smbd_smb2_notify_send(req, req->sconn->ev_ctx,
+ req, in_fsp,
in_flags,
in_output_buffer_length,
- in_file_id_volatile,
in_completion_filter);
if (subreq == NULL) {
return smbd_smb2_request_error(req, NT_STATUS_NO_MEMORY);
@@ -189,16 +187,15 @@ static bool smbd_smb2_notify_cancel(struct tevent_req *req);
static struct tevent_req *smbd_smb2_notify_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
struct smbd_smb2_request *smb2req,
+ struct files_struct *fsp,
uint16_t in_flags,
uint32_t in_output_buffer_length,
- uint64_t in_file_id_volatile,
uint64_t in_completion_filter)
{
struct tevent_req *req;
struct smbd_smb2_notify_state *state;
struct smb_request *smbreq;
connection_struct *conn = smb2req->tcon->compat_conn;
- files_struct *fsp;
bool recursive = (in_flags & SMB2_WATCH_TREE) ? true : false;
NTSTATUS status;
@@ -212,8 +209,8 @@ static struct tevent_req *smbd_smb2_notify_send(TALLOC_CTX *mem_ctx,
state->out_output_buffer = data_blob_null;
state->im = NULL;
- DEBUG(10,("smbd_smb2_notify_send: file_id[0x%016llX]\n",
- (unsigned long long)in_file_id_volatile));
+ DEBUG(10,("smbd_smb2_notify_send: %s - fnum[%d]\n",
+ fsp_str_dbg(fsp), fsp->fnum));
smbreq = smbd_smb2_fake_smb_request(smb2req);
if (tevent_req_nomem(smbreq, req)) {
@@ -223,20 +220,6 @@ static struct tevent_req *smbd_smb2_notify_send(TALLOC_CTX *mem_ctx,
state->smbreq = smbreq;
smbreq->async_priv = (void *)req;
- 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);
- }
-
{
char *filter_string;