VFS: Modify rmdir to take a const struct smb_filename * instead of const char *
[kamenim/samba-autobuild/.git] / examples / VFS / skel_opaque.c
1 /* 
2  * Skeleton VFS module.  Implements dummy versions of all VFS
3  * functions.
4  *
5  * Copyright (C) Tim Potter, 1999-2000
6  * Copyright (C) Alexander Bokovoy, 2002
7  * Copyright (C) Stefan (metze) Metzmacher, 2003
8  * Copyright (C) Jeremy Allison 2009
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 3 of the License, or
13  * (at your option) any later version.
14  *  
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *  
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, see <http://www.gnu.org/licenses/>.
22  */
23
24 #include "../source3/include/includes.h"
25 #include "lib/util/tevent_ntstatus.h"
26
27 /* PLEASE,PLEASE READ THE VFS MODULES CHAPTER OF THE 
28    SAMBA DEVELOPERS GUIDE!!!!!!
29  */
30
31 /* If you take this file as template for your module
32  * you must re-implement every function.
33  */
34
35 static int skel_connect(vfs_handle_struct *handle, const char *service,
36                         const char *user)
37 {
38         errno = ENOSYS;
39         return -1;
40 }
41
42 static void skel_disconnect(vfs_handle_struct *handle)
43 {
44         ;
45 }
46
47 static uint64_t skel_disk_free(vfs_handle_struct *handle, const char *path,
48                                uint64_t *bsize,
49                                uint64_t *dfree, uint64_t *dsize)
50 {
51         *bsize = 0;
52         *dfree = 0;
53         *dsize = 0;
54         return 0;
55 }
56
57 static int skel_get_quota(vfs_handle_struct *handle, const char *path,
58                           enum SMB_QUOTA_TYPE qtype, unid_t id,
59                           SMB_DISK_QUOTA *dq)
60 {
61         errno = ENOSYS;
62         return -1;
63 }
64
65 static int skel_set_quota(vfs_handle_struct *handle, enum SMB_QUOTA_TYPE qtype,
66                           unid_t id, SMB_DISK_QUOTA *dq)
67 {
68         errno = ENOSYS;
69         return -1;
70 }
71
72 static int skel_get_shadow_copy_data(vfs_handle_struct *handle,
73                                      files_struct *fsp,
74                                      struct shadow_copy_data *shadow_copy_data,
75                                      bool labels)
76 {
77         errno = ENOSYS;
78         return -1;
79 }
80
81 static int skel_statvfs(struct vfs_handle_struct *handle,
82                         const char *path, struct vfs_statvfs_struct *statbuf)
83 {
84         errno = ENOSYS;
85         return -1;
86 }
87
88 static uint32_t skel_fs_capabilities(struct vfs_handle_struct *handle,
89                                      enum timestamp_set_resolution *p_ts_res)
90 {
91         return 0;
92 }
93
94 static NTSTATUS skel_get_dfs_referrals(struct vfs_handle_struct *handle,
95                                        struct dfs_GetDFSReferral *r)
96 {
97         return NT_STATUS_NOT_IMPLEMENTED;
98 }
99
100 static DIR *skel_opendir(vfs_handle_struct *handle, const char *fname,
101                          const char *mask, uint32_t attr)
102 {
103         return NULL;
104 }
105
106 static NTSTATUS skel_snap_check_path(struct vfs_handle_struct *handle,
107                                      TALLOC_CTX *mem_ctx,
108                                      const char *service_path,
109                                      char **base_volume)
110 {
111         return NT_STATUS_NOT_SUPPORTED;
112 }
113
114 static NTSTATUS skel_snap_create(struct vfs_handle_struct *handle,
115                                  TALLOC_CTX *mem_ctx,
116                                  const char *base_volume,
117                                  time_t *tstamp,
118                                  bool rw,
119                                  char **base_path,
120                                  char **snap_path)
121 {
122         return NT_STATUS_NOT_SUPPORTED;
123 }
124
125 static NTSTATUS skel_snap_delete(struct vfs_handle_struct *handle,
126                                  TALLOC_CTX *mem_ctx,
127                                  char *base_path,
128                                  char *snap_path)
129 {
130         return NT_STATUS_NOT_SUPPORTED;
131 }
132
133 static DIR *skel_fdopendir(vfs_handle_struct *handle, files_struct *fsp,
134                            const char *mask, uint32_t attr)
135 {
136         return NULL;
137 }
138
139 static struct dirent *skel_readdir(vfs_handle_struct *handle,
140                                    DIR *dirp, SMB_STRUCT_STAT *sbuf)
141 {
142         return NULL;
143 }
144
145 static void skel_seekdir(vfs_handle_struct *handle, DIR *dirp, long offset)
146 {
147         ;
148 }
149
150 static long skel_telldir(vfs_handle_struct *handle, DIR *dirp)
151 {
152         return (long)-1;
153 }
154
155 static void skel_rewind_dir(vfs_handle_struct *handle, DIR *dirp)
156 {
157         ;
158 }
159
160 static int skel_mkdir(vfs_handle_struct *handle,
161                 const struct smb_filename *smb_fname,
162                 mode_t mode)
163 {
164         errno = ENOSYS;
165         return -1;
166 }
167
168 static int skel_rmdir(vfs_handle_struct *handle,
169                 const struct smb_filename *smb_fname)
170 {
171         errno = ENOSYS;
172         return -1;
173 }
174
175 static int skel_closedir(vfs_handle_struct *handle, DIR *dir)
176 {
177         errno = ENOSYS;
178         return -1;
179 }
180
181 static void skel_init_search_op(struct vfs_handle_struct *handle, DIR *dirp)
182 {
183         ;
184 }
185
186 static int skel_open(vfs_handle_struct *handle, struct smb_filename *smb_fname,
187                      files_struct *fsp, int flags, mode_t mode)
188 {
189         errno = ENOSYS;
190         return -1;
191 }
192
193 static NTSTATUS skel_create_file(struct vfs_handle_struct *handle,
194                                  struct smb_request *req,
195                                  uint16_t root_dir_fid,
196                                  struct smb_filename *smb_fname,
197                                  uint32_t access_mask,
198                                  uint32_t share_access,
199                                  uint32_t create_disposition,
200                                  uint32_t create_options,
201                                  uint32_t file_attributes,
202                                  uint32_t oplock_request,
203                                  struct smb2_lease *lease,
204                                  uint64_t allocation_size,
205                                  uint32_t private_flags,
206                                  struct security_descriptor *sd,
207                                  struct ea_list *ea_list,
208                                  files_struct **result, int *pinfo,
209                                  const struct smb2_create_blobs *in_context_blobs,
210                                  struct smb2_create_blobs *out_context_blobs)
211 {
212         return NT_STATUS_NOT_IMPLEMENTED;
213 }
214
215 static int skel_close_fn(vfs_handle_struct *handle, files_struct *fsp)
216 {
217         errno = ENOSYS;
218         return -1;
219 }
220
221 static ssize_t skel_vfs_read(vfs_handle_struct *handle, files_struct *fsp,
222                              void *data, size_t n)
223 {
224         errno = ENOSYS;
225         return -1;
226 }
227
228 static ssize_t skel_pread(vfs_handle_struct *handle, files_struct *fsp,
229                           void *data, size_t n, off_t offset)
230 {
231         errno = ENOSYS;
232         return -1;
233 }
234
235 static struct tevent_req *skel_pread_send(struct vfs_handle_struct *handle,
236                                           TALLOC_CTX *mem_ctx,
237                                           struct tevent_context *ev,
238                                           struct files_struct *fsp,
239                                           void *data, size_t n, off_t offset)
240 {
241         return NULL;
242 }
243
244 static ssize_t skel_pread_recv(struct tevent_req *req, int *err)
245 {
246         *err = ENOSYS;
247         return -1;
248 }
249
250 static ssize_t skel_write(vfs_handle_struct *handle, files_struct *fsp,
251                           const void *data, size_t n)
252 {
253         errno = ENOSYS;
254         return -1;
255 }
256
257 static ssize_t skel_pwrite(vfs_handle_struct *handle, files_struct *fsp,
258                            const void *data, size_t n, off_t offset)
259 {
260         errno = ENOSYS;
261         return -1;
262 }
263
264 static struct tevent_req *skel_pwrite_send(struct vfs_handle_struct *handle,
265                                            TALLOC_CTX *mem_ctx,
266                                            struct tevent_context *ev,
267                                            struct files_struct *fsp,
268                                            const void *data,
269                                            size_t n, off_t offset)
270 {
271         return NULL;
272 }
273
274 static ssize_t skel_pwrite_recv(struct tevent_req *req, int *err)
275 {
276         *err = ENOSYS;
277         return -1;
278 }
279
280 static off_t skel_lseek(vfs_handle_struct *handle, files_struct *fsp,
281                         off_t offset, int whence)
282 {
283         errno = ENOSYS;
284         return (off_t) - 1;
285 }
286
287 static ssize_t skel_sendfile(vfs_handle_struct *handle, int tofd,
288                              files_struct *fromfsp, const DATA_BLOB *hdr,
289                              off_t offset, size_t n)
290 {
291         errno = ENOSYS;
292         return -1;
293 }
294
295 static ssize_t skel_recvfile(vfs_handle_struct *handle, int fromfd,
296                              files_struct *tofsp, off_t offset, size_t n)
297 {
298         errno = ENOSYS;
299         return -1;
300 }
301
302 static int skel_rename(vfs_handle_struct *handle,
303                        const struct smb_filename *smb_fname_src,
304                        const struct smb_filename *smb_fname_dst)
305 {
306         errno = ENOSYS;
307         return -1;
308 }
309
310 static int skel_fsync(vfs_handle_struct *handle, files_struct *fsp)
311 {
312         errno = ENOSYS;
313         return -1;
314 }
315
316 static struct tevent_req *skel_fsync_send(struct vfs_handle_struct *handle,
317                                           TALLOC_CTX *mem_ctx,
318                                           struct tevent_context *ev,
319                                           struct files_struct *fsp)
320 {
321         return NULL;
322 }
323
324 static int skel_fsync_recv(struct tevent_req *req, int *err)
325 {
326         *err = ENOSYS;
327         return -1;
328 }
329
330 static int skel_stat(vfs_handle_struct *handle, struct smb_filename *smb_fname)
331 {
332         errno = ENOSYS;
333         return -1;
334 }
335
336 static int skel_fstat(vfs_handle_struct *handle, files_struct *fsp,
337                       SMB_STRUCT_STAT *sbuf)
338 {
339         errno = ENOSYS;
340         return -1;
341 }
342
343 static int skel_lstat(vfs_handle_struct *handle,
344                       struct smb_filename *smb_fname)
345 {
346         errno = ENOSYS;
347         return -1;
348 }
349
350 static uint64_t skel_get_alloc_size(struct vfs_handle_struct *handle,
351                                     struct files_struct *fsp,
352                                     const SMB_STRUCT_STAT *sbuf)
353 {
354         errno = ENOSYS;
355         return -1;
356 }
357
358 static int skel_unlink(vfs_handle_struct *handle,
359                        const struct smb_filename *smb_fname)
360 {
361         errno = ENOSYS;
362         return -1;
363 }
364
365 static int skel_chmod(vfs_handle_struct *handle, const char *path, mode_t mode)
366 {
367         errno = ENOSYS;
368         return -1;
369 }
370
371 static int skel_fchmod(vfs_handle_struct *handle, files_struct *fsp,
372                        mode_t mode)
373 {
374         errno = ENOSYS;
375         return -1;
376 }
377
378 static int skel_chown(vfs_handle_struct *handle, const char *path,
379                       uid_t uid, gid_t gid)
380 {
381         errno = ENOSYS;
382         return -1;
383 }
384
385 static int skel_fchown(vfs_handle_struct *handle, files_struct *fsp,
386                        uid_t uid, gid_t gid)
387 {
388         errno = ENOSYS;
389         return -1;
390 }
391
392 static int skel_lchown(vfs_handle_struct *handle, const char *path,
393                        uid_t uid, gid_t gid)
394 {
395         errno = ENOSYS;
396         return -1;
397 }
398
399 static int skel_chdir(vfs_handle_struct *handle, const char *path)
400 {
401         errno = ENOSYS;
402         return -1;
403 }
404
405 static char *skel_getwd(vfs_handle_struct *handle)
406 {
407         errno = ENOSYS;
408         return NULL;
409 }
410
411 static int skel_ntimes(vfs_handle_struct *handle,
412                        const struct smb_filename *smb_fname,
413                        struct smb_file_time *ft)
414 {
415         errno = ENOSYS;
416         return -1;
417 }
418
419 static int skel_ftruncate(vfs_handle_struct *handle, files_struct *fsp,
420                           off_t offset)
421 {
422         errno = ENOSYS;
423         return -1;
424 }
425
426 static int skel_fallocate(vfs_handle_struct *handle, files_struct *fsp,
427                           uint32_t mode, off_t offset, off_t len)
428 {
429         errno = ENOSYS;
430         return -1;
431 }
432
433 static bool skel_lock(vfs_handle_struct *handle, files_struct *fsp, int op,
434                       off_t offset, off_t count, int type)
435 {
436         errno = ENOSYS;
437         return false;
438 }
439
440 static int skel_kernel_flock(struct vfs_handle_struct *handle,
441                              struct files_struct *fsp,
442                              uint32_t share_mode, uint32_t access_mask)
443 {
444         errno = ENOSYS;
445         return -1;
446 }
447
448 static int skel_linux_setlease(struct vfs_handle_struct *handle,
449                                struct files_struct *fsp, int leasetype)
450 {
451         errno = ENOSYS;
452         return -1;
453 }
454
455 static bool skel_getlock(vfs_handle_struct *handle, files_struct *fsp,
456                          off_t *poffset, off_t *pcount, int *ptype,
457                          pid_t *ppid)
458 {
459         errno = ENOSYS;
460         return false;
461 }
462
463 static int skel_symlink(vfs_handle_struct *handle, const char *oldpath,
464                         const char *newpath)
465 {
466         errno = ENOSYS;
467         return -1;
468 }
469
470 static int skel_vfs_readlink(vfs_handle_struct *handle, const char *path,
471                              char *buf, size_t bufsiz)
472 {
473         errno = ENOSYS;
474         return -1;
475 }
476
477 static int skel_link(vfs_handle_struct *handle, const char *oldpath,
478                      const char *newpath)
479 {
480         errno = ENOSYS;
481         return -1;
482 }
483
484 static int skel_mknod(vfs_handle_struct *handle, const char *path, mode_t mode,
485                       SMB_DEV_T dev)
486 {
487         errno = ENOSYS;
488         return -1;
489 }
490
491 static char *skel_realpath(vfs_handle_struct *handle, const char *path)
492 {
493         errno = ENOSYS;
494         return NULL;
495 }
496
497 static int skel_chflags(vfs_handle_struct *handle, const char *path,
498                         uint flags)
499 {
500         errno = ENOSYS;
501         return -1;
502 }
503
504 static struct file_id skel_file_id_create(vfs_handle_struct *handle,
505                                           const SMB_STRUCT_STAT *sbuf)
506 {
507         struct file_id id;
508         ZERO_STRUCT(id);
509         errno = ENOSYS;
510         return id;
511 }
512
513 struct skel_cc_state {
514         uint64_t unused;
515 };
516 static struct tevent_req *skel_copy_chunk_send(struct vfs_handle_struct *handle,
517                                                TALLOC_CTX *mem_ctx,
518                                                struct tevent_context *ev,
519                                                struct files_struct *src_fsp,
520                                                off_t src_off,
521                                                struct files_struct *dest_fsp,
522                                                off_t dest_off,
523                                                off_t num)
524 {
525         struct tevent_req *req;
526         struct skel_cc_state *cc_state;
527
528         req = tevent_req_create(mem_ctx, &cc_state, struct skel_cc_state);
529         if (req == NULL) {
530                 return NULL;
531         }
532
533         tevent_req_nterror(req, NT_STATUS_NOT_IMPLEMENTED);
534         return tevent_req_post(req, ev);
535 }
536
537 static NTSTATUS skel_copy_chunk_recv(struct vfs_handle_struct *handle,
538                                      struct tevent_req *req,
539                                      off_t *copied)
540 {
541         NTSTATUS status;
542
543         if (tevent_req_is_nterror(req, &status)) {
544                 tevent_req_received(req);
545                 return status;
546         }
547         tevent_req_received(req);
548
549         return NT_STATUS_OK;
550 }
551
552 static NTSTATUS skel_get_compression(struct vfs_handle_struct *handle,
553                                      TALLOC_CTX *mem_ctx,
554                                      struct files_struct *fsp,
555                                      struct smb_filename *smb_fname,
556                                      uint16_t *_compression_fmt)
557 {
558         return NT_STATUS_INVALID_DEVICE_REQUEST;
559 }
560
561 static NTSTATUS skel_set_compression(struct vfs_handle_struct *handle,
562                                      TALLOC_CTX *mem_ctx,
563                                      struct files_struct *fsp,
564                                      uint16_t compression_fmt)
565 {
566         return NT_STATUS_INVALID_DEVICE_REQUEST;
567 }
568
569 static NTSTATUS skel_streaminfo(struct vfs_handle_struct *handle,
570                                 struct files_struct *fsp,
571                                 const char *fname,
572                                 TALLOC_CTX *mem_ctx,
573                                 unsigned int *num_streams,
574                                 struct stream_struct **streams)
575 {
576         return NT_STATUS_NOT_IMPLEMENTED;
577 }
578
579 static int skel_get_real_filename(struct vfs_handle_struct *handle,
580                                   const char *path,
581                                   const char *name,
582                                   TALLOC_CTX *mem_ctx, char **found_name)
583 {
584         errno = ENOSYS;
585         return -1;
586 }
587
588 static const char *skel_connectpath(struct vfs_handle_struct *handle,
589                                     const char *filename)
590 {
591         errno = ENOSYS;
592         return NULL;
593 }
594
595 static NTSTATUS skel_brl_lock_windows(struct vfs_handle_struct *handle,
596                                       struct byte_range_lock *br_lck,
597                                       struct lock_struct *plock,
598                                       bool blocking_lock)
599 {
600         return NT_STATUS_NOT_IMPLEMENTED;
601 }
602
603 static bool skel_brl_unlock_windows(struct vfs_handle_struct *handle,
604                                     struct messaging_context *msg_ctx,
605                                     struct byte_range_lock *br_lck,
606                                     const struct lock_struct *plock)
607 {
608         errno = ENOSYS;
609         return false;
610 }
611
612 static bool skel_brl_cancel_windows(struct vfs_handle_struct *handle,
613                                     struct byte_range_lock *br_lck,
614                                     struct lock_struct *plock)
615 {
616         errno = ENOSYS;
617         return false;
618 }
619
620 static bool skel_strict_lock(struct vfs_handle_struct *handle,
621                              struct files_struct *fsp,
622                              struct lock_struct *plock)
623 {
624         errno = ENOSYS;
625         return false;
626 }
627
628 static void skel_strict_unlock(struct vfs_handle_struct *handle,
629                                struct files_struct *fsp,
630                                struct lock_struct *plock)
631 {
632         ;
633 }
634
635 static NTSTATUS skel_translate_name(struct vfs_handle_struct *handle,
636                                     const char *mapped_name,
637                                     enum vfs_translate_direction direction,
638                                     TALLOC_CTX *mem_ctx, char **pmapped_name)
639 {
640         return NT_STATUS_NOT_IMPLEMENTED;
641 }
642
643 static NTSTATUS skel_fsctl(struct vfs_handle_struct *handle,
644                            struct files_struct *fsp,
645                            TALLOC_CTX *ctx,
646                            uint32_t function,
647                            uint16_t req_flags,  /* Needed for UNICODE ... */
648                            const uint8_t *_in_data,
649                            uint32_t in_len,
650                            uint8_t **_out_data,
651                            uint32_t max_out_len, uint32_t *out_len)
652 {
653         return NT_STATUS_NOT_IMPLEMENTED;
654 }
655
656 static NTSTATUS skel_readdir_attr(struct vfs_handle_struct *handle,
657                                   const struct smb_filename *fname,
658                                   TALLOC_CTX *mem_ctx,
659                                   struct readdir_attr_data **pattr_data)
660 {
661         return NT_STATUS_NOT_IMPLEMENTED;
662 }
663
664 static NTSTATUS skel_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
665                                  uint32_t security_info,
666                                  TALLOC_CTX *mem_ctx,
667                                  struct security_descriptor **ppdesc)
668 {
669         return NT_STATUS_NOT_IMPLEMENTED;
670 }
671
672 static NTSTATUS skel_get_nt_acl(vfs_handle_struct *handle,
673                                 const struct smb_filename *smb_fname,
674                                 uint32_t security_info,
675                                 TALLOC_CTX *mem_ctx,
676                                 struct security_descriptor **ppdesc)
677 {
678         return NT_STATUS_NOT_IMPLEMENTED;
679 }
680
681 static NTSTATUS skel_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
682                                  uint32_t security_info_sent,
683                                  const struct security_descriptor *psd)
684 {
685         return NT_STATUS_NOT_IMPLEMENTED;
686 }
687
688 static int skel_chmod_acl(vfs_handle_struct *handle, const char *name,
689                           mode_t mode)
690 {
691         errno = ENOSYS;
692         return -1;
693 }
694
695 static int skel_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp,
696                            mode_t mode)
697 {
698         errno = ENOSYS;
699         return -1;
700 }
701
702 static SMB_ACL_T skel_sys_acl_get_file(vfs_handle_struct *handle,
703                                        const char *path_p,
704                                        SMB_ACL_TYPE_T type,
705                                        TALLOC_CTX *mem_ctx)
706 {
707         errno = ENOSYS;
708         return (SMB_ACL_T) NULL;
709 }
710
711 static SMB_ACL_T skel_sys_acl_get_fd(vfs_handle_struct *handle,
712                                      files_struct *fsp, TALLOC_CTX *mem_ctx)
713 {
714         errno = ENOSYS;
715         return (SMB_ACL_T) NULL;
716 }
717
718 static int skel_sys_acl_blob_get_file(vfs_handle_struct *handle,
719                                       const char *path_p, TALLOC_CTX *mem_ctx,
720                                       char **blob_description, DATA_BLOB *blob)
721 {
722         errno = ENOSYS;
723         return -1;
724 }
725
726 static int skel_sys_acl_blob_get_fd(vfs_handle_struct *handle,
727                                     files_struct *fsp, TALLOC_CTX *mem_ctx,
728                                     char **blob_description, DATA_BLOB *blob)
729 {
730         errno = ENOSYS;
731         return -1;
732 }
733
734 static int skel_sys_acl_set_file(vfs_handle_struct *handle, const char *name,
735                                  SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl)
736 {
737         errno = ENOSYS;
738         return -1;
739 }
740
741 static int skel_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,
742                                SMB_ACL_T theacl)
743 {
744         errno = ENOSYS;
745         return -1;
746 }
747
748 static int skel_sys_acl_delete_def_file(vfs_handle_struct *handle,
749                                         const char *path)
750 {
751         errno = ENOSYS;
752         return -1;
753 }
754
755 static ssize_t skel_getxattr(vfs_handle_struct *handle, const char *path,
756                              const char *name, void *value, size_t size)
757 {
758         errno = ENOSYS;
759         return -1;
760 }
761
762 static ssize_t skel_fgetxattr(vfs_handle_struct *handle,
763                               struct files_struct *fsp, const char *name,
764                               void *value, size_t size)
765 {
766         errno = ENOSYS;
767         return -1;
768 }
769
770 static ssize_t skel_listxattr(vfs_handle_struct *handle, const char *path,
771                               char *list, size_t size)
772 {
773         errno = ENOSYS;
774         return -1;
775 }
776
777 static ssize_t skel_flistxattr(vfs_handle_struct *handle,
778                                struct files_struct *fsp, char *list,
779                                size_t size)
780 {
781         errno = ENOSYS;
782         return -1;
783 }
784
785 static int skel_removexattr(vfs_handle_struct *handle, const char *path,
786                             const char *name)
787 {
788         errno = ENOSYS;
789         return -1;
790 }
791
792 static int skel_fremovexattr(vfs_handle_struct *handle,
793                              struct files_struct *fsp, const char *name)
794 {
795         errno = ENOSYS;
796         return -1;
797         return SMB_VFS_NEXT_FREMOVEXATTR(handle, fsp, name);
798 }
799
800 static int skel_setxattr(vfs_handle_struct *handle, const char *path,
801                          const char *name, const void *value, size_t size,
802                          int flags)
803 {
804         errno = ENOSYS;
805         return -1;
806 }
807
808 static int skel_fsetxattr(vfs_handle_struct *handle, struct files_struct *fsp,
809                           const char *name, const void *value, size_t size,
810                           int flags)
811 {
812         errno = ENOSYS;
813         return -1;
814 }
815
816 static bool skel_aio_force(struct vfs_handle_struct *handle,
817                            struct files_struct *fsp)
818 {
819         errno = ENOSYS;
820         return false;
821 }
822
823 static bool skel_is_offline(struct vfs_handle_struct *handle,
824                             const struct smb_filename *fname,
825                             SMB_STRUCT_STAT *sbuf)
826 {
827         errno = ENOSYS;
828         return false;
829 }
830
831 static int skel_set_offline(struct vfs_handle_struct *handle,
832                             const struct smb_filename *fname)
833 {
834         errno = ENOSYS;
835         return -1;
836 }
837
838 /* VFS operations structure */
839
840 struct vfs_fn_pointers skel_opaque_fns = {
841         /* Disk operations */
842
843         .connect_fn = skel_connect,
844         .disconnect_fn = skel_disconnect,
845         .disk_free_fn = skel_disk_free,
846         .get_quota_fn = skel_get_quota,
847         .set_quota_fn = skel_set_quota,
848         .get_shadow_copy_data_fn = skel_get_shadow_copy_data,
849         .statvfs_fn = skel_statvfs,
850         .fs_capabilities_fn = skel_fs_capabilities,
851         .get_dfs_referrals_fn = skel_get_dfs_referrals,
852         .snap_check_path_fn = skel_snap_check_path,
853         .snap_create_fn = skel_snap_create,
854         .snap_delete_fn = skel_snap_delete,
855
856         /* Directory operations */
857
858         .opendir_fn = skel_opendir,
859         .fdopendir_fn = skel_fdopendir,
860         .readdir_fn = skel_readdir,
861         .seekdir_fn = skel_seekdir,
862         .telldir_fn = skel_telldir,
863         .rewind_dir_fn = skel_rewind_dir,
864         .mkdir_fn = skel_mkdir,
865         .rmdir_fn = skel_rmdir,
866         .closedir_fn = skel_closedir,
867         .init_search_op_fn = skel_init_search_op,
868
869         /* File operations */
870
871         .open_fn = skel_open,
872         .create_file_fn = skel_create_file,
873         .close_fn = skel_close_fn,
874         .read_fn = skel_vfs_read,
875         .pread_fn = skel_pread,
876         .pread_send_fn = skel_pread_send,
877         .pread_recv_fn = skel_pread_recv,
878         .write_fn = skel_write,
879         .pwrite_fn = skel_pwrite,
880         .pwrite_send_fn = skel_pwrite_send,
881         .pwrite_recv_fn = skel_pwrite_recv,
882         .lseek_fn = skel_lseek,
883         .sendfile_fn = skel_sendfile,
884         .recvfile_fn = skel_recvfile,
885         .rename_fn = skel_rename,
886         .fsync_fn = skel_fsync,
887         .fsync_send_fn = skel_fsync_send,
888         .fsync_recv_fn = skel_fsync_recv,
889         .stat_fn = skel_stat,
890         .fstat_fn = skel_fstat,
891         .lstat_fn = skel_lstat,
892         .get_alloc_size_fn = skel_get_alloc_size,
893         .unlink_fn = skel_unlink,
894         .chmod_fn = skel_chmod,
895         .fchmod_fn = skel_fchmod,
896         .chown_fn = skel_chown,
897         .fchown_fn = skel_fchown,
898         .lchown_fn = skel_lchown,
899         .chdir_fn = skel_chdir,
900         .getwd_fn = skel_getwd,
901         .ntimes_fn = skel_ntimes,
902         .ftruncate_fn = skel_ftruncate,
903         .fallocate_fn = skel_fallocate,
904         .lock_fn = skel_lock,
905         .kernel_flock_fn = skel_kernel_flock,
906         .linux_setlease_fn = skel_linux_setlease,
907         .getlock_fn = skel_getlock,
908         .symlink_fn = skel_symlink,
909         .readlink_fn = skel_vfs_readlink,
910         .link_fn = skel_link,
911         .mknod_fn = skel_mknod,
912         .realpath_fn = skel_realpath,
913         .chflags_fn = skel_chflags,
914         .file_id_create_fn = skel_file_id_create,
915         .copy_chunk_send_fn = skel_copy_chunk_send,
916         .copy_chunk_recv_fn = skel_copy_chunk_recv,
917         .get_compression_fn = skel_get_compression,
918         .set_compression_fn = skel_set_compression,
919
920         .streaminfo_fn = skel_streaminfo,
921         .get_real_filename_fn = skel_get_real_filename,
922         .connectpath_fn = skel_connectpath,
923         .brl_lock_windows_fn = skel_brl_lock_windows,
924         .brl_unlock_windows_fn = skel_brl_unlock_windows,
925         .brl_cancel_windows_fn = skel_brl_cancel_windows,
926         .strict_lock_fn = skel_strict_lock,
927         .strict_unlock_fn = skel_strict_unlock,
928         .translate_name_fn = skel_translate_name,
929         .fsctl_fn = skel_fsctl,
930         .readdir_attr_fn = skel_readdir_attr,
931
932         /* NT ACL operations. */
933
934         .fget_nt_acl_fn = skel_fget_nt_acl,
935         .get_nt_acl_fn = skel_get_nt_acl,
936         .fset_nt_acl_fn = skel_fset_nt_acl,
937
938         /* POSIX ACL operations. */
939
940         .chmod_acl_fn = skel_chmod_acl,
941         .fchmod_acl_fn = skel_fchmod_acl,
942
943         .sys_acl_get_file_fn = skel_sys_acl_get_file,
944         .sys_acl_get_fd_fn = skel_sys_acl_get_fd,
945         .sys_acl_blob_get_file_fn = skel_sys_acl_blob_get_file,
946         .sys_acl_blob_get_fd_fn = skel_sys_acl_blob_get_fd,
947         .sys_acl_set_file_fn = skel_sys_acl_set_file,
948         .sys_acl_set_fd_fn = skel_sys_acl_set_fd,
949         .sys_acl_delete_def_file_fn = skel_sys_acl_delete_def_file,
950
951         /* EA operations. */
952         .getxattr_fn = skel_getxattr,
953         .fgetxattr_fn = skel_fgetxattr,
954         .listxattr_fn = skel_listxattr,
955         .flistxattr_fn = skel_flistxattr,
956         .removexattr_fn = skel_removexattr,
957         .fremovexattr_fn = skel_fremovexattr,
958         .setxattr_fn = skel_setxattr,
959         .fsetxattr_fn = skel_fsetxattr,
960
961         /* aio operations */
962         .aio_force_fn = skel_aio_force,
963
964         /* offline operations */
965         .is_offline_fn = skel_is_offline,
966         .set_offline_fn = skel_set_offline
967 };
968
969 static_decl_vfs;
970 NTSTATUS vfs_skel_opaque_init(void)
971 {
972         return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "skel_opaque",
973                                 &skel_opaque_fns);
974 }