summaryrefslogtreecommitdiff
path: root/source4/ntvfs
diff options
context:
space:
mode:
Diffstat (limited to 'source4/ntvfs')
-rw-r--r--source4/ntvfs/cifs/vfs_cifs.c31
-rw-r--r--source4/ntvfs/ntvfs.h4
-rw-r--r--source4/ntvfs/ntvfs_interface.c13
3 files changed, 48 insertions, 0 deletions
diff --git a/source4/ntvfs/cifs/vfs_cifs.c b/source4/ntvfs/cifs/vfs_cifs.c
index 138c9d566f..44d4d069e8 100644
--- a/source4/ntvfs/cifs/vfs_cifs.c
+++ b/source4/ntvfs/cifs/vfs_cifs.c
@@ -838,6 +838,36 @@ static NTSTATUS cvfs_trans(struct ntvfs_module_context *ntvfs,
}
/*
+ a handler for async change notify replies
+ */
+static void async_changenotify(struct smbcli_request *c_req)
+{
+ struct async_info *async = c_req->async.private;
+ struct smbsrv_request *req = async->req;
+ req->async_states->status = smb_raw_changenotify_recv(c_req, req, async->parms);
+ req->async_states->send_fn(req);
+}
+
+/* change notify request - always async */
+static NTSTATUS cvfs_notify(struct ntvfs_module_context *ntvfs,
+ struct smbsrv_request *req, struct smb_notify *info)
+{
+ struct cvfs_private *private = ntvfs->private_data;
+ struct smbcli_request *c_req;
+
+ SETUP_PID;
+
+ /* this request doesn't make sense unless its async */
+ if (!(req->async_states->state & NTVFS_ASYNC_STATE_MAY_ASYNC)) {
+ return NT_STATUS_INVALID_PARAMETER;
+ }
+
+ c_req = smb_raw_changenotify_send(private->tree, info);
+
+ ASYNC_RECV_TAIL(info, async_changenotify);
+}
+
+/*
initialise the CIFS->CIFS backend, registering ourselves with the ntvfs subsystem
*/
NTSTATUS ntvfs_cifs_init(void)
@@ -882,6 +912,7 @@ NTSTATUS ntvfs_cifs_init(void)
ops.logoff = cvfs_logoff;
ops.async_setup = cvfs_async_setup;
ops.cancel = cvfs_cancel;
+ ops.notify = cvfs_notify;
if (lp_parm_bool(-1, "cifs", "maptrans2", False)) {
ops.trans2 = cvfs_trans2;
diff --git a/source4/ntvfs/ntvfs.h b/source4/ntvfs/ntvfs.h
index 4ec8926ebc..80f6e94125 100644
--- a/source4/ntvfs/ntvfs.h
+++ b/source4/ntvfs/ntvfs.h
@@ -121,6 +121,10 @@ struct ntvfs_ops {
/* cancel - cancels any pending async request */
NTSTATUS (*cancel)(struct ntvfs_module_context *ntvfs,
struct smbsrv_request *req);
+
+ /* change notify request */
+ NTSTATUS (*notify)(struct ntvfs_module_context *ntvfs,
+ struct smbsrv_request *req, struct smb_notify *info);
};
struct ntvfs_module_context {
diff --git a/source4/ntvfs/ntvfs_interface.c b/source4/ntvfs/ntvfs_interface.c
index 5a2415f5f9..be536d5eef 100644
--- a/source4/ntvfs/ntvfs_interface.c
+++ b/source4/ntvfs/ntvfs_interface.c
@@ -324,6 +324,19 @@ _PUBLIC_ NTSTATUS ntvfs_cancel(struct smbsrv_request *req)
}
+/*
+ change notify request
+*/
+_PUBLIC_ NTSTATUS ntvfs_notify(struct smbsrv_request *req, struct smb_notify *info)
+{
+ struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
+ if (!ntvfs->ops->notify) {
+ return NT_STATUS_NOT_IMPLEMENTED;
+ }
+ return ntvfs->ops->notify(ntvfs, req, info);
+}
+
+
/* initial setup */
_PUBLIC_ NTSTATUS ntvfs_next_connect(struct ntvfs_module_context *ntvfs,
struct smbsrv_request *req, const char *sharename)