s3/smbd: remove unneeded flags argument from SMB_VFS_OFFLOAD_WRITE_SEND
[nivanova/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,
48                                 const struct smb_filename *smb_fname,
49                                 uint64_t *bsize,
50                                 uint64_t *dfree,
51                                 uint64_t *dsize)
52 {
53         *bsize = 0;
54         *dfree = 0;
55         *dsize = 0;
56         return 0;
57 }
58
59 static int skel_get_quota(vfs_handle_struct *handle,
60                                 const struct smb_filename *smb_fname,
61                                 enum SMB_QUOTA_TYPE qtype,
62                                 unid_t id,
63                                 SMB_DISK_QUOTA *dq)
64 {
65         errno = ENOSYS;
66         return -1;
67 }
68
69 static int skel_set_quota(vfs_handle_struct *handle, enum SMB_QUOTA_TYPE qtype,
70                           unid_t id, SMB_DISK_QUOTA *dq)
71 {
72         errno = ENOSYS;
73         return -1;
74 }
75
76 static int skel_get_shadow_copy_data(vfs_handle_struct *handle,
77                                      files_struct *fsp,
78                                      struct shadow_copy_data *shadow_copy_data,
79                                      bool labels)
80 {
81         errno = ENOSYS;
82         return -1;
83 }
84
85 static int skel_statvfs(struct vfs_handle_struct *handle,
86                                 const struct smb_filename *smb_fname,
87                                 struct vfs_statvfs_struct *statbuf)
88 {
89         errno = ENOSYS;
90         return -1;
91 }
92
93 static uint32_t skel_fs_capabilities(struct vfs_handle_struct *handle,
94                                      enum timestamp_set_resolution *p_ts_res)
95 {
96         return 0;
97 }
98
99 static NTSTATUS skel_get_dfs_referrals(struct vfs_handle_struct *handle,
100                                        struct dfs_GetDFSReferral *r)
101 {
102         return NT_STATUS_NOT_IMPLEMENTED;
103 }
104
105 static DIR *skel_opendir(vfs_handle_struct *handle,
106                         const struct smb_filename *smb_fname,
107                         const char *mask,
108                         uint32_t attr)
109 {
110         return NULL;
111 }
112
113 static NTSTATUS skel_snap_check_path(struct vfs_handle_struct *handle,
114                                      TALLOC_CTX *mem_ctx,
115                                      const char *service_path,
116                                      char **base_volume)
117 {
118         return NT_STATUS_NOT_SUPPORTED;
119 }
120
121 static NTSTATUS skel_snap_create(struct vfs_handle_struct *handle,
122                                  TALLOC_CTX *mem_ctx,
123                                  const char *base_volume,
124                                  time_t *tstamp,
125                                  bool rw,
126                                  char **base_path,
127                                  char **snap_path)
128 {
129         return NT_STATUS_NOT_SUPPORTED;
130 }
131
132 static NTSTATUS skel_snap_delete(struct vfs_handle_struct *handle,
133                                  TALLOC_CTX *mem_ctx,
134                                  char *base_path,
135                                  char *snap_path)
136 {
137         return NT_STATUS_NOT_SUPPORTED;
138 }
139
140 static DIR *skel_fdopendir(vfs_handle_struct *handle, files_struct *fsp,
141                            const char *mask, uint32_t attr)
142 {
143         return NULL;
144 }
145
146 static struct dirent *skel_readdir(vfs_handle_struct *handle,
147                                    DIR *dirp, SMB_STRUCT_STAT *sbuf)
148 {
149         return NULL;
150 }
151
152 static void skel_seekdir(vfs_handle_struct *handle, DIR *dirp, long offset)
153 {
154         ;
155 }
156
157 static long skel_telldir(vfs_handle_struct *handle, DIR *dirp)
158 {
159         return (long)-1;
160 }
161
162 static void skel_rewind_dir(vfs_handle_struct *handle, DIR *dirp)
163 {
164         ;
165 }
166
167 static int skel_mkdir(vfs_handle_struct *handle,
168                 const struct smb_filename *smb_fname,
169                 mode_t mode)
170 {
171         errno = ENOSYS;
172         return -1;
173 }
174
175 static int skel_rmdir(vfs_handle_struct *handle,
176                 const struct smb_filename *smb_fname)
177 {
178         errno = ENOSYS;
179         return -1;
180 }
181
182 static int skel_closedir(vfs_handle_struct *handle, DIR *dir)
183 {
184         errno = ENOSYS;
185         return -1;
186 }
187
188 static void skel_init_search_op(struct vfs_handle_struct *handle, DIR *dirp)
189 {
190         ;
191 }
192
193 static int skel_open(vfs_handle_struct *handle, struct smb_filename *smb_fname,
194                      files_struct *fsp, int flags, mode_t mode)
195 {
196         errno = ENOSYS;
197         return -1;
198 }
199
200 static NTSTATUS skel_create_file(struct vfs_handle_struct *handle,
201                                  struct smb_request *req,
202                                  uint16_t root_dir_fid,
203                                  struct smb_filename *smb_fname,
204                                  uint32_t access_mask,
205                                  uint32_t share_access,
206                                  uint32_t create_disposition,
207                                  uint32_t create_options,
208                                  uint32_t file_attributes,
209                                  uint32_t oplock_request,
210                                  struct smb2_lease *lease,
211                                  uint64_t allocation_size,
212                                  uint32_t private_flags,
213                                  struct security_descriptor *sd,
214                                  struct ea_list *ea_list,
215                                  files_struct **result, int *pinfo,
216                                  const struct smb2_create_blobs *in_context_blobs,
217                                  struct smb2_create_blobs *out_context_blobs)
218 {
219         return NT_STATUS_NOT_IMPLEMENTED;
220 }
221
222 static int skel_close_fn(vfs_handle_struct *handle, files_struct *fsp)
223 {
224         errno = ENOSYS;
225         return -1;
226 }
227
228 static ssize_t skel_vfs_read(vfs_handle_struct *handle, files_struct *fsp,
229                              void *data, size_t n)
230 {
231         errno = ENOSYS;
232         return -1;
233 }
234
235 static ssize_t skel_pread(vfs_handle_struct *handle, files_struct *fsp,
236                           void *data, size_t n, off_t offset)
237 {
238         errno = ENOSYS;
239         return -1;
240 }
241
242 static struct tevent_req *skel_pread_send(struct vfs_handle_struct *handle,
243                                           TALLOC_CTX *mem_ctx,
244                                           struct tevent_context *ev,
245                                           struct files_struct *fsp,
246                                           void *data, size_t n, off_t offset)
247 {
248         return NULL;
249 }
250
251 static ssize_t skel_pread_recv(struct tevent_req *req,
252                                struct vfs_aio_state *vfs_aio_state)
253 {
254         vfs_aio_state->error = ENOSYS;
255         return -1;
256 }
257
258 static ssize_t skel_write(vfs_handle_struct *handle, files_struct *fsp,
259                           const void *data, size_t n)
260 {
261         errno = ENOSYS;
262         return -1;
263 }
264
265 static ssize_t skel_pwrite(vfs_handle_struct *handle, files_struct *fsp,
266                            const void *data, size_t n, off_t offset)
267 {
268         errno = ENOSYS;
269         return -1;
270 }
271
272 static struct tevent_req *skel_pwrite_send(struct vfs_handle_struct *handle,
273                                            TALLOC_CTX *mem_ctx,
274                                            struct tevent_context *ev,
275                                            struct files_struct *fsp,
276                                            const void *data,
277                                            size_t n, off_t offset)
278 {
279         return NULL;
280 }
281
282 static ssize_t skel_pwrite_recv(struct tevent_req *req,
283                                 struct vfs_aio_state *vfs_aio_state)
284 {
285         vfs_aio_state->error = ENOSYS;
286         return -1;
287 }
288
289 static off_t skel_lseek(vfs_handle_struct *handle, files_struct *fsp,
290                         off_t offset, int whence)
291 {
292         errno = ENOSYS;
293         return (off_t) - 1;
294 }
295
296 static ssize_t skel_sendfile(vfs_handle_struct *handle, int tofd,
297                              files_struct *fromfsp, const DATA_BLOB *hdr,
298                              off_t offset, size_t n)
299 {
300         errno = ENOSYS;
301         return -1;
302 }
303
304 static ssize_t skel_recvfile(vfs_handle_struct *handle, int fromfd,
305                              files_struct *tofsp, off_t offset, size_t n)
306 {
307         errno = ENOSYS;
308         return -1;
309 }
310
311 static int skel_rename(vfs_handle_struct *handle,
312                        const struct smb_filename *smb_fname_src,
313                        const struct smb_filename *smb_fname_dst)
314 {
315         errno = ENOSYS;
316         return -1;
317 }
318
319 static int skel_fsync(vfs_handle_struct *handle, files_struct *fsp)
320 {
321         errno = ENOSYS;
322         return -1;
323 }
324
325 static struct tevent_req *skel_fsync_send(struct vfs_handle_struct *handle,
326                                           TALLOC_CTX *mem_ctx,
327                                           struct tevent_context *ev,
328                                           struct files_struct *fsp)
329 {
330         return NULL;
331 }
332
333 static int skel_fsync_recv(struct tevent_req *req,
334                            struct vfs_aio_state *vfs_aio_state)
335 {
336         vfs_aio_state->error = ENOSYS;
337         return -1;
338 }
339
340 static int skel_stat(vfs_handle_struct *handle, struct smb_filename *smb_fname)
341 {
342         errno = ENOSYS;
343         return -1;
344 }
345
346 static int skel_fstat(vfs_handle_struct *handle, files_struct *fsp,
347                       SMB_STRUCT_STAT *sbuf)
348 {
349         errno = ENOSYS;
350         return -1;
351 }
352
353 static int skel_lstat(vfs_handle_struct *handle,
354                       struct smb_filename *smb_fname)
355 {
356         errno = ENOSYS;
357         return -1;
358 }
359
360 static uint64_t skel_get_alloc_size(struct vfs_handle_struct *handle,
361                                     struct files_struct *fsp,
362                                     const SMB_STRUCT_STAT *sbuf)
363 {
364         errno = ENOSYS;
365         return -1;
366 }
367
368 static int skel_unlink(vfs_handle_struct *handle,
369                        const struct smb_filename *smb_fname)
370 {
371         errno = ENOSYS;
372         return -1;
373 }
374
375 static int skel_chmod(vfs_handle_struct *handle,
376                         const struct smb_filename *smb_fname,
377                         mode_t mode)
378 {
379         errno = ENOSYS;
380         return -1;
381 }
382
383 static int skel_fchmod(vfs_handle_struct *handle, files_struct *fsp,
384                        mode_t mode)
385 {
386         errno = ENOSYS;
387         return -1;
388 }
389
390 static int skel_chown(vfs_handle_struct *handle,
391                         const struct smb_filename *smb_fname,
392                         uid_t uid,
393                         gid_t gid)
394 {
395         errno = ENOSYS;
396         return -1;
397 }
398
399 static int skel_fchown(vfs_handle_struct *handle, files_struct *fsp,
400                        uid_t uid, gid_t gid)
401 {
402         errno = ENOSYS;
403         return -1;
404 }
405
406 static int skel_lchown(vfs_handle_struct *handle,
407                         const struct smb_filename *smb_fname,
408                         uid_t uid,
409                         gid_t gid)
410 {
411         errno = ENOSYS;
412         return -1;
413 }
414
415 static int skel_chdir(vfs_handle_struct *handle,
416                         const struct smb_filename *smb_fname)
417 {
418         errno = ENOSYS;
419         return -1;
420 }
421
422 static struct smb_filename *skel_getwd(vfs_handle_struct *handle,
423                                 TALLOC_CTX *ctx)
424 {
425         errno = ENOSYS;
426         return NULL;
427 }
428
429 static int skel_ntimes(vfs_handle_struct *handle,
430                        const struct smb_filename *smb_fname,
431                        struct smb_file_time *ft)
432 {
433         errno = ENOSYS;
434         return -1;
435 }
436
437 static int skel_ftruncate(vfs_handle_struct *handle, files_struct *fsp,
438                           off_t offset)
439 {
440         errno = ENOSYS;
441         return -1;
442 }
443
444 static int skel_fallocate(vfs_handle_struct *handle, files_struct *fsp,
445                           uint32_t mode, off_t offset, off_t len)
446 {
447         errno = ENOSYS;
448         return -1;
449 }
450
451 static bool skel_lock(vfs_handle_struct *handle, files_struct *fsp, int op,
452                       off_t offset, off_t count, int type)
453 {
454         errno = ENOSYS;
455         return false;
456 }
457
458 static int skel_kernel_flock(struct vfs_handle_struct *handle,
459                              struct files_struct *fsp,
460                              uint32_t share_mode, uint32_t access_mask)
461 {
462         errno = ENOSYS;
463         return -1;
464 }
465
466 static int skel_linux_setlease(struct vfs_handle_struct *handle,
467                                struct files_struct *fsp, int leasetype)
468 {
469         errno = ENOSYS;
470         return -1;
471 }
472
473 static bool skel_getlock(vfs_handle_struct *handle, files_struct *fsp,
474                          off_t *poffset, off_t *pcount, int *ptype,
475                          pid_t *ppid)
476 {
477         errno = ENOSYS;
478         return false;
479 }
480
481 static int skel_symlink(vfs_handle_struct *handle,
482                         const char *link_contents,
483                         const struct smb_filename *new_smb_fname)
484 {
485         errno = ENOSYS;
486         return -1;
487 }
488
489 static int skel_vfs_readlink(vfs_handle_struct *handle,
490                         const struct smb_filename *smb_fname,
491                         char *buf,
492                         size_t bufsiz)
493 {
494         errno = ENOSYS;
495         return -1;
496 }
497
498 static int skel_link(vfs_handle_struct *handle,
499                         const struct smb_filename *old_smb_fname,
500                         const struct smb_filename *new_smb_fname)
501 {
502         errno = ENOSYS;
503         return -1;
504 }
505
506 static int skel_mknod(vfs_handle_struct *handle,
507                         const struct smb_filename *smb_fname,
508                         mode_t mode,
509                         SMB_DEV_T dev)
510 {
511         errno = ENOSYS;
512         return -1;
513 }
514
515 static struct smb_filename *skel_realpath(vfs_handle_struct *handle,
516                         TALLOC_CTX *ctx,
517                         const struct smb_filename *smb_fname)
518 {
519         errno = ENOSYS;
520         return NULL;
521 }
522
523 static int skel_chflags(vfs_handle_struct *handle,
524                         const struct smb_filename *smb_fname,
525                         uint flags)
526 {
527         errno = ENOSYS;
528         return -1;
529 }
530
531 static struct file_id skel_file_id_create(vfs_handle_struct *handle,
532                                           const SMB_STRUCT_STAT *sbuf)
533 {
534         struct file_id id;
535         ZERO_STRUCT(id);
536         errno = ENOSYS;
537         return id;
538 }
539
540 struct skel_offload_read_state {
541         bool dummy;
542 };
543
544 static struct tevent_req *skel_offload_read_send(
545         TALLOC_CTX *mem_ctx,
546         struct tevent_context *ev,
547         struct vfs_handle_struct *handle,
548         struct files_struct *fsp,
549         uint32_t fsctl,
550         uint32_t ttl,
551         off_t offset,
552         size_t to_copy)
553 {
554         struct tevent_req *req = NULL;
555         struct skel_offload_read_state *state = NULL;
556
557         req = tevent_req_create(mem_ctx, &state, struct skel_offload_read_state);
558         if (req == NULL) {
559                 return NULL;
560         }
561
562         tevent_req_nterror(req, NT_STATUS_NOT_IMPLEMENTED);
563         return tevent_req_post(req, ev);
564 }
565
566 static NTSTATUS skel_offload_read_recv(struct tevent_req *req,
567                                        struct vfs_handle_struct *handle,
568                                        TALLOC_CTX *mem_ctx,
569                                        DATA_BLOB *_token_blob)
570 {
571         NTSTATUS status;
572
573         if (tevent_req_is_nterror(req, &status)) {
574                 tevent_req_received(req);
575                 return status;
576         }
577         tevent_req_received(req);
578
579         return NT_STATUS_OK;
580 }
581
582 struct skel_cc_state {
583         uint64_t unused;
584 };
585 static struct tevent_req *skel_offload_write_send(struct vfs_handle_struct *handle,
586                                                TALLOC_CTX *mem_ctx,
587                                                struct tevent_context *ev,
588                                                uint32_t fsctl,
589                                                DATA_BLOB *token,
590                                                off_t transfer_offset,
591                                                struct files_struct *dest_fsp,
592                                                off_t dest_off,
593                                                off_t num)
594 {
595         struct tevent_req *req;
596         struct skel_cc_state *cc_state;
597
598         req = tevent_req_create(mem_ctx, &cc_state, struct skel_cc_state);
599         if (req == NULL) {
600                 return NULL;
601         }
602
603         tevent_req_nterror(req, NT_STATUS_NOT_IMPLEMENTED);
604         return tevent_req_post(req, ev);
605 }
606
607 static NTSTATUS skel_offload_write_recv(struct vfs_handle_struct *handle,
608                                      struct tevent_req *req,
609                                      off_t *copied)
610 {
611         NTSTATUS status;
612
613         if (tevent_req_is_nterror(req, &status)) {
614                 tevent_req_received(req);
615                 return status;
616         }
617         tevent_req_received(req);
618
619         return NT_STATUS_OK;
620 }
621
622 static NTSTATUS skel_get_compression(struct vfs_handle_struct *handle,
623                                      TALLOC_CTX *mem_ctx,
624                                      struct files_struct *fsp,
625                                      struct smb_filename *smb_fname,
626                                      uint16_t *_compression_fmt)
627 {
628         return NT_STATUS_INVALID_DEVICE_REQUEST;
629 }
630
631 static NTSTATUS skel_set_compression(struct vfs_handle_struct *handle,
632                                      TALLOC_CTX *mem_ctx,
633                                      struct files_struct *fsp,
634                                      uint16_t compression_fmt)
635 {
636         return NT_STATUS_INVALID_DEVICE_REQUEST;
637 }
638
639 static NTSTATUS skel_streaminfo(struct vfs_handle_struct *handle,
640                                 struct files_struct *fsp,
641                                 const struct smb_filename *smb_fname,
642                                 TALLOC_CTX *mem_ctx,
643                                 unsigned int *num_streams,
644                                 struct stream_struct **streams)
645 {
646         return NT_STATUS_NOT_IMPLEMENTED;
647 }
648
649 static int skel_get_real_filename(struct vfs_handle_struct *handle,
650                                   const char *path,
651                                   const char *name,
652                                   TALLOC_CTX *mem_ctx, char **found_name)
653 {
654         errno = ENOSYS;
655         return -1;
656 }
657
658 static const char *skel_connectpath(struct vfs_handle_struct *handle,
659                                 const struct smb_filename *smb_fname)
660 {
661         errno = ENOSYS;
662         return NULL;
663 }
664
665 static NTSTATUS skel_brl_lock_windows(struct vfs_handle_struct *handle,
666                                       struct byte_range_lock *br_lck,
667                                       struct lock_struct *plock,
668                                       bool blocking_lock)
669 {
670         return NT_STATUS_NOT_IMPLEMENTED;
671 }
672
673 static bool skel_brl_unlock_windows(struct vfs_handle_struct *handle,
674                                     struct messaging_context *msg_ctx,
675                                     struct byte_range_lock *br_lck,
676                                     const struct lock_struct *plock)
677 {
678         errno = ENOSYS;
679         return false;
680 }
681
682 static bool skel_brl_cancel_windows(struct vfs_handle_struct *handle,
683                                     struct byte_range_lock *br_lck,
684                                     struct lock_struct *plock)
685 {
686         errno = ENOSYS;
687         return false;
688 }
689
690 static bool skel_strict_lock(struct vfs_handle_struct *handle,
691                              struct files_struct *fsp,
692                              struct lock_struct *plock)
693 {
694         errno = ENOSYS;
695         return false;
696 }
697
698 static void skel_strict_unlock(struct vfs_handle_struct *handle,
699                                struct files_struct *fsp,
700                                struct lock_struct *plock)
701 {
702         ;
703 }
704
705 static NTSTATUS skel_translate_name(struct vfs_handle_struct *handle,
706                                     const char *mapped_name,
707                                     enum vfs_translate_direction direction,
708                                     TALLOC_CTX *mem_ctx, char **pmapped_name)
709 {
710         return NT_STATUS_NOT_IMPLEMENTED;
711 }
712
713 static NTSTATUS skel_fsctl(struct vfs_handle_struct *handle,
714                            struct files_struct *fsp,
715                            TALLOC_CTX *ctx,
716                            uint32_t function,
717                            uint16_t req_flags,  /* Needed for UNICODE ... */
718                            const uint8_t *_in_data,
719                            uint32_t in_len,
720                            uint8_t **_out_data,
721                            uint32_t max_out_len, uint32_t *out_len)
722 {
723         return NT_STATUS_NOT_IMPLEMENTED;
724 }
725
726 static NTSTATUS skel_readdir_attr(struct vfs_handle_struct *handle,
727                                   const struct smb_filename *fname,
728                                   TALLOC_CTX *mem_ctx,
729                                   struct readdir_attr_data **pattr_data)
730 {
731         return NT_STATUS_NOT_IMPLEMENTED;
732 }
733
734 static NTSTATUS skel_get_dos_attributes(struct vfs_handle_struct *handle,
735                                 struct smb_filename *smb_fname,
736                                 uint32_t *dosmode)
737 {
738         return NT_STATUS_NOT_IMPLEMENTED;
739 }
740
741 static NTSTATUS skel_fget_dos_attributes(struct vfs_handle_struct *handle,
742                                 struct files_struct *fsp,
743                                 uint32_t *dosmode)
744 {
745         return NT_STATUS_NOT_IMPLEMENTED;
746 }
747
748 static NTSTATUS skel_set_dos_attributes(struct vfs_handle_struct *handle,
749                                 const struct smb_filename *smb_fname,
750                                 uint32_t dosmode)
751 {
752         return NT_STATUS_NOT_IMPLEMENTED;
753 }
754
755 static NTSTATUS skel_fset_dos_attributes(struct vfs_handle_struct *handle,
756                                 struct files_struct *fsp,
757                                 uint32_t dosmode)
758 {
759         return NT_STATUS_NOT_IMPLEMENTED;
760 }
761
762 static NTSTATUS skel_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
763                                  uint32_t security_info,
764                                  TALLOC_CTX *mem_ctx,
765                                  struct security_descriptor **ppdesc)
766 {
767         return NT_STATUS_NOT_IMPLEMENTED;
768 }
769
770 static NTSTATUS skel_get_nt_acl(vfs_handle_struct *handle,
771                                 const struct smb_filename *smb_fname,
772                                 uint32_t security_info,
773                                 TALLOC_CTX *mem_ctx,
774                                 struct security_descriptor **ppdesc)
775 {
776         return NT_STATUS_NOT_IMPLEMENTED;
777 }
778
779 static NTSTATUS skel_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
780                                  uint32_t security_info_sent,
781                                  const struct security_descriptor *psd)
782 {
783         return NT_STATUS_NOT_IMPLEMENTED;
784 }
785
786 static int skel_chmod_acl(vfs_handle_struct *handle,
787                         const struct smb_filename *smb_fname,
788                         mode_t mode)
789 {
790         errno = ENOSYS;
791         return -1;
792 }
793
794 static int skel_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp,
795                            mode_t mode)
796 {
797         errno = ENOSYS;
798         return -1;
799 }
800
801 static SMB_ACL_T skel_sys_acl_get_file(vfs_handle_struct *handle,
802                                        const struct smb_filename *smb_fname,
803                                        SMB_ACL_TYPE_T type,
804                                        TALLOC_CTX *mem_ctx)
805 {
806         errno = ENOSYS;
807         return (SMB_ACL_T) NULL;
808 }
809
810 static SMB_ACL_T skel_sys_acl_get_fd(vfs_handle_struct *handle,
811                                      files_struct *fsp, TALLOC_CTX *mem_ctx)
812 {
813         errno = ENOSYS;
814         return (SMB_ACL_T) NULL;
815 }
816
817 static int skel_sys_acl_blob_get_file(vfs_handle_struct *handle,
818                                 const struct smb_filename *smb_fname,
819                                 TALLOC_CTX *mem_ctx,
820                                 char **blob_description,
821                                 DATA_BLOB *blob)
822 {
823         errno = ENOSYS;
824         return -1;
825 }
826
827 static int skel_sys_acl_blob_get_fd(vfs_handle_struct *handle,
828                                     files_struct *fsp, TALLOC_CTX *mem_ctx,
829                                     char **blob_description, DATA_BLOB *blob)
830 {
831         errno = ENOSYS;
832         return -1;
833 }
834
835 static int skel_sys_acl_set_file(vfs_handle_struct *handle,
836                                 const struct smb_filename *smb_fname,
837                                 SMB_ACL_TYPE_T acltype,
838                                 SMB_ACL_T theacl)
839 {
840         errno = ENOSYS;
841         return -1;
842 }
843
844 static int skel_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,
845                                SMB_ACL_T theacl)
846 {
847         errno = ENOSYS;
848         return -1;
849 }
850
851 static int skel_sys_acl_delete_def_file(vfs_handle_struct *handle,
852                                         const struct smb_filename *smb_fname)
853 {
854         errno = ENOSYS;
855         return -1;
856 }
857
858 static ssize_t skel_getxattr(vfs_handle_struct *handle,
859                                 const struct smb_filename *smb_fname,
860                                 const char *name,
861                                 void *value,
862                                 size_t size)
863 {
864         errno = ENOSYS;
865         return -1;
866 }
867
868 static ssize_t skel_fgetxattr(vfs_handle_struct *handle,
869                               struct files_struct *fsp, const char *name,
870                               void *value, size_t size)
871 {
872         errno = ENOSYS;
873         return -1;
874 }
875
876 static ssize_t skel_listxattr(vfs_handle_struct *handle,
877                                 const struct smb_filename *smb_fname,
878                                 char *list,
879                                 size_t size)
880 {
881         errno = ENOSYS;
882         return -1;
883 }
884
885 static ssize_t skel_flistxattr(vfs_handle_struct *handle,
886                                struct files_struct *fsp, char *list,
887                                size_t size)
888 {
889         errno = ENOSYS;
890         return -1;
891 }
892
893 static int skel_removexattr(vfs_handle_struct *handle,
894                         const struct smb_filename *smb_fname,
895                         const char *name)
896 {
897         errno = ENOSYS;
898         return -1;
899 }
900
901 static int skel_fremovexattr(vfs_handle_struct *handle,
902                              struct files_struct *fsp, const char *name)
903 {
904         errno = ENOSYS;
905         return -1;
906         return SMB_VFS_NEXT_FREMOVEXATTR(handle, fsp, name);
907 }
908
909 static int skel_setxattr(vfs_handle_struct *handle,
910                         const struct smb_filename *smb_fname,
911                         const char *name,
912                         const void *value,
913                         size_t size,
914                         int flags)
915 {
916         errno = ENOSYS;
917         return -1;
918 }
919
920 static int skel_fsetxattr(vfs_handle_struct *handle, struct files_struct *fsp,
921                           const char *name, const void *value, size_t size,
922                           int flags)
923 {
924         errno = ENOSYS;
925         return -1;
926 }
927
928 static bool skel_aio_force(struct vfs_handle_struct *handle,
929                            struct files_struct *fsp)
930 {
931         errno = ENOSYS;
932         return false;
933 }
934
935 /* VFS operations structure */
936
937 struct vfs_fn_pointers skel_opaque_fns = {
938         /* Disk operations */
939
940         .connect_fn = skel_connect,
941         .disconnect_fn = skel_disconnect,
942         .disk_free_fn = skel_disk_free,
943         .get_quota_fn = skel_get_quota,
944         .set_quota_fn = skel_set_quota,
945         .get_shadow_copy_data_fn = skel_get_shadow_copy_data,
946         .statvfs_fn = skel_statvfs,
947         .fs_capabilities_fn = skel_fs_capabilities,
948         .get_dfs_referrals_fn = skel_get_dfs_referrals,
949         .snap_check_path_fn = skel_snap_check_path,
950         .snap_create_fn = skel_snap_create,
951         .snap_delete_fn = skel_snap_delete,
952
953         /* Directory operations */
954
955         .opendir_fn = skel_opendir,
956         .fdopendir_fn = skel_fdopendir,
957         .readdir_fn = skel_readdir,
958         .seekdir_fn = skel_seekdir,
959         .telldir_fn = skel_telldir,
960         .rewind_dir_fn = skel_rewind_dir,
961         .mkdir_fn = skel_mkdir,
962         .rmdir_fn = skel_rmdir,
963         .closedir_fn = skel_closedir,
964         .init_search_op_fn = skel_init_search_op,
965
966         /* File operations */
967
968         .open_fn = skel_open,
969         .create_file_fn = skel_create_file,
970         .close_fn = skel_close_fn,
971         .read_fn = skel_vfs_read,
972         .pread_fn = skel_pread,
973         .pread_send_fn = skel_pread_send,
974         .pread_recv_fn = skel_pread_recv,
975         .write_fn = skel_write,
976         .pwrite_fn = skel_pwrite,
977         .pwrite_send_fn = skel_pwrite_send,
978         .pwrite_recv_fn = skel_pwrite_recv,
979         .lseek_fn = skel_lseek,
980         .sendfile_fn = skel_sendfile,
981         .recvfile_fn = skel_recvfile,
982         .rename_fn = skel_rename,
983         .fsync_fn = skel_fsync,
984         .fsync_send_fn = skel_fsync_send,
985         .fsync_recv_fn = skel_fsync_recv,
986         .stat_fn = skel_stat,
987         .fstat_fn = skel_fstat,
988         .lstat_fn = skel_lstat,
989         .get_alloc_size_fn = skel_get_alloc_size,
990         .unlink_fn = skel_unlink,
991         .chmod_fn = skel_chmod,
992         .fchmod_fn = skel_fchmod,
993         .chown_fn = skel_chown,
994         .fchown_fn = skel_fchown,
995         .lchown_fn = skel_lchown,
996         .chdir_fn = skel_chdir,
997         .getwd_fn = skel_getwd,
998         .ntimes_fn = skel_ntimes,
999         .ftruncate_fn = skel_ftruncate,
1000         .fallocate_fn = skel_fallocate,
1001         .lock_fn = skel_lock,
1002         .kernel_flock_fn = skel_kernel_flock,
1003         .linux_setlease_fn = skel_linux_setlease,
1004         .getlock_fn = skel_getlock,
1005         .symlink_fn = skel_symlink,
1006         .readlink_fn = skel_vfs_readlink,
1007         .link_fn = skel_link,
1008         .mknod_fn = skel_mknod,
1009         .realpath_fn = skel_realpath,
1010         .chflags_fn = skel_chflags,
1011         .file_id_create_fn = skel_file_id_create,
1012         .offload_read_send_fn = skel_offload_read_send,
1013         .offload_read_recv_fn = skel_offload_read_recv,
1014         .offload_write_send_fn = skel_offload_write_send,
1015         .offload_write_recv_fn = skel_offload_write_recv,
1016         .get_compression_fn = skel_get_compression,
1017         .set_compression_fn = skel_set_compression,
1018
1019         .streaminfo_fn = skel_streaminfo,
1020         .get_real_filename_fn = skel_get_real_filename,
1021         .connectpath_fn = skel_connectpath,
1022         .brl_lock_windows_fn = skel_brl_lock_windows,
1023         .brl_unlock_windows_fn = skel_brl_unlock_windows,
1024         .brl_cancel_windows_fn = skel_brl_cancel_windows,
1025         .strict_lock_fn = skel_strict_lock,
1026         .strict_unlock_fn = skel_strict_unlock,
1027         .translate_name_fn = skel_translate_name,
1028         .fsctl_fn = skel_fsctl,
1029         .readdir_attr_fn = skel_readdir_attr,
1030
1031         /* DOS attributes. */
1032         .get_dos_attributes_fn = skel_get_dos_attributes,
1033         .fget_dos_attributes_fn = skel_fget_dos_attributes,
1034         .set_dos_attributes_fn = skel_set_dos_attributes,
1035         .fset_dos_attributes_fn = skel_fset_dos_attributes,
1036
1037         /* NT ACL operations. */
1038
1039         .fget_nt_acl_fn = skel_fget_nt_acl,
1040         .get_nt_acl_fn = skel_get_nt_acl,
1041         .fset_nt_acl_fn = skel_fset_nt_acl,
1042
1043         /* POSIX ACL operations. */
1044
1045         .chmod_acl_fn = skel_chmod_acl,
1046         .fchmod_acl_fn = skel_fchmod_acl,
1047
1048         .sys_acl_get_file_fn = skel_sys_acl_get_file,
1049         .sys_acl_get_fd_fn = skel_sys_acl_get_fd,
1050         .sys_acl_blob_get_file_fn = skel_sys_acl_blob_get_file,
1051         .sys_acl_blob_get_fd_fn = skel_sys_acl_blob_get_fd,
1052         .sys_acl_set_file_fn = skel_sys_acl_set_file,
1053         .sys_acl_set_fd_fn = skel_sys_acl_set_fd,
1054         .sys_acl_delete_def_file_fn = skel_sys_acl_delete_def_file,
1055
1056         /* EA operations. */
1057         .getxattr_fn = skel_getxattr,
1058         .fgetxattr_fn = skel_fgetxattr,
1059         .listxattr_fn = skel_listxattr,
1060         .flistxattr_fn = skel_flistxattr,
1061         .removexattr_fn = skel_removexattr,
1062         .fremovexattr_fn = skel_fremovexattr,
1063         .setxattr_fn = skel_setxattr,
1064         .fsetxattr_fn = skel_fsetxattr,
1065
1066         /* aio operations */
1067         .aio_force_fn = skel_aio_force,
1068 };
1069
1070 static_decl_vfs;
1071 NTSTATUS vfs_skel_opaque_init(TALLOC_CTX *ctx)
1072 {
1073         return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "skel_opaque",
1074                                 &skel_opaque_fns);
1075 }