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;
165 struct cli_credentials *credentials;
166 bool machine_account;
167 struct smbcli_options options;
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 lp_smbcli_options(ntvfs->ctx->lp_ctx, &options);
229 creq = smb2_connect_send(private, host, remote_share,
230 lp_resolve_context(ntvfs->ctx->lp_ctx),
232 ntvfs->ctx->event_ctx, &options);
234 status = smb2_connect_recv(creq, private, &tree);
235 NT_STATUS_NOT_OK_RETURN(status);
237 status = smb2_get_roothandle(tree, &private->roothandle);
238 NT_STATUS_NOT_OK_RETURN(status);
240 private->tree = tree;
241 private->transport = private->tree->session->transport;
242 private->ntvfs = ntvfs;
244 ntvfs->ctx->fs_type = talloc_strdup(ntvfs->ctx, "NTFS");
245 NT_STATUS_HAVE_NO_MEMORY(ntvfs->ctx->fs_type);
246 ntvfs->ctx->dev_type = talloc_strdup(ntvfs->ctx, "A:");
247 NT_STATUS_HAVE_NO_MEMORY(ntvfs->ctx->dev_type);
249 /* we need to receive oplock break requests from the server */
250 /* TODO: enable oplocks
251 smbcli_oplock_handler(private->transport, oplock_handler, private);
257 disconnect from a share
259 static NTSTATUS cvfs_disconnect(struct ntvfs_module_context *ntvfs)
261 struct cvfs_private *private = ntvfs->private_data;
262 struct async_info *a, *an;
264 /* first cleanup pending requests */
265 for (a=private->pending; a; a = an) {
267 talloc_free(a->c_req);
271 talloc_free(private);
272 ntvfs->private_data = NULL;
278 destroy an async info structure
280 static int async_info_destructor(struct async_info *async)
282 DLIST_REMOVE(async->cvfs->pending, async);
287 a handler for simple async SMB2 replies
288 this handler can only be used for functions that don't return any
289 parameters (those that just return a status code)
291 static void async_simple_smb2(struct smb2_request *c_req)
293 struct async_info *async = c_req->async.private_data;
294 struct ntvfs_request *req = async->req;
296 smb2_request_receive(c_req);
297 req->async_states->status = smb2_request_destroy(c_req);
299 req->async_states->send_fn(req);
303 a handler for simple async composite replies
304 this handler can only be used for functions that don't return any
305 parameters (those that just return a status code)
307 static void async_simple_composite(struct composite_context *c_req)
309 struct async_info *async = c_req->async.private_data;
310 struct ntvfs_request *req = async->req;
312 req->async_states->status = composite_wait_free(c_req);
314 req->async_states->send_fn(req);
318 /* save some typing for the simple functions */
319 #define ASYNC_RECV_TAIL_F(io, async_fn, file) do { \
320 if (!c_req) return NT_STATUS_UNSUCCESSFUL; \
322 struct async_info *async; \
323 async = talloc(req, struct async_info); \
324 if (!async) return NT_STATUS_NO_MEMORY; \
328 async->cvfs = private; \
329 async->c_req = c_req; \
330 DLIST_ADD(private->pending, async); \
331 c_req->async.private_data = async; \
332 talloc_set_destructor(async, async_info_destructor); \
334 c_req->async.fn = async_fn; \
335 req->async_states->state |= NTVFS_ASYNC_STATE_ASYNC; \
336 return NT_STATUS_OK; \
339 #define ASYNC_RECV_TAIL(io, async_fn) ASYNC_RECV_TAIL_F(io, async_fn, NULL)
341 #define SIMPLE_ASYNC_TAIL ASYNC_RECV_TAIL(NULL, async_simple_smb2)
342 #define SIMPLE_COMPOSITE_TAIL ASYNC_RECV_TAIL(NULL, async_simple_composite)
344 #define CHECK_ASYNC(req) do { \
345 if (!(req->async_states->state & NTVFS_ASYNC_STATE_MAY_ASYNC)) { \
346 DEBUG(0,("SMB2 proxy backend does not support sync operation at %s\n", \
348 return NT_STATUS_NOT_IMPLEMENTED; \
352 delete a file - the dirtype specifies the file types to include in the search.
353 The name can contain CIFS wildcards, but rarely does (except with OS/2 clients)
356 - doesn't handle wildcards
357 - doesn't obey attrib restrictions
359 static NTSTATUS cvfs_unlink(struct ntvfs_module_context *ntvfs,
360 struct ntvfs_request *req, union smb_unlink *unl)
362 struct cvfs_private *private = ntvfs->private_data;
363 struct composite_context *c_req;
367 c_req = smb2_composite_unlink_send(private->tree, unl);
369 SIMPLE_COMPOSITE_TAIL;
375 static NTSTATUS cvfs_ioctl(struct ntvfs_module_context *ntvfs,
376 struct ntvfs_request *req, union smb_ioctl *io)
378 return NT_STATUS_NOT_IMPLEMENTED;
382 check if a directory exists
384 static NTSTATUS cvfs_chkpath(struct ntvfs_module_context *ntvfs,
385 struct ntvfs_request *req, union smb_chkpath *cp)
387 struct cvfs_private *private = ntvfs->private_data;
388 struct smb2_request *c_req;
393 /* SMB2 doesn't have a chkpath operation, and also doesn't
394 have a query path info call, so the best seems to be to do a
395 find call, using the roothandle we established at connect
398 f.in.file.handle = private->roothandle;
399 f.in.level = SMB2_FIND_DIRECTORY_INFO;
400 f.in.pattern = cp->chkpath.in.path;
401 /* SMB2 find doesn't accept \ or the empty string - this is the best
403 if (strcmp(f.in.pattern, "\\") == 0 ||
404 strcmp(f.in.pattern, "") == 0) {
407 f.in.continue_flags = SMB2_CONTINUE_FLAG_SINGLE | SMB2_CONTINUE_FLAG_RESTART;
408 f.in.max_response_size = 0x1000;
410 c_req = smb2_find_send(private->tree, &f);
416 return info on a pathname
418 static NTSTATUS cvfs_qpathinfo(struct ntvfs_module_context *ntvfs,
419 struct ntvfs_request *req, union smb_fileinfo *info)
421 return NT_STATUS_NOT_IMPLEMENTED;
425 query info on a open file
427 static NTSTATUS cvfs_qfileinfo(struct ntvfs_module_context *ntvfs,
428 struct ntvfs_request *req, union smb_fileinfo *io)
430 return NT_STATUS_NOT_IMPLEMENTED;
435 set info on a pathname
437 static NTSTATUS cvfs_setpathinfo(struct ntvfs_module_context *ntvfs,
438 struct ntvfs_request *req, union smb_setfileinfo *st)
440 return NT_STATUS_NOT_IMPLEMENTED;
447 static NTSTATUS cvfs_open(struct ntvfs_module_context *ntvfs,
448 struct ntvfs_request *req, union smb_open *io)
450 return NT_STATUS_NOT_IMPLEMENTED;
456 static NTSTATUS cvfs_mkdir(struct ntvfs_module_context *ntvfs,
457 struct ntvfs_request *req, union smb_mkdir *md)
459 struct cvfs_private *private = ntvfs->private_data;
460 struct composite_context *c_req;
464 c_req = smb2_composite_mkdir_send(private->tree, md);
466 SIMPLE_COMPOSITE_TAIL;
472 static NTSTATUS cvfs_rmdir(struct ntvfs_module_context *ntvfs,
473 struct ntvfs_request *req, struct smb_rmdir *rd)
475 struct cvfs_private *private = ntvfs->private_data;
476 struct composite_context *c_req;
480 c_req = smb2_composite_rmdir_send(private->tree, rd);
482 SIMPLE_COMPOSITE_TAIL;
486 rename a set of files
488 static NTSTATUS cvfs_rename(struct ntvfs_module_context *ntvfs,
489 struct ntvfs_request *req, union smb_rename *ren)
491 return NT_STATUS_NOT_IMPLEMENTED;
497 static NTSTATUS cvfs_copy(struct ntvfs_module_context *ntvfs,
498 struct ntvfs_request *req, struct smb_copy *cp)
500 return NT_STATUS_NOT_SUPPORTED;
506 static NTSTATUS cvfs_read(struct ntvfs_module_context *ntvfs,
507 struct ntvfs_request *req, union smb_read *io)
509 return NT_STATUS_NOT_IMPLEMENTED;
515 static NTSTATUS cvfs_write(struct ntvfs_module_context *ntvfs,
516 struct ntvfs_request *req, union smb_write *io)
518 return NT_STATUS_NOT_IMPLEMENTED;
524 static NTSTATUS cvfs_seek(struct ntvfs_module_context *ntvfs,
525 struct ntvfs_request *req,
528 return NT_STATUS_NOT_IMPLEMENTED;
534 static NTSTATUS cvfs_flush(struct ntvfs_module_context *ntvfs,
535 struct ntvfs_request *req,
538 return NT_STATUS_NOT_IMPLEMENTED;
544 static NTSTATUS cvfs_close(struct ntvfs_module_context *ntvfs,
545 struct ntvfs_request *req, union smb_close *io)
547 return NT_STATUS_NOT_IMPLEMENTED;
551 exit - closing files open by the pid
553 static NTSTATUS cvfs_exit(struct ntvfs_module_context *ntvfs,
554 struct ntvfs_request *req)
556 return NT_STATUS_NOT_IMPLEMENTED;
560 logoff - closing files open by the user
562 static NTSTATUS cvfs_logoff(struct ntvfs_module_context *ntvfs,
563 struct ntvfs_request *req)
565 /* we can't do this right in the cifs backend .... */
570 setup for an async call - nothing to do yet
572 static NTSTATUS cvfs_async_setup(struct ntvfs_module_context *ntvfs,
573 struct ntvfs_request *req,
582 static NTSTATUS cvfs_cancel(struct ntvfs_module_context *ntvfs,
583 struct ntvfs_request *req)
585 return NT_STATUS_NOT_IMPLEMENTED;
591 static NTSTATUS cvfs_lock(struct ntvfs_module_context *ntvfs,
592 struct ntvfs_request *req, union smb_lock *io)
594 return NT_STATUS_NOT_IMPLEMENTED;
598 set info on a open file
600 static NTSTATUS cvfs_setfileinfo(struct ntvfs_module_context *ntvfs,
601 struct ntvfs_request *req,
602 union smb_setfileinfo *io)
604 return NT_STATUS_NOT_IMPLEMENTED;
609 a handler for async fsinfo replies
611 static void async_fsinfo(struct smb2_request *c_req)
613 struct async_info *async = c_req->async.private_data;
614 struct ntvfs_request *req = async->req;
615 req->async_states->status = smb2_getinfo_fs_recv(c_req, req, async->parms);
617 req->async_states->send_fn(req);
621 return filesystem space info
623 static NTSTATUS cvfs_fsinfo(struct ntvfs_module_context *ntvfs,
624 struct ntvfs_request *req, union smb_fsinfo *fs)
626 struct cvfs_private *private = ntvfs->private_data;
627 struct smb2_request *c_req;
628 enum smb_fsinfo_level level = fs->generic.level;
633 /* some levels go straight through */
634 case RAW_QFS_VOLUME_INFORMATION:
635 case RAW_QFS_SIZE_INFORMATION:
636 case RAW_QFS_DEVICE_INFORMATION:
637 case RAW_QFS_ATTRIBUTE_INFORMATION:
638 case RAW_QFS_QUOTA_INFORMATION:
639 case RAW_QFS_FULL_SIZE_INFORMATION:
640 case RAW_QFS_OBJECTID_INFORMATION:
643 /* some get mapped */
644 case RAW_QFS_VOLUME_INFO:
645 level = RAW_QFS_VOLUME_INFORMATION;
647 case RAW_QFS_SIZE_INFO:
648 level = RAW_QFS_SIZE_INFORMATION;
650 case RAW_QFS_DEVICE_INFO:
651 level = RAW_QFS_DEVICE_INFORMATION;
653 case RAW_QFS_ATTRIBUTE_INFO:
654 level = RAW_QFS_ATTRIBUTE_INFO;
658 /* the rest get refused for now */
659 DEBUG(0,("fsinfo level %u not possible on SMB2\n",
660 (unsigned)fs->generic.level));
664 fs->generic.level = level;
665 fs->generic.handle = private->roothandle;
667 c_req = smb2_getinfo_fs_send(private->tree, fs);
669 ASYNC_RECV_TAIL(fs, async_fsinfo);
673 return print queue info
675 static NTSTATUS cvfs_lpq(struct ntvfs_module_context *ntvfs,
676 struct ntvfs_request *req, union smb_lpq *lpq)
678 return NT_STATUS_NOT_SUPPORTED;
682 list files in a directory matching a wildcard pattern
684 static NTSTATUS cvfs_search_first(struct ntvfs_module_context *ntvfs,
685 struct ntvfs_request *req, union smb_search_first *io,
686 void *search_private,
687 bool (*callback)(void *, const union smb_search_data *))
689 struct cvfs_private *private = ntvfs->private_data;
691 enum smb_search_data_level smb2_level;
693 union smb_search_data *data;
696 if (io->generic.level != RAW_SEARCH_TRANS2) {
697 DEBUG(0,("We only support trans2 search in smb2 backend\n"));
698 return NT_STATUS_NOT_SUPPORTED;
701 switch (io->generic.data_level) {
702 case RAW_SEARCH_DATA_DIRECTORY_INFO:
703 smb2_level = SMB2_FIND_DIRECTORY_INFO;
705 case RAW_SEARCH_DATA_FULL_DIRECTORY_INFO:
706 smb2_level = SMB2_FIND_FULL_DIRECTORY_INFO;
708 case RAW_SEARCH_DATA_BOTH_DIRECTORY_INFO:
709 smb2_level = SMB2_FIND_BOTH_DIRECTORY_INFO;
711 case RAW_SEARCH_DATA_NAME_INFO:
712 smb2_level = SMB2_FIND_NAME_INFO;
714 case RAW_SEARCH_DATA_ID_FULL_DIRECTORY_INFO:
715 smb2_level = SMB2_FIND_ID_FULL_DIRECTORY_INFO;
717 case RAW_SEARCH_DATA_ID_BOTH_DIRECTORY_INFO:
718 smb2_level = SMB2_FIND_ID_BOTH_DIRECTORY_INFO;
721 DEBUG(0,("Unsupported search level %u for smb2 backend\n",
722 (unsigned)io->generic.data_level));
723 return NT_STATUS_INVALID_INFO_CLASS;
726 /* we do the search on the roothandle. This only works because
727 search is synchronous, otherwise we'd have no way to
728 distinguish multiple searches happening at once
731 f.in.file.handle = private->roothandle;
732 f.in.level = smb2_level;
733 f.in.pattern = io->t2ffirst.in.pattern;
734 while (f.in.pattern[0] == '\\') {
737 f.in.continue_flags = 0;
738 f.in.max_response_size = 0x10000;
740 status = smb2_find_level(private->tree, req, &f, &count, &data);
741 NT_STATUS_NOT_OK_RETURN(status);
743 for (i=0;i<count;i++) {
744 if (!callback(search_private, &data[i])) break;
747 io->t2ffirst.out.handle = 0;
748 io->t2ffirst.out.count = i;
749 /* TODO: fix end_of_file */
750 io->t2ffirst.out.end_of_search = 1;
757 /* continue a search */
758 static NTSTATUS cvfs_search_next(struct ntvfs_module_context *ntvfs,
759 struct ntvfs_request *req, union smb_search_next *io,
760 void *search_private,
761 bool (*callback)(void *, const union smb_search_data *))
763 return NT_STATUS_NOT_IMPLEMENTED;
767 static NTSTATUS cvfs_search_close(struct ntvfs_module_context *ntvfs,
768 struct ntvfs_request *req, union smb_search_close *io)
770 return NT_STATUS_NOT_IMPLEMENTED;
773 /* SMBtrans - not used on file shares */
774 static NTSTATUS cvfs_trans(struct ntvfs_module_context *ntvfs,
775 struct ntvfs_request *req,
776 struct smb_trans2 *trans2)
778 return NT_STATUS_ACCESS_DENIED;
781 /* change notify request - always async */
782 static NTSTATUS cvfs_notify(struct ntvfs_module_context *ntvfs,
783 struct ntvfs_request *req,
784 union smb_notify *io)
786 return NT_STATUS_NOT_IMPLEMENTED;
790 initialise the CIFS->CIFS backend, registering ourselves with the ntvfs subsystem
792 NTSTATUS ntvfs_smb2_init(void)
795 struct ntvfs_ops ops;
796 NTVFS_CURRENT_CRITICAL_SIZES(vers);
800 /* fill in the name and type */
802 ops.type = NTVFS_DISK;
804 /* fill in all the operations */
805 ops.connect = cvfs_connect;
806 ops.disconnect = cvfs_disconnect;
807 ops.unlink = cvfs_unlink;
808 ops.chkpath = cvfs_chkpath;
809 ops.qpathinfo = cvfs_qpathinfo;
810 ops.setpathinfo = cvfs_setpathinfo;
811 ops.open = cvfs_open;
812 ops.mkdir = cvfs_mkdir;
813 ops.rmdir = cvfs_rmdir;
814 ops.rename = cvfs_rename;
815 ops.copy = cvfs_copy;
816 ops.ioctl = cvfs_ioctl;
817 ops.read = cvfs_read;
818 ops.write = cvfs_write;
819 ops.seek = cvfs_seek;
820 ops.flush = cvfs_flush;
821 ops.close = cvfs_close;
822 ops.exit = cvfs_exit;
823 ops.lock = cvfs_lock;
824 ops.setfileinfo = cvfs_setfileinfo;
825 ops.qfileinfo = cvfs_qfileinfo;
826 ops.fsinfo = cvfs_fsinfo;
828 ops.search_first = cvfs_search_first;
829 ops.search_next = cvfs_search_next;
830 ops.search_close = cvfs_search_close;
831 ops.trans = cvfs_trans;
832 ops.logoff = cvfs_logoff;
833 ops.async_setup = cvfs_async_setup;
834 ops.cancel = cvfs_cancel;
835 ops.notify = cvfs_notify;
837 /* register ourselves with the NTVFS subsystem. We register
838 under the name 'smb2'. */
839 ret = ntvfs_register(&ops, &vers);
841 if (!NT_STATUS_IS_OK(ret)) {
842 DEBUG(0,("Failed to register SMB2 backend\n"));