r1654: rename cli_ -> smbcli_
[nivanova/samba-autobuild/.git] / source4 / ntvfs / cifs / vfs_cifs.c
1 /* 
2    Unix SMB/CIFS implementation.
3
4    CIFS-on-CIFS NTVFS filesystem backend
5
6    Copyright (C) Andrew Tridgell 2003
7    Copyright (C) James J Myers 2003 <myersjj@samba.org>
8
9    This program is free software; you can redistribute it and/or modify
10    it under the terms of the GNU General Public License as published by
11    the Free Software Foundation; either version 2 of the License, or
12    (at your option) any later version.
13    
14    This program is distributed in the hope that it will be useful,
15    but WITHOUT ANY WARRANTY; without even the implied warranty of
16    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17    GNU General Public License for more details.
18    
19    You should have received a copy of the GNU General Public License
20    along with this program; if not, write to the Free Software
21    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 */
23 /*
24   this implements a CIFS->CIFS NTVFS filesystem backend. 
25   
26 */
27
28 #include "includes.h"
29
30 /* this is stored in ntvfs_private */
31 struct cvfs_private {
32         struct smbcli_tree *tree;
33         struct smbcli_transport *transport;
34         struct smbsrv_tcon *tcon;
35         const char *map_calls;
36 };
37
38
39 /* a structure used to pass information to an async handler */
40 struct async_info {
41         struct smbsrv_request *req;
42         void *parms;
43 };
44
45 /*
46   an idle function to cope with messages from the smbd client while 
47   waiting for a reply from the server
48   this function won't be needed once all of the cifs backend
49   and the core of smbd is converted to use async calls
50 */
51 static void idle_func(struct smbcli_transport *transport, void *p_private)
52 {
53         struct cvfs_private *private = p_private;
54         if (socket_pending(private->tcon->smb_conn->connection->socket->fde->fd)) {
55                 smbd_process_async(private->tcon->smb_conn);
56         }
57 }
58
59 /*
60   a handler for oplock break events from the server - these need to be passed
61   along to the client
62  */
63 static BOOL oplock_handler(struct smbcli_transport *transport, uint16_t tid, uint16_t fnum, uint8_t level, void *p_private)
64 {
65         struct cvfs_private *private = p_private;
66         
67         DEBUG(5,("vfs_cifs: sending oplock break level %d for fnum %d\n", level, fnum));
68         return req_send_oplock_break(private->tcon, fnum, level);
69 }
70
71  /*
72   a handler for read events on a connection to a backend server
73 */
74 static void cifs_socket_handler(struct event_context *ev, struct fd_event *fde, time_t t, uint16_t flags)
75 {
76         struct cvfs_private *private = fde->private;
77         struct smbsrv_tcon *tcon = private->tcon;
78         
79         DEBUG(5,("cifs_socket_handler event on fd %d\n", fde->fd));
80         
81         if (!smbcli_transport_process(private->transport)) {
82                 /* the connection to our server is dead */
83                 close_cnum(tcon);
84         }
85 }
86
87 /*
88   connect to a share - used when a tree_connect operation comes in.
89 */
90 static NTSTATUS cvfs_connect(struct smbsrv_request *req, const char *sharename)
91 {
92         struct smbsrv_tcon *tcon = req->tcon;
93         NTSTATUS status;
94         struct cvfs_private *private;
95         const char *map_calls;
96         const char *host, *user, *pass, *domain, *remote_share;
97
98         /* Here we need to determine which server to connect to.
99          * For now we use parametric options, type cifs.
100          * Later we will use security=server and auth_server.c.
101          */
102         host = lp_parm_string(req->tcon->service, "cifs", "server");
103         user = lp_parm_string(req->tcon->service, "cifs", "user");
104         pass = lp_parm_string(req->tcon->service, "cifs", "password");
105         domain = lp_parm_string(req->tcon->service, "cifs", "domain");
106         remote_share = lp_parm_string(req->tcon->service, "cifs", "share");
107         if (!remote_share) {
108                 remote_share = sharename;
109         }
110
111         if (!host || !user || !pass || !domain) {
112                 DEBUG(1,("CIFS backend: You must supply server, user, password and domain\n"));
113                 return NT_STATUS_INVALID_PARAMETER;
114         }
115         
116         private = talloc(req->tcon->mem_ctx, sizeof(struct cvfs_private));
117         if (!private) {
118                 return NT_STATUS_NO_MEMORY;
119         }
120         ZERO_STRUCTP(private);
121
122         req->tcon->ntvfs_private = (void *)private;
123
124         status = smbcli_tree_full_connection(&private->tree, 
125                                           "vfs_cifs",
126                                           host,
127                                           0,
128                                           remote_share, "?????",
129                                           user, domain,
130                                           pass);
131         if (!NT_STATUS_IS_OK(status)) {
132                 return status;
133         }
134
135         private->transport = private->tree->session->transport;
136         private->tree->session->pid = SVAL(req->in.hdr, HDR_PID);
137         private->tcon = req->tcon;
138
139         tcon->fs_type = talloc_strdup(tcon->mem_ctx, "NTFS");
140         tcon->dev_type = talloc_strdup(tcon->mem_ctx, "A:");
141         
142         map_calls = lp_parm_string(req->tcon->service, "cifs", "map calls");
143         if (map_calls) {
144                 private->map_calls = talloc_strdup(tcon->mem_ctx, map_calls);
145         }
146
147         /* if we are mapping trans2, then we need to give a trans2
148            pointer in the operations structure */
149         if (private->map_calls && in_list("trans2", private->map_calls, True)) {
150                 struct ntvfs_ops *ops = talloc_memdup(tcon->mem_ctx,tcon->ntvfs_ops,sizeof(*ops));
151                 static NTSTATUS cvfs_trans2(struct smbsrv_request *,struct smb_trans2 *);
152                 if (!ops) {
153                         return NT_STATUS_NO_MEMORY;
154                 }
155                 ops->trans2 = cvfs_trans2;
156                 tcon->ntvfs_ops = ops;
157         }         
158
159         /* we need to receive oplock break requests from the server */
160         smbcli_oplock_handler(private->transport, oplock_handler, private);
161         smbcli_transport_idle_handler(private->transport, idle_func, 1, private);
162
163         private->transport->event.fde->handler = cifs_socket_handler;
164         private->transport->event.fde->private = private;
165
166         event_context_merge(tcon->smb_conn->connection->event.ctx,
167                             private->transport->event.ctx);
168
169         private->transport->event.ctx = tcon->smb_conn->connection->event.ctx;
170
171         return NT_STATUS_OK;
172 }
173
174 /*
175   disconnect from a share
176 */
177 static NTSTATUS cvfs_disconnect(struct smbsrv_tcon *tcon)
178 {
179         struct cvfs_private *private = tcon->ntvfs_private;
180
181         smb_tree_disconnect(private->tree);
182         smbcli_tree_close(private->tree);
183
184         return NT_STATUS_OK;
185 }
186
187 /*
188   a handler for simple async replies
189   this handler can only be used for functions that don't return any
190   parameters (those that just return a status code)
191  */
192 static void async_simple(struct smbcli_request *c_req)
193 {
194         struct async_info *async = c_req->async.private;
195         struct smbsrv_request *req = async->req;
196         req->async.status = smbcli_request_simple_recv(c_req);
197         req->async.send_fn(req);
198 }
199
200
201 /* save some typing for the simple functions */
202 #define ASYNC_RECV_TAIL(io, async_fn) do { \
203         if (!c_req) return NT_STATUS_UNSUCCESSFUL; \
204         { \
205                 struct async_info *async; \
206                 async = talloc(req->mem_ctx, sizeof(*async)); \
207                 if (!async) return NT_STATUS_NO_MEMORY; \
208                 async->parms = io; \
209                 async->req = req; \
210                 c_req->async.private = async; \
211         } \
212         c_req->async.fn = async_fn; \
213         req->control_flags |= REQ_CONTROL_ASYNC; \
214         return NT_STATUS_OK; \
215 } while (0)
216
217 #define SIMPLE_ASYNC_TAIL ASYNC_RECV_TAIL(NULL, async_simple)
218
219 /*
220   delete a file - the dirtype specifies the file types to include in the search. 
221   The name can contain CIFS wildcards, but rarely does (except with OS/2 clients)
222 */
223 static NTSTATUS cvfs_unlink(struct smbsrv_request *req, struct smb_unlink *unl)
224 {
225         struct cvfs_private *private = req->tcon->ntvfs_private;
226         struct smbcli_request *c_req;
227
228         /* see if the front end will allow us to perform this
229            function asynchronously.  */
230         if (!req->async.send_fn) {
231                 return smb_raw_unlink(private->tree, unl);
232         }
233
234         c_req = smb_raw_unlink_send(private->tree, unl);
235
236         SIMPLE_ASYNC_TAIL;
237 }
238
239 /*
240   a handler for async ioctl replies
241  */
242 static void async_ioctl(struct smbcli_request *c_req)
243 {
244         struct async_info *async = c_req->async.private;
245         struct smbsrv_request *req = async->req;
246         req->async.status = smb_raw_ioctl_recv(c_req, req->mem_ctx, async->parms);
247         req->async.send_fn(req);
248 }
249
250 /*
251   ioctl interface
252 */
253 static NTSTATUS cvfs_ioctl(struct smbsrv_request *req, union smb_ioctl *io)
254 {
255         struct cvfs_private *private = req->tcon->ntvfs_private;
256         struct smbcli_request *c_req;
257
258         /* see if the front end will allow us to perform this
259            function asynchronously.  */
260         if (!req->async.send_fn) {
261                 return smb_raw_ioctl(private->tree, req->mem_ctx, io);
262         }
263
264         c_req = smb_raw_ioctl_send(private->tree, io);
265
266         ASYNC_RECV_TAIL(io, async_ioctl);
267 }
268
269 /*
270   check if a directory exists
271 */
272 static NTSTATUS cvfs_chkpath(struct smbsrv_request *req, struct smb_chkpath *cp)
273 {
274         struct cvfs_private *private = req->tcon->ntvfs_private;
275         struct smbcli_request *c_req;
276
277         if (!req->async.send_fn) {
278                 return smb_raw_chkpath(private->tree, cp);
279         }
280
281         c_req = smb_raw_chkpath_send(private->tree, cp);
282
283         SIMPLE_ASYNC_TAIL;
284 }
285
286 /*
287   a handler for async qpathinfo replies
288  */
289 static void async_qpathinfo(struct smbcli_request *c_req)
290 {
291         struct async_info *async = c_req->async.private;
292         struct smbsrv_request *req = async->req;
293         req->async.status = smb_raw_pathinfo_recv(c_req, req->mem_ctx, async->parms);
294         req->async.send_fn(req);
295 }
296
297 /*
298   return info on a pathname
299 */
300 static NTSTATUS cvfs_qpathinfo(struct smbsrv_request *req, union smb_fileinfo *info)
301 {
302         struct cvfs_private *private = req->tcon->ntvfs_private;
303         struct smbcli_request *c_req;
304
305         if (!req->async.send_fn) {
306                 return smb_raw_pathinfo(private->tree, req->mem_ctx, info);
307         }
308
309         c_req = smb_raw_pathinfo_send(private->tree, info);
310
311         ASYNC_RECV_TAIL(info, async_qpathinfo);
312 }
313
314 /*
315   a handler for async qfileinfo replies
316  */
317 static void async_qfileinfo(struct smbcli_request *c_req)
318 {
319         struct async_info *async = c_req->async.private;
320         struct smbsrv_request *req = async->req;
321         req->async.status = smb_raw_fileinfo_recv(c_req, req->mem_ctx, async->parms);
322         req->async.send_fn(req);
323 }
324
325 /*
326   query info on a open file
327 */
328 static NTSTATUS cvfs_qfileinfo(struct smbsrv_request *req, union smb_fileinfo *info)
329 {
330         struct cvfs_private *private = req->tcon->ntvfs_private;
331         struct smbcli_request *c_req;
332
333         if (!req->async.send_fn) {
334                 return smb_raw_fileinfo(private->tree, req->mem_ctx, info);
335         }
336
337         c_req = smb_raw_fileinfo_send(private->tree, info);
338
339         ASYNC_RECV_TAIL(info, async_qfileinfo);
340 }
341
342
343 /*
344   set info on a pathname
345 */
346 static NTSTATUS cvfs_setpathinfo(struct smbsrv_request *req, union smb_setfileinfo *st)
347 {
348         struct cvfs_private *private = req->tcon->ntvfs_private;
349         struct smbcli_request *c_req;
350
351         if (!req->async.send_fn) {
352                 return smb_raw_setpathinfo(private->tree, st);
353         }
354
355         c_req = smb_raw_setpathinfo_send(private->tree, st);
356
357         SIMPLE_ASYNC_TAIL;
358 }
359
360
361 /*
362   a handler for async open replies
363  */
364 static void async_open(struct smbcli_request *c_req)
365 {
366         struct async_info *async = c_req->async.private;
367         struct smbsrv_request *req = async->req;
368         req->async.status = smb_raw_open_recv(c_req, req->mem_ctx, async->parms);
369         req->async.send_fn(req);
370 }
371
372 /*
373   open a file
374 */
375 static NTSTATUS cvfs_open(struct smbsrv_request *req, union smb_open *io)
376 {
377         struct cvfs_private *private = req->tcon->ntvfs_private;
378         struct smbcli_request *c_req;
379
380         if (private->map_calls && in_list("open", private->map_calls, True) &&
381             io->generic.level != RAW_OPEN_GENERIC) {
382                 return ntvfs_map_open(req, io);
383         }
384
385         if (!req->async.send_fn) {
386                 return smb_raw_open(private->tree, req->mem_ctx, io);
387         }
388
389         c_req = smb_raw_open_send(private->tree, io);
390
391         ASYNC_RECV_TAIL(io, async_open);
392 }
393
394 /*
395   create a directory
396 */
397 static NTSTATUS cvfs_mkdir(struct smbsrv_request *req, union smb_mkdir *md)
398 {
399         struct cvfs_private *private = req->tcon->ntvfs_private;
400         struct smbcli_request *c_req;
401
402         if (!req->async.send_fn) {
403                 return smb_raw_mkdir(private->tree, md);
404         }
405
406         c_req = smb_raw_mkdir_send(private->tree, md);
407
408         SIMPLE_ASYNC_TAIL;
409 }
410
411 /*
412   remove a directory
413 */
414 static NTSTATUS cvfs_rmdir(struct smbsrv_request *req, struct smb_rmdir *rd)
415 {
416         struct cvfs_private *private = req->tcon->ntvfs_private;
417         struct smbcli_request *c_req;
418
419         if (!req->async.send_fn) {
420                 return smb_raw_rmdir(private->tree, rd);
421         }
422         c_req = smb_raw_rmdir_send(private->tree, rd);
423
424         SIMPLE_ASYNC_TAIL;
425 }
426
427 /*
428   rename a set of files
429 */
430 static NTSTATUS cvfs_rename(struct smbsrv_request *req, union smb_rename *ren)
431 {
432         struct cvfs_private *private = req->tcon->ntvfs_private;
433         struct smbcli_request *c_req;
434
435         if (!req->async.send_fn) {
436                 return smb_raw_rename(private->tree, ren);
437         }
438
439         c_req = smb_raw_rename_send(private->tree, ren);
440
441         SIMPLE_ASYNC_TAIL;
442 }
443
444 /*
445   copy a set of files
446 */
447 static NTSTATUS cvfs_copy(struct smbsrv_request *req, struct smb_copy *cp)
448 {
449         return NT_STATUS_NOT_SUPPORTED;
450 }
451
452 /*
453   a handler for async read replies
454  */
455 static void async_read(struct smbcli_request *c_req)
456 {
457         struct async_info *async = c_req->async.private;
458         struct smbsrv_request *req = async->req;
459         req->async.status = smb_raw_read_recv(c_req, async->parms);
460         req->async.send_fn(req);
461 }
462
463 /*
464   read from a file
465 */
466 static NTSTATUS cvfs_read(struct smbsrv_request *req, union smb_read *rd)
467 {
468         struct cvfs_private *private = req->tcon->ntvfs_private;
469         struct smbcli_request *c_req;
470
471         if (!req->async.send_fn) {
472                 return smb_raw_read(private->tree, rd);
473         }
474
475         c_req = smb_raw_read_send(private->tree, rd);
476
477         ASYNC_RECV_TAIL(rd, async_read);
478 }
479
480 /*
481   a handler for async write replies
482  */
483 static void async_write(struct smbcli_request *c_req)
484 {
485         struct async_info *async = c_req->async.private;
486         struct smbsrv_request *req = async->req;
487         req->async.status = smb_raw_write_recv(c_req, async->parms);
488         req->async.send_fn(req);
489 }
490
491 /*
492   write to a file
493 */
494 static NTSTATUS cvfs_write(struct smbsrv_request *req, union smb_write *wr)
495 {
496         struct cvfs_private *private = req->tcon->ntvfs_private;
497         struct smbcli_request *c_req;
498
499         if (!req->async.send_fn) {
500                 return smb_raw_write(private->tree, wr);
501         }
502
503         c_req = smb_raw_write_send(private->tree, wr);
504
505         ASYNC_RECV_TAIL(wr, async_write);
506 }
507
508 /*
509   seek in a file
510 */
511 static NTSTATUS cvfs_seek(struct smbsrv_request *req, struct smb_seek *io)
512 {
513         return NT_STATUS_NOT_SUPPORTED;
514 }
515
516 /*
517   flush a file
518 */
519 static NTSTATUS cvfs_flush(struct smbsrv_request *req, struct smb_flush *io)
520 {
521         return NT_STATUS_OK;
522 }
523
524 /*
525   close a file
526 */
527 static NTSTATUS cvfs_close(struct smbsrv_request *req, union smb_close *io)
528 {
529         struct cvfs_private *private = req->tcon->ntvfs_private;
530         struct smbcli_request *c_req;
531
532         if (!req->async.send_fn) {
533                 return smb_raw_close(private->tree, io);
534         }
535
536         c_req = smb_raw_close_send(private->tree, io);
537
538         SIMPLE_ASYNC_TAIL;
539 }
540
541 /*
542   exit - closing files?
543 */
544 static NTSTATUS cvfs_exit(struct smbsrv_request *req)
545 {
546         return NT_STATUS_NOT_SUPPORTED;
547 }
548
549 /*
550   lock a byte range
551 */
552 static NTSTATUS cvfs_lock(struct smbsrv_request *req, union smb_lock *lck)
553 {
554         struct cvfs_private *private = req->tcon->ntvfs_private;
555         struct smbcli_request *c_req;
556
557         if (!req->async.send_fn) {
558                 return smb_raw_lock(private->tree, lck);
559         }
560
561         c_req = smb_raw_lock_send(private->tree, lck);
562         SIMPLE_ASYNC_TAIL;
563 }
564
565 /*
566   set info on a open file
567 */
568 static NTSTATUS cvfs_setfileinfo(struct smbsrv_request *req, 
569                                  union smb_setfileinfo *info)
570 {
571         struct cvfs_private *private = req->tcon->ntvfs_private;
572         struct smbcli_request *c_req;
573
574         if (!req->async.send_fn) {
575                 return smb_raw_setfileinfo(private->tree, info);
576         }
577         c_req = smb_raw_setfileinfo_send(private->tree, info);
578
579         SIMPLE_ASYNC_TAIL;
580 }
581
582
583 /*
584   a handler for async fsinfo replies
585  */
586 static void async_fsinfo(struct smbcli_request *c_req)
587 {
588         struct async_info *async = c_req->async.private;
589         struct smbsrv_request *req = async->req;
590         req->async.status = smb_raw_fsinfo_recv(c_req, req->mem_ctx, async->parms);
591         req->async.send_fn(req);
592 }
593
594 /*
595   return filesystem space info
596 */
597 static NTSTATUS cvfs_fsinfo(struct smbsrv_request *req, union smb_fsinfo *fs)
598 {
599         struct cvfs_private *private = req->tcon->ntvfs_private;
600         struct smbcli_request *c_req;
601
602         if (!req->async.send_fn) {
603                 return smb_raw_fsinfo(private->tree, req->mem_ctx, fs);
604         }
605
606         c_req = smb_raw_fsinfo_send(private->tree, req->mem_ctx, fs);
607
608         ASYNC_RECV_TAIL(fs, async_fsinfo);
609 }
610
611 /*
612   return print queue info
613 */
614 static NTSTATUS cvfs_lpq(struct smbsrv_request *req, union smb_lpq *lpq)
615 {
616         return NT_STATUS_NOT_SUPPORTED;
617 }
618
619 /* 
620    list files in a directory matching a wildcard pattern
621 */
622 static NTSTATUS cvfs_search_first(struct smbsrv_request *req, union smb_search_first *io, 
623                                   void *search_private, 
624                                   BOOL (*callback)(void *, union smb_search_data *))
625 {
626         struct cvfs_private *private = req->tcon->ntvfs_private;
627
628         return smb_raw_search_first(private->tree, req->mem_ctx, io, search_private, callback);
629 }
630
631 /* continue a search */
632 static NTSTATUS cvfs_search_next(struct smbsrv_request *req, union smb_search_next *io, 
633                                  void *search_private, 
634                                  BOOL (*callback)(void *, union smb_search_data *))
635 {
636         struct cvfs_private *private = req->tcon->ntvfs_private;
637
638         return smb_raw_search_next(private->tree, req->mem_ctx, io, search_private, callback);
639 }
640
641 /* close a search */
642 static NTSTATUS cvfs_search_close(struct smbsrv_request *req, union smb_search_close *io)
643 {
644         struct cvfs_private *private = req->tcon->ntvfs_private;
645
646         return smb_raw_search_close(private->tree, io);
647 }
648
649 /*
650   a handler for async trans2 replies
651  */
652 static void async_trans2(struct smbcli_request *c_req)
653 {
654         struct async_info *async = c_req->async.private;
655         struct smbsrv_request *req = async->req;
656         req->async.status = smb_raw_trans2_recv(c_req, req->mem_ctx, async->parms);
657         req->async.send_fn(req);
658 }
659
660 /* raw trans2 */
661 static NTSTATUS cvfs_trans2(struct smbsrv_request *req, struct smb_trans2 *trans2)
662 {
663         struct cvfs_private *private = req->tcon->ntvfs_private;
664         struct smbcli_request *c_req;
665
666         if (!req->async.send_fn) {
667                 return smb_raw_trans2(private->tree, req->mem_ctx, trans2);
668         }
669
670         c_req = smb_raw_trans2_send(private->tree, trans2);
671
672         ASYNC_RECV_TAIL(trans2, async_trans2);
673 }
674
675
676 /* SMBtrans - not used on file shares */
677 static NTSTATUS cvfs_trans(struct smbsrv_request *req, struct smb_trans2 *trans2)
678 {
679         return NT_STATUS_ACCESS_DENIED;
680 }
681
682 /*
683   initialise the CIFS->CIFS backend, registering ourselves with the ntvfs subsystem
684  */
685 NTSTATUS ntvfs_cifs_init(void)
686 {
687         NTSTATUS ret;
688         struct ntvfs_ops ops;
689
690         ZERO_STRUCT(ops);
691
692         /* fill in the name and type */
693         ops.name = "cifs";
694         ops.type = NTVFS_DISK;
695         
696         /* fill in all the operations */
697         ops.connect = cvfs_connect;
698         ops.disconnect = cvfs_disconnect;
699         ops.unlink = cvfs_unlink;
700         ops.chkpath = cvfs_chkpath;
701         ops.qpathinfo = cvfs_qpathinfo;
702         ops.setpathinfo = cvfs_setpathinfo;
703         ops.open = cvfs_open;
704         ops.mkdir = cvfs_mkdir;
705         ops.rmdir = cvfs_rmdir;
706         ops.rename = cvfs_rename;
707         ops.copy = cvfs_copy;
708         ops.ioctl = cvfs_ioctl;
709         ops.read = cvfs_read;
710         ops.write = cvfs_write;
711         ops.seek = cvfs_seek;
712         ops.flush = cvfs_flush; 
713         ops.close = cvfs_close;
714         ops.exit = cvfs_exit;
715         ops.lock = cvfs_lock;
716         ops.setfileinfo = cvfs_setfileinfo;
717         ops.qfileinfo = cvfs_qfileinfo;
718         ops.fsinfo = cvfs_fsinfo;
719         ops.lpq = cvfs_lpq;
720         ops.search_first = cvfs_search_first;
721         ops.search_next = cvfs_search_next;
722         ops.search_close = cvfs_search_close;
723         ops.trans = cvfs_trans;
724
725         /* only define this one for trans2 testing */
726         ops.trans2 = NULL;
727
728         /* register ourselves with the NTVFS subsystem. We register
729            under the name 'cifs'. */
730         ret = register_backend("ntvfs", &ops);
731
732         if (!NT_STATUS_IS_OK(ret)) {
733                 DEBUG(0,("Failed to register CIFS backend!\n"));
734         }
735         
736         return ret;
737 }