2 Unix SMB/CIFS implementation.
4 CIFS-to-SMB2 NTVFS filesystem backend
6 Copyright (C) Andrew Tridgell 2008
8 largely based on vfs_cifs.c which was
9 Copyright (C) Andrew Tridgell 2003
10 Copyright (C) James J Myers 2003 <myersjj@samba.org>
12 This program is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 3 of the License, or
15 (at your option) any later version.
17 This program is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
22 You should have received a copy of the GNU General Public License
23 along with this program. If not, see <http://www.gnu.org/licenses/>.
26 this implements a CIFS->CIFS NTVFS filesystem backend.
31 #include "libcli/raw/libcliraw.h"
32 #include "libcli/raw/raw_proto.h"
33 #include "libcli/composite/composite.h"
34 #include "libcli/smb_composite/smb_composite.h"
35 #include "auth/auth.h"
36 #include "auth/credentials/credentials.h"
37 #include "ntvfs/ntvfs.h"
38 #include "lib/util/dlinklist.h"
39 #include "param/param.h"
40 #include "libcli/resolve/resolve.h"
41 #include "libcli/smb2/smb2.h"
42 #include "libcli/smb2/smb2_calls.h"
45 struct cvfs_file *prev, *next;
47 struct ntvfs_handle *h;
50 /* this is stored in ntvfs_private */
52 struct smb2_tree *tree;
53 struct smb2_transport *transport;
54 struct ntvfs_module_context *ntvfs;
55 struct async_info *pending;
56 struct cvfs_file *files;
58 /* a handle on the root of the share */
59 /* TODO: leaving this handle open could prevent other users
60 from opening the share with exclusive access. We probably
61 need to open it on demand */
62 struct smb2_handle roothandle;
66 /* a structure used to pass information to an async handler */
68 struct async_info *next, *prev;
69 struct cvfs_private *cvfs;
70 struct ntvfs_request *req;
72 struct composite_context *c_comp;
77 #define SETUP_FILE_HERE(f) do { \
78 f = ntvfs_handle_get_backend_data(io->generic.in.file.ntvfs, ntvfs); \
79 if (!f) return NT_STATUS_INVALID_HANDLE; \
80 io->generic.in.file.fnum = f->fnum; \
83 #define SETUP_FILE do { \
84 struct cvfs_file *f; \
88 #define SMB2_SERVER "smb2:server"
89 #define SMB2_USER "smb2:user"
90 #define SMB2_PASSWORD "smb2:password"
91 #define SMB2_DOMAIN "smb2:domain"
92 #define SMB2_SHARE "smb2:share"
93 #define SMB2_USE_MACHINE_ACCT "smb2:use-machine-account"
95 #define SMB2_USE_MACHINE_ACCT_DEFAULT false
98 a handler for oplock break events from the server - these need to be passed
101 static bool oplock_handler(struct smbcli_transport *transport, uint16_t tid, uint16_t fnum, uint8_t level, void *p_private)
103 struct cvfs_private *private = p_private;
105 struct ntvfs_handle *h = NULL;
108 for (f=private->files; f; f=f->next) {
109 if (f->fnum != fnum) continue;
115 DEBUG(5,("vfs_smb2: ignoring oplock break level %d for fnum %d\n", level, fnum));
119 DEBUG(5,("vfs_smb2: sending oplock break level %d for fnum %d\n", level, fnum));
120 status = ntvfs_send_oplock_break(private->ntvfs, h, level);
121 if (!NT_STATUS_IS_OK(status)) return false;
126 return a handle to the root of the share
128 static NTSTATUS smb2_get_roothandle(struct smb2_tree *tree, struct smb2_handle *handle)
130 struct smb2_create io;
134 io.in.oplock_level = 0;
135 io.in.desired_access = SEC_STD_SYNCHRONIZE | SEC_DIR_READ_ATTRIBUTE | SEC_DIR_LIST;
136 io.in.file_attributes = 0;
137 io.in.create_disposition = NTCREATEX_DISP_OPEN;
139 NTCREATEX_SHARE_ACCESS_READ |
140 NTCREATEX_SHARE_ACCESS_WRITE|
141 NTCREATEX_SHARE_ACCESS_DELETE;
142 io.in.create_options = 0;
145 status = smb2_create(tree, tree, &io);
146 NT_STATUS_NOT_OK_RETURN(status);
148 *handle = io.out.file.handle;
154 connect to a share - used when a tree_connect operation comes in.
156 static NTSTATUS cvfs_connect(struct ntvfs_module_context *ntvfs,
157 struct ntvfs_request *req, const char *sharename)
160 struct cvfs_private *private;
161 const char *host, *user, *pass, *domain, *remote_share;
162 struct composite_context *creq;
163 struct share_config *scfg = ntvfs->ctx->config;
164 struct smb2_tree *tree;
166 struct cli_credentials *credentials;
167 bool machine_account;
169 /* Here we need to determine which server to connect to.
170 * For now we use parametric options, type cifs.
171 * Later we will use security=server and auth_server.c.
173 host = share_string_option(scfg, SMB2_SERVER, NULL);
174 user = share_string_option(scfg, SMB2_USER, NULL);
175 pass = share_string_option(scfg, SMB2_PASSWORD, NULL);
176 domain = share_string_option(scfg, SMB2_DOMAIN, NULL);
177 remote_share = share_string_option(scfg, SMB2_SHARE, NULL);
179 remote_share = sharename;
182 machine_account = share_bool_option(scfg, SMB2_USE_MACHINE_ACCT, SMB2_USE_MACHINE_ACCT_DEFAULT);
184 private = talloc_zero(ntvfs, struct cvfs_private);
186 return NT_STATUS_NO_MEMORY;
189 ntvfs->private_data = private;
192 DEBUG(1,("CIFS backend: You must supply server\n"));
193 return NT_STATUS_INVALID_PARAMETER;
197 DEBUG(5, ("CIFS backend: Using specified password\n"));
198 credentials = cli_credentials_init(private);
200 return NT_STATUS_NO_MEMORY;
202 cli_credentials_set_conf(credentials, ntvfs->ctx->lp_ctx);
203 cli_credentials_set_username(credentials, user, CRED_SPECIFIED);
205 cli_credentials_set_domain(credentials, domain, CRED_SPECIFIED);
207 cli_credentials_set_password(credentials, pass, CRED_SPECIFIED);
208 } else if (machine_account) {
209 DEBUG(5, ("CIFS backend: Using machine account\n"));
210 credentials = cli_credentials_init(private);
211 cli_credentials_set_conf(credentials, ntvfs->ctx->lp_ctx);
213 cli_credentials_set_domain(credentials, domain, CRED_SPECIFIED);
215 status = cli_credentials_set_machine_account(credentials, ntvfs->ctx->lp_ctx);
216 if (!NT_STATUS_IS_OK(status)) {
219 } else if (req->session_info->credentials) {
220 DEBUG(5, ("CIFS backend: Using delegated credentials\n"));
221 credentials = req->session_info->credentials;
223 DEBUG(1,("CIFS backend: NO delegated credentials found: You must supply server, user and password or the client must supply delegated credentials\n"));
224 return NT_STATUS_INVALID_PARAMETER;
227 creq = smb2_connect_send(private, host, remote_share,
228 lp_resolve_context(ntvfs->ctx->lp_ctx),
230 ntvfs->ctx->event_ctx);
232 status = smb2_connect_recv(creq, private, &tree);
233 NT_STATUS_NOT_OK_RETURN(status);
235 status = smb2_get_roothandle(tree, &private->roothandle);
236 NT_STATUS_NOT_OK_RETURN(status);
238 private->tree = tree;
239 private->transport = private->tree->session->transport;
240 private->ntvfs = ntvfs;
242 ntvfs->ctx->fs_type = talloc_strdup(ntvfs->ctx, "NTFS");
243 NT_STATUS_HAVE_NO_MEMORY(ntvfs->ctx->fs_type);
244 ntvfs->ctx->dev_type = talloc_strdup(ntvfs->ctx, "A:");
245 NT_STATUS_HAVE_NO_MEMORY(ntvfs->ctx->dev_type);
247 /* we need to receive oplock break requests from the server */
248 /* TODO: enable oplocks
249 smbcli_oplock_handler(private->transport, oplock_handler, private);
255 disconnect from a share
257 static NTSTATUS cvfs_disconnect(struct ntvfs_module_context *ntvfs)
259 struct cvfs_private *private = ntvfs->private_data;
260 struct async_info *a, *an;
262 /* first cleanup pending requests */
263 for (a=private->pending; a; a = an) {
265 talloc_free(a->c_req);
269 talloc_free(private);
270 ntvfs->private_data = NULL;
276 destroy an async info structure
278 static int async_info_destructor(struct async_info *async)
280 DLIST_REMOVE(async->cvfs->pending, async);
285 a handler for simple async SMB2 replies
286 this handler can only be used for functions that don't return any
287 parameters (those that just return a status code)
289 static void async_simple_smb2(struct smb2_request *c_req)
291 struct async_info *async = c_req->async.private_data;
292 struct ntvfs_request *req = async->req;
294 smb2_request_receive(c_req);
295 req->async_states->status = smb2_request_destroy(c_req);
297 req->async_states->send_fn(req);
301 a handler for simple async composite replies
302 this handler can only be used for functions that don't return any
303 parameters (those that just return a status code)
305 static void async_simple_composite(struct composite_context *c_req)
307 struct async_info *async = c_req->async.private_data;
308 struct ntvfs_request *req = async->req;
310 req->async_states->status = composite_wait_free(c_req);
312 req->async_states->send_fn(req);
316 /* save some typing for the simple functions */
317 #define ASYNC_RECV_TAIL_F(io, async_fn, file) do { \
318 if (!c_req) return NT_STATUS_UNSUCCESSFUL; \
320 struct async_info *async; \
321 async = talloc(req, struct async_info); \
322 if (!async) return NT_STATUS_NO_MEMORY; \
326 async->cvfs = private; \
327 async->c_req = c_req; \
328 DLIST_ADD(private->pending, async); \
329 c_req->async.private_data = async; \
330 talloc_set_destructor(async, async_info_destructor); \
332 c_req->async.fn = async_fn; \
333 req->async_states->state |= NTVFS_ASYNC_STATE_ASYNC; \
334 return NT_STATUS_OK; \
337 #define ASYNC_RECV_TAIL(io, async_fn) ASYNC_RECV_TAIL_F(io, async_fn, NULL)
339 #define SIMPLE_ASYNC_TAIL ASYNC_RECV_TAIL(NULL, async_simple_smb2)
340 #define SIMPLE_COMPOSITE_TAIL ASYNC_RECV_TAIL(NULL, async_simple_composite)
342 #define CHECK_ASYNC(req) do { \
343 if (!(req->async_states->state & NTVFS_ASYNC_STATE_MAY_ASYNC)) { \
344 DEBUG(0,("SMB2 proxy backend does not support sync operation at %s\n", \
346 return NT_STATUS_NOT_IMPLEMENTED; \
350 delete a file - the dirtype specifies the file types to include in the search.
351 The name can contain CIFS wildcards, but rarely does (except with OS/2 clients)
354 - doesn't handle wildcards
355 - doesn't obey attrib restrictions
357 static NTSTATUS cvfs_unlink(struct ntvfs_module_context *ntvfs,
358 struct ntvfs_request *req, union smb_unlink *unl)
360 struct cvfs_private *private = ntvfs->private_data;
361 struct composite_context *c_req;
365 c_req = smb2_composite_unlink_send(private->tree, unl);
367 SIMPLE_COMPOSITE_TAIL;
373 static NTSTATUS cvfs_ioctl(struct ntvfs_module_context *ntvfs,
374 struct ntvfs_request *req, union smb_ioctl *io)
376 return NT_STATUS_NOT_IMPLEMENTED;
380 check if a directory exists
382 static NTSTATUS cvfs_chkpath(struct ntvfs_module_context *ntvfs,
383 struct ntvfs_request *req, union smb_chkpath *cp)
385 struct cvfs_private *private = ntvfs->private_data;
386 struct smb2_request *c_req;
391 /* SMB2 doesn't have a chkpath operation, and also doesn't
392 have a query path info call, so the best seems to be to do a
393 find call, using the roothandle we established at connect
396 f.in.file.handle = private->roothandle;
397 f.in.level = SMB2_FIND_DIRECTORY_INFO;
398 f.in.pattern = cp->chkpath.in.path;
399 /* SMB2 find doesn't accept \ or the empty string - this is the best
401 if (strcmp(f.in.pattern, "\\") == 0 ||
402 strcmp(f.in.pattern, "") == 0) {
405 f.in.continue_flags = SMB2_CONTINUE_FLAG_SINGLE | SMB2_CONTINUE_FLAG_RESTART;
406 f.in.max_response_size = 0x1000;
408 c_req = smb2_find_send(private->tree, &f);
414 return info on a pathname
416 static NTSTATUS cvfs_qpathinfo(struct ntvfs_module_context *ntvfs,
417 struct ntvfs_request *req, union smb_fileinfo *info)
419 return NT_STATUS_NOT_IMPLEMENTED;
423 query info on a open file
425 static NTSTATUS cvfs_qfileinfo(struct ntvfs_module_context *ntvfs,
426 struct ntvfs_request *req, union smb_fileinfo *io)
428 return NT_STATUS_NOT_IMPLEMENTED;
433 set info on a pathname
435 static NTSTATUS cvfs_setpathinfo(struct ntvfs_module_context *ntvfs,
436 struct ntvfs_request *req, union smb_setfileinfo *st)
438 return NT_STATUS_NOT_IMPLEMENTED;
445 static NTSTATUS cvfs_open(struct ntvfs_module_context *ntvfs,
446 struct ntvfs_request *req, union smb_open *io)
448 return NT_STATUS_NOT_IMPLEMENTED;
454 static NTSTATUS cvfs_mkdir(struct ntvfs_module_context *ntvfs,
455 struct ntvfs_request *req, union smb_mkdir *md)
457 struct cvfs_private *private = ntvfs->private_data;
458 struct composite_context *c_req;
462 c_req = smb2_composite_mkdir_send(private->tree, md);
464 SIMPLE_COMPOSITE_TAIL;
470 static NTSTATUS cvfs_rmdir(struct ntvfs_module_context *ntvfs,
471 struct ntvfs_request *req, struct smb_rmdir *rd)
473 struct cvfs_private *private = ntvfs->private_data;
474 struct composite_context *c_req;
478 c_req = smb2_composite_rmdir_send(private->tree, rd);
480 SIMPLE_COMPOSITE_TAIL;
484 rename a set of files
486 static NTSTATUS cvfs_rename(struct ntvfs_module_context *ntvfs,
487 struct ntvfs_request *req, union smb_rename *ren)
489 return NT_STATUS_NOT_IMPLEMENTED;
495 static NTSTATUS cvfs_copy(struct ntvfs_module_context *ntvfs,
496 struct ntvfs_request *req, struct smb_copy *cp)
498 return NT_STATUS_NOT_SUPPORTED;
504 static NTSTATUS cvfs_read(struct ntvfs_module_context *ntvfs,
505 struct ntvfs_request *req, union smb_read *io)
507 return NT_STATUS_NOT_IMPLEMENTED;
513 static NTSTATUS cvfs_write(struct ntvfs_module_context *ntvfs,
514 struct ntvfs_request *req, union smb_write *io)
516 return NT_STATUS_NOT_IMPLEMENTED;
522 static NTSTATUS cvfs_seek(struct ntvfs_module_context *ntvfs,
523 struct ntvfs_request *req,
526 return NT_STATUS_NOT_IMPLEMENTED;
532 static NTSTATUS cvfs_flush(struct ntvfs_module_context *ntvfs,
533 struct ntvfs_request *req,
536 return NT_STATUS_NOT_IMPLEMENTED;
542 static NTSTATUS cvfs_close(struct ntvfs_module_context *ntvfs,
543 struct ntvfs_request *req, union smb_close *io)
545 return NT_STATUS_NOT_IMPLEMENTED;
549 exit - closing files open by the pid
551 static NTSTATUS cvfs_exit(struct ntvfs_module_context *ntvfs,
552 struct ntvfs_request *req)
554 return NT_STATUS_NOT_IMPLEMENTED;
558 logoff - closing files open by the user
560 static NTSTATUS cvfs_logoff(struct ntvfs_module_context *ntvfs,
561 struct ntvfs_request *req)
563 /* we can't do this right in the cifs backend .... */
568 setup for an async call - nothing to do yet
570 static NTSTATUS cvfs_async_setup(struct ntvfs_module_context *ntvfs,
571 struct ntvfs_request *req,
580 static NTSTATUS cvfs_cancel(struct ntvfs_module_context *ntvfs,
581 struct ntvfs_request *req)
583 return NT_STATUS_NOT_IMPLEMENTED;
589 static NTSTATUS cvfs_lock(struct ntvfs_module_context *ntvfs,
590 struct ntvfs_request *req, union smb_lock *io)
592 return NT_STATUS_NOT_IMPLEMENTED;
596 set info on a open file
598 static NTSTATUS cvfs_setfileinfo(struct ntvfs_module_context *ntvfs,
599 struct ntvfs_request *req,
600 union smb_setfileinfo *io)
602 return NT_STATUS_NOT_IMPLEMENTED;
607 a handler for async fsinfo replies
609 static void async_fsinfo(struct smb2_request *c_req)
611 struct async_info *async = c_req->async.private_data;
612 struct ntvfs_request *req = async->req;
613 req->async_states->status = smb2_getinfo_fs_recv(c_req, req, async->parms);
615 req->async_states->send_fn(req);
619 return filesystem space info
621 static NTSTATUS cvfs_fsinfo(struct ntvfs_module_context *ntvfs,
622 struct ntvfs_request *req, union smb_fsinfo *fs)
624 struct cvfs_private *private = ntvfs->private_data;
625 struct smb2_request *c_req;
626 enum smb_fsinfo_level level = fs->generic.level;
631 /* some levels go straight through */
632 case RAW_QFS_VOLUME_INFORMATION:
633 case RAW_QFS_SIZE_INFORMATION:
634 case RAW_QFS_DEVICE_INFORMATION:
635 case RAW_QFS_ATTRIBUTE_INFORMATION:
636 case RAW_QFS_QUOTA_INFORMATION:
637 case RAW_QFS_FULL_SIZE_INFORMATION:
638 case RAW_QFS_OBJECTID_INFORMATION:
641 /* some get mapped */
642 case RAW_QFS_VOLUME_INFO:
643 level = RAW_QFS_VOLUME_INFORMATION;
645 case RAW_QFS_SIZE_INFO:
646 level = RAW_QFS_SIZE_INFORMATION;
648 case RAW_QFS_DEVICE_INFO:
649 level = RAW_QFS_DEVICE_INFORMATION;
651 case RAW_QFS_ATTRIBUTE_INFO:
652 level = RAW_QFS_ATTRIBUTE_INFO;
656 /* the rest get refused for now */
657 DEBUG(0,("fsinfo level %u not possible on SMB2\n",
658 (unsigned)fs->generic.level));
662 fs->generic.level = level;
663 fs->generic.handle = private->roothandle;
665 c_req = smb2_getinfo_fs_send(private->tree, fs);
667 ASYNC_RECV_TAIL(fs, async_fsinfo);
671 return print queue info
673 static NTSTATUS cvfs_lpq(struct ntvfs_module_context *ntvfs,
674 struct ntvfs_request *req, union smb_lpq *lpq)
676 return NT_STATUS_NOT_SUPPORTED;
680 list files in a directory matching a wildcard pattern
682 static NTSTATUS cvfs_search_first(struct ntvfs_module_context *ntvfs,
683 struct ntvfs_request *req, union smb_search_first *io,
684 void *search_private,
685 bool (*callback)(void *, const union smb_search_data *))
687 struct cvfs_private *private = ntvfs->private_data;
689 enum smb_search_data_level smb2_level;
691 union smb_search_data *data;
694 if (io->generic.level != RAW_SEARCH_TRANS2) {
695 DEBUG(0,("We only support trans2 search in smb2 backend\n"));
696 return NT_STATUS_NOT_SUPPORTED;
699 switch (io->generic.data_level) {
700 case RAW_SEARCH_DATA_DIRECTORY_INFO:
701 smb2_level = SMB2_FIND_DIRECTORY_INFO;
703 case RAW_SEARCH_DATA_FULL_DIRECTORY_INFO:
704 smb2_level = SMB2_FIND_FULL_DIRECTORY_INFO;
706 case RAW_SEARCH_DATA_BOTH_DIRECTORY_INFO:
707 smb2_level = SMB2_FIND_BOTH_DIRECTORY_INFO;
709 case RAW_SEARCH_DATA_NAME_INFO:
710 smb2_level = SMB2_FIND_NAME_INFO;
712 case RAW_SEARCH_DATA_ID_FULL_DIRECTORY_INFO:
713 smb2_level = SMB2_FIND_ID_FULL_DIRECTORY_INFO;
715 case RAW_SEARCH_DATA_ID_BOTH_DIRECTORY_INFO:
716 smb2_level = SMB2_FIND_ID_BOTH_DIRECTORY_INFO;
719 DEBUG(0,("Unsupported search level %u for smb2 backend\n",
720 (unsigned)io->generic.data_level));
721 return NT_STATUS_INVALID_INFO_CLASS;
724 /* we do the search on the roothandle. This only works because
725 search is synchronous, otherwise we'd have no way to
726 distinguish multiple searches happening at once
729 f.in.file.handle = private->roothandle;
730 f.in.level = smb2_level;
731 f.in.pattern = io->t2ffirst.in.pattern;
732 while (f.in.pattern[0] == '\\') {
735 f.in.continue_flags = 0;
736 f.in.max_response_size = 0x10000;
738 status = smb2_find_level(private->tree, req, &f, &count, &data);
739 NT_STATUS_NOT_OK_RETURN(status);
741 for (i=0;i<count;i++) {
742 if (!callback(search_private, &data[i])) break;
745 io->t2ffirst.out.handle = 0;
746 io->t2ffirst.out.count = i;
747 /* TODO: fix end_of_file */
748 io->t2ffirst.out.end_of_search = 1;
755 /* continue a search */
756 static NTSTATUS cvfs_search_next(struct ntvfs_module_context *ntvfs,
757 struct ntvfs_request *req, union smb_search_next *io,
758 void *search_private,
759 bool (*callback)(void *, const union smb_search_data *))
761 return NT_STATUS_NOT_IMPLEMENTED;
765 static NTSTATUS cvfs_search_close(struct ntvfs_module_context *ntvfs,
766 struct ntvfs_request *req, union smb_search_close *io)
768 return NT_STATUS_NOT_IMPLEMENTED;
771 /* SMBtrans - not used on file shares */
772 static NTSTATUS cvfs_trans(struct ntvfs_module_context *ntvfs,
773 struct ntvfs_request *req,
774 struct smb_trans2 *trans2)
776 return NT_STATUS_ACCESS_DENIED;
779 /* change notify request - always async */
780 static NTSTATUS cvfs_notify(struct ntvfs_module_context *ntvfs,
781 struct ntvfs_request *req,
782 union smb_notify *io)
784 return NT_STATUS_NOT_IMPLEMENTED;
788 initialise the CIFS->CIFS backend, registering ourselves with the ntvfs subsystem
790 NTSTATUS ntvfs_smb2_init(void)
793 struct ntvfs_ops ops;
794 NTVFS_CURRENT_CRITICAL_SIZES(vers);
798 /* fill in the name and type */
800 ops.type = NTVFS_DISK;
802 /* fill in all the operations */
803 ops.connect = cvfs_connect;
804 ops.disconnect = cvfs_disconnect;
805 ops.unlink = cvfs_unlink;
806 ops.chkpath = cvfs_chkpath;
807 ops.qpathinfo = cvfs_qpathinfo;
808 ops.setpathinfo = cvfs_setpathinfo;
809 ops.open = cvfs_open;
810 ops.mkdir = cvfs_mkdir;
811 ops.rmdir = cvfs_rmdir;
812 ops.rename = cvfs_rename;
813 ops.copy = cvfs_copy;
814 ops.ioctl = cvfs_ioctl;
815 ops.read = cvfs_read;
816 ops.write = cvfs_write;
817 ops.seek = cvfs_seek;
818 ops.flush = cvfs_flush;
819 ops.close = cvfs_close;
820 ops.exit = cvfs_exit;
821 ops.lock = cvfs_lock;
822 ops.setfileinfo = cvfs_setfileinfo;
823 ops.qfileinfo = cvfs_qfileinfo;
824 ops.fsinfo = cvfs_fsinfo;
826 ops.search_first = cvfs_search_first;
827 ops.search_next = cvfs_search_next;
828 ops.search_close = cvfs_search_close;
829 ops.trans = cvfs_trans;
830 ops.logoff = cvfs_logoff;
831 ops.async_setup = cvfs_async_setup;
832 ops.cancel = cvfs_cancel;
833 ops.notify = cvfs_notify;
835 /* register ourselves with the NTVFS subsystem. We register
836 under the name 'smb2'. */
837 ret = ntvfs_register(&ops, &vers);
839 if (!NT_STATUS_IS_OK(ret)) {
840 DEBUG(0,("Failed to register SMB2 backend\n"));