s3:libsmb: allow store_cldap_reply() to work with a ipv6 response
[samba.git] / source3 / modules / vfs_not_implemented.c
1 /*
2  * VFS module with "not implemented " helper functions for other modules.
3  *
4  * Copyright (C) Tim Potter, 1999-2000
5  * Copyright (C) Alexander Bokovoy, 2002
6  * Copyright (C) Stefan (metze) Metzmacher, 2003,2018
7  * Copyright (C) Jeremy Allison 2009
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 3 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, see <http://www.gnu.org/licenses/>.
21  */
22
23 #include "includes.h"
24 #include "lib/util/tevent_unix.h"
25 #include "lib/util/tevent_ntstatus.h"
26
27 _PUBLIC_
28 int vfs_not_implemented_connect(
29                         vfs_handle_struct *handle,
30                         const char *service,
31                         const char *user)
32 {
33         errno = ENOSYS;
34         return -1;
35 }
36
37 _PUBLIC_
38 void vfs_not_implemented_disconnect(vfs_handle_struct *handle)
39 {
40         ;
41 }
42
43 _PUBLIC_
44 uint64_t vfs_not_implemented_disk_free(vfs_handle_struct *handle,
45                                 const struct smb_filename *smb_fname,
46                                 uint64_t *bsize,
47                                 uint64_t *dfree,
48                                 uint64_t *dsize)
49 {
50         *bsize = 0;
51         *dfree = 0;
52         *dsize = 0;
53         return 0;
54 }
55
56 _PUBLIC_
57 int vfs_not_implemented_get_quota(vfs_handle_struct *handle,
58                                 const struct smb_filename *smb_fname,
59                                 enum SMB_QUOTA_TYPE qtype,
60                                 unid_t id,
61                                 SMB_DISK_QUOTA *dq)
62 {
63         errno = ENOSYS;
64         return -1;
65 }
66
67 _PUBLIC_
68 int vfs_not_implemented_set_quota(vfs_handle_struct *handle,
69                                   enum SMB_QUOTA_TYPE qtype,
70                                   unid_t id, SMB_DISK_QUOTA *dq)
71 {
72         errno = ENOSYS;
73         return -1;
74 }
75
76 _PUBLIC_
77 int vfs_not_implemented_get_shadow_copy_data(vfs_handle_struct *handle,
78                                 files_struct *fsp,
79                                 struct shadow_copy_data *shadow_copy_data,
80                                 bool labels)
81 {
82         errno = ENOSYS;
83         return -1;
84 }
85
86 _PUBLIC_
87 int vfs_not_implemented_statvfs(struct vfs_handle_struct *handle,
88                                 const struct smb_filename *smb_fname,
89                                 struct vfs_statvfs_struct *statbuf)
90 {
91         errno = ENOSYS;
92         return -1;
93 }
94
95 _PUBLIC_
96 uint32_t vfs_not_implemented_fs_capabilities(struct vfs_handle_struct *handle,
97                                 enum timestamp_set_resolution *p_ts_res)
98 {
99         return 0;
100 }
101
102 _PUBLIC_
103 NTSTATUS vfs_not_implemented_get_dfs_referrals(struct vfs_handle_struct *handle,
104                                                struct dfs_GetDFSReferral *r)
105 {
106         return NT_STATUS_NOT_IMPLEMENTED;
107 }
108
109 _PUBLIC_
110 NTSTATUS vfs_not_implemented_create_dfs_pathat(struct vfs_handle_struct *handle,
111                                 struct files_struct *dirfsp,
112                                 const struct smb_filename *smb_fname,
113                                 const struct referral *reflist,
114                                 size_t referral_count)
115 {
116         return NT_STATUS_NOT_IMPLEMENTED;
117 }
118
119 _PUBLIC_
120 NTSTATUS vfs_not_implemented_read_dfs_pathat(struct vfs_handle_struct *handle,
121                                 TALLOC_CTX *mem_ctx,
122                                 struct files_struct *dirfsp,
123                                 struct smb_filename *smb_fname,
124                                 struct referral **ppreflist,
125                                 size_t *preferral_count)
126 {
127         return NT_STATUS_NOT_IMPLEMENTED;
128 }
129
130 _PUBLIC_
131 NTSTATUS vfs_not_implemented_snap_check_path(struct vfs_handle_struct *handle,
132                                 TALLOC_CTX *mem_ctx,
133                                 const char *service_path,
134                                 char **base_volume)
135 {
136         return NT_STATUS_NOT_SUPPORTED;
137 }
138
139 _PUBLIC_
140 NTSTATUS vfs_not_implemented_snap_create(struct vfs_handle_struct *handle,
141                                          TALLOC_CTX *mem_ctx,
142                                          const char *base_volume,
143                                          time_t *tstamp,
144                                          bool rw,
145                                          char **base_path,
146                                          char **snap_path)
147 {
148         return NT_STATUS_NOT_SUPPORTED;
149 }
150
151 _PUBLIC_
152 NTSTATUS vfs_not_implemented_snap_delete(struct vfs_handle_struct *handle,
153                                          TALLOC_CTX *mem_ctx,
154                                          char *base_path,
155                                          char *snap_path)
156 {
157         return NT_STATUS_NOT_SUPPORTED;
158 }
159
160 _PUBLIC_
161 DIR *vfs_not_implemented_fdopendir(vfs_handle_struct *handle, files_struct *fsp,
162                                    const char *mask, uint32_t attr)
163 {
164         errno = ENOSYS;
165         return NULL;
166 }
167
168 _PUBLIC_
169 struct dirent *vfs_not_implemented_readdir(vfs_handle_struct *handle,
170                                            struct files_struct *dirfsp,
171                                            DIR *dirp)
172 {
173         errno = ENOSYS;
174         return NULL;
175 }
176
177 _PUBLIC_
178 void vfs_not_implemented_rewind_dir(vfs_handle_struct *handle, DIR *dirp)
179 {
180         ;
181 }
182
183 _PUBLIC_
184 int vfs_not_implemented_mkdirat(vfs_handle_struct *handle,
185                 struct files_struct *dirfsp,
186                 const struct smb_filename *smb_fname,
187                 mode_t mode)
188 {
189         errno = ENOSYS;
190         return -1;
191 }
192
193 _PUBLIC_
194 int vfs_not_implemented_closedir(vfs_handle_struct *handle, DIR *dir)
195 {
196         errno = ENOSYS;
197         return -1;
198 }
199
200 _PUBLIC_
201 int vfs_not_implemented_openat(vfs_handle_struct *handle,
202                                const struct files_struct *dirfsp,
203                                const struct smb_filename *smb_fname,
204                                struct files_struct *fsp,
205                                const struct vfs_open_how *how)
206 {
207         errno = ENOSYS;
208         return -1;
209 }
210
211 _PUBLIC_
212 NTSTATUS vfs_not_implemented_create_file(struct vfs_handle_struct *handle,
213                                 struct smb_request *req,
214                                 struct files_struct *dirsp,
215                                 struct smb_filename *smb_fname,
216                                 uint32_t access_mask,
217                                 uint32_t share_access,
218                                 uint32_t create_disposition,
219                                 uint32_t create_options,
220                                 uint32_t file_attributes,
221                                 uint32_t oplock_request,
222                                 const struct smb2_lease *lease,
223                                 uint64_t allocation_size,
224                                 uint32_t private_flags,
225                                 struct security_descriptor *sd,
226                                 struct ea_list *ea_list,
227                                 files_struct **result, int *pinfo,
228                                 const struct smb2_create_blobs *in_context_blobs,
229                                 struct smb2_create_blobs *out_context_blobs)
230 {
231         return NT_STATUS_NOT_IMPLEMENTED;
232 }
233
234 _PUBLIC_
235 int vfs_not_implemented_close_fn(vfs_handle_struct *handle, files_struct *fsp)
236 {
237         errno = ENOSYS;
238         return -1;
239 }
240
241 _PUBLIC_
242 ssize_t vfs_not_implemented_pread(vfs_handle_struct *handle, files_struct *fsp,
243                                   void *data, size_t n, off_t offset)
244 {
245         errno = ENOSYS;
246         return -1;
247 }
248
249 _PUBLIC_
250 struct tevent_req *vfs_not_implemented_pread_send(struct vfs_handle_struct *handle,
251                                                   TALLOC_CTX *mem_ctx,
252                                                   struct tevent_context *ev,
253                                                   struct files_struct *fsp,
254                                                   void *data, size_t n, off_t offset)
255 {
256         return NULL;
257 }
258
259 _PUBLIC_
260 ssize_t vfs_not_implemented_pread_recv(struct tevent_req *req,
261                                        struct vfs_aio_state *vfs_aio_state)
262 {
263         vfs_aio_state->error = ENOSYS;
264         return -1;
265 }
266
267 _PUBLIC_
268 ssize_t vfs_not_implemented_pwrite(vfs_handle_struct *handle, files_struct *fsp,
269                                    const void *data, size_t n, off_t offset)
270 {
271         errno = ENOSYS;
272         return -1;
273 }
274
275 _PUBLIC_
276 struct tevent_req *vfs_not_implemented_pwrite_send(struct vfs_handle_struct *handle,
277                                                    TALLOC_CTX *mem_ctx,
278                                                    struct tevent_context *ev,
279                                                    struct files_struct *fsp,
280                                                    const void *data,
281                                                    size_t n, off_t offset)
282 {
283         return NULL;
284 }
285
286 _PUBLIC_
287 ssize_t vfs_not_implemented_pwrite_recv(struct tevent_req *req,
288                                 struct vfs_aio_state *vfs_aio_state)
289 {
290         vfs_aio_state->error = ENOSYS;
291         return -1;
292 }
293
294 _PUBLIC_
295 off_t vfs_not_implemented_lseek(vfs_handle_struct *handle, files_struct *fsp,
296                         off_t offset, int whence)
297 {
298         errno = ENOSYS;
299         return (off_t) - 1;
300 }
301
302 _PUBLIC_
303 ssize_t vfs_not_implemented_sendfile(vfs_handle_struct *handle, int tofd,
304                                      files_struct *fromfsp, const DATA_BLOB *hdr,
305                                      off_t offset, size_t n)
306 {
307         errno = ENOSYS;
308         return -1;
309 }
310
311 _PUBLIC_
312 ssize_t vfs_not_implemented_recvfile(vfs_handle_struct *handle, int fromfd,
313                                      files_struct *tofsp, off_t offset, size_t n)
314 {
315         errno = ENOSYS;
316         return -1;
317 }
318
319 _PUBLIC_
320 int vfs_not_implemented_renameat(vfs_handle_struct *handle,
321                                files_struct *srcfsp,
322                                const struct smb_filename *smb_fname_src,
323                                files_struct *dstfsp,
324                                const struct smb_filename *smb_fname_dst)
325 {
326         errno = ENOSYS;
327         return -1;
328 }
329
330 _PUBLIC_
331 struct tevent_req *vfs_not_implemented_fsync_send(struct vfs_handle_struct *handle,
332                                                   TALLOC_CTX *mem_ctx,
333                                                   struct tevent_context *ev,
334                                                   struct files_struct *fsp)
335 {
336         return NULL;
337 }
338
339 _PUBLIC_
340 int vfs_not_implemented_fsync_recv(struct tevent_req *req,
341                                    struct vfs_aio_state *vfs_aio_state)
342 {
343         vfs_aio_state->error = ENOSYS;
344         return -1;
345 }
346
347 _PUBLIC_
348 int vfs_not_implemented_stat(vfs_handle_struct *handle, struct smb_filename *smb_fname)
349 {
350         errno = ENOSYS;
351         return -1;
352 }
353
354 _PUBLIC_
355 int vfs_not_implemented_fstat(vfs_handle_struct *handle, files_struct *fsp,
356                         SMB_STRUCT_STAT *sbuf)
357 {
358         errno = ENOSYS;
359         return -1;
360 }
361
362 _PUBLIC_
363 int vfs_not_implemented_lstat(vfs_handle_struct *handle,
364                               struct smb_filename *smb_fname)
365 {
366         errno = ENOSYS;
367         return -1;
368 }
369
370 _PUBLIC_
371 int vfs_not_implemented_fstatat(
372         struct vfs_handle_struct *handle,
373         const struct files_struct *dirfsp,
374         const struct smb_filename *smb_fname,
375         SMB_STRUCT_STAT *sbuf,
376         int flags)
377 {
378         errno = ENOSYS;
379         return -1;
380 }
381
382 _PUBLIC_
383 uint64_t vfs_not_implemented_get_alloc_size(struct vfs_handle_struct *handle,
384                                             struct files_struct *fsp,
385                                             const SMB_STRUCT_STAT *sbuf)
386 {
387         errno = ENOSYS;
388         return -1;
389 }
390
391 _PUBLIC_
392 int vfs_not_implemented_unlinkat(vfs_handle_struct *handle,
393                         struct files_struct *dirfsp,
394                         const struct smb_filename *smb_fname,
395                         int flags)
396 {
397         errno = ENOSYS;
398         return -1;
399 }
400
401 _PUBLIC_
402 int vfs_not_implemented_fchmod(vfs_handle_struct *handle, files_struct *fsp,
403                                mode_t mode)
404 {
405         errno = ENOSYS;
406         return -1;
407 }
408
409 _PUBLIC_
410 int vfs_not_implemented_fchown(vfs_handle_struct *handle, files_struct *fsp,
411                                uid_t uid, gid_t gid)
412 {
413         errno = ENOSYS;
414         return -1;
415 }
416
417 _PUBLIC_
418 int vfs_not_implemented_lchown(vfs_handle_struct *handle,
419                                const struct smb_filename *smb_fname,
420                                uid_t uid,
421                                gid_t gid)
422 {
423         errno = ENOSYS;
424         return -1;
425 }
426
427 _PUBLIC_
428 int vfs_not_implemented_chdir(vfs_handle_struct *handle,
429                               const struct smb_filename *smb_fname)
430 {
431         errno = ENOSYS;
432         return -1;
433 }
434
435 _PUBLIC_
436 struct smb_filename *vfs_not_implemented_getwd(vfs_handle_struct *handle,
437                                                TALLOC_CTX *ctx)
438 {
439         errno = ENOSYS;
440         return NULL;
441 }
442
443 _PUBLIC_
444 int vfs_not_implemented_fntimes(vfs_handle_struct *handle,
445                                 files_struct *fsp,
446                                 struct smb_file_time *ft)
447 {
448         errno = ENOSYS;
449         return -1;
450 }
451
452 _PUBLIC_
453 int vfs_not_implemented_ftruncate(vfs_handle_struct *handle, files_struct *fsp,
454                                   off_t offset)
455 {
456         errno = ENOSYS;
457         return -1;
458 }
459
460 _PUBLIC_
461 int vfs_not_implemented_fallocate(vfs_handle_struct *handle, files_struct *fsp,
462                                   uint32_t mode, off_t offset, off_t len)
463 {
464         errno = ENOSYS;
465         return -1;
466 }
467
468 _PUBLIC_
469 bool vfs_not_implemented_lock(vfs_handle_struct *handle, files_struct *fsp, int op,
470                               off_t offset, off_t count, int type)
471 {
472         errno = ENOSYS;
473         return false;
474 }
475
476 _PUBLIC_
477 int vfs_not_implemented_filesystem_sharemode(struct vfs_handle_struct *handle,
478                                              struct files_struct *fsp,
479                                              uint32_t share_access,
480                                              uint32_t access_mask)
481 {
482         errno = ENOSYS;
483         return -1;
484 }
485
486 _PUBLIC_
487 int vfs_not_implemented_fcntl(struct vfs_handle_struct *handle,
488                               struct files_struct *fsp, int cmd,
489                               va_list cmd_arg)
490 {
491         errno = ENOSYS;
492         return -1;
493 }
494
495 _PUBLIC_
496 int vfs_not_implemented_linux_setlease(struct vfs_handle_struct *handle,
497                                        struct files_struct *fsp, int leasetype)
498 {
499         errno = ENOSYS;
500         return -1;
501 }
502
503 _PUBLIC_
504 bool vfs_not_implemented_getlock(vfs_handle_struct *handle, files_struct *fsp,
505                                  off_t *poffset, off_t *pcount, int *ptype,
506                                  pid_t *ppid)
507 {
508         errno = ENOSYS;
509         return false;
510 }
511
512 _PUBLIC_
513 int vfs_not_implemented_symlinkat(vfs_handle_struct *handle,
514                                 const struct smb_filename *link_contents,
515                                 struct files_struct *dirfsp,
516                                 const struct smb_filename *new_smb_fname)
517 {
518         errno = ENOSYS;
519         return -1;
520 }
521
522 _PUBLIC_
523 int vfs_not_implemented_vfs_readlinkat(vfs_handle_struct *handle,
524                         const struct files_struct *dirfsp,
525                         const struct smb_filename *smb_fname,
526                         char *buf,
527                         size_t bufsiz)
528 {
529         errno = ENOSYS;
530         return -1;
531 }
532
533 _PUBLIC_
534 int vfs_not_implemented_linkat(vfs_handle_struct *handle,
535                         files_struct *srcfsp,
536                         const struct smb_filename *old_smb_fname,
537                         files_struct *dstfsp,
538                         const struct smb_filename *new_smb_fname,
539                         int flags)
540 {
541         errno = ENOSYS;
542         return -1;
543 }
544
545 _PUBLIC_
546 int vfs_not_implemented_mknodat(vfs_handle_struct *handle,
547                         files_struct *dirfsp,
548                         const struct smb_filename *smb_fname,
549                         mode_t mode,
550                         SMB_DEV_T dev)
551 {
552         errno = ENOSYS;
553         return -1;
554 }
555
556 _PUBLIC_
557 struct smb_filename *vfs_not_implemented_realpath(vfs_handle_struct *handle,
558                                                   TALLOC_CTX *ctx,
559                                                   const struct smb_filename *smb_fname)
560 {
561         errno = ENOSYS;
562         return NULL;
563 }
564
565 _PUBLIC_
566 int vfs_not_implemented_fchflags(vfs_handle_struct *handle,
567                                 struct files_struct *fsp,
568                                 uint flags)
569 {
570         errno = ENOSYS;
571         return -1;
572 }
573
574 _PUBLIC_
575 struct file_id vfs_not_implemented_file_id_create(vfs_handle_struct *handle,
576                                                   const SMB_STRUCT_STAT *sbuf)
577 {
578         struct file_id id;
579         ZERO_STRUCT(id);
580         errno = ENOSYS;
581         return id;
582 }
583
584 _PUBLIC_
585 uint64_t vfs_not_implemented_fs_file_id(vfs_handle_struct *handle,
586                                         const SMB_STRUCT_STAT *sbuf)
587 {
588         errno = ENOSYS;
589         return 0;
590 }
591
592 struct vfs_not_implemented_offload_read_state {
593         bool dummy;
594 };
595
596 _PUBLIC_
597 struct tevent_req *vfs_not_implemented_offload_read_send(
598                         TALLOC_CTX *mem_ctx,
599                         struct tevent_context *ev,
600                         struct vfs_handle_struct *handle,
601                         struct files_struct *fsp,
602                         uint32_t fsctl,
603                         uint32_t ttl,
604                         off_t offset,
605                         size_t to_copy)
606 {
607         struct tevent_req *req = NULL;
608         struct vfs_not_implemented_offload_read_state *state = NULL;
609
610         req = tevent_req_create(mem_ctx, &state,
611                                 struct vfs_not_implemented_offload_read_state);
612         if (req == NULL) {
613                 return NULL;
614         }
615
616         tevent_req_nterror(req, NT_STATUS_NOT_IMPLEMENTED);
617         return tevent_req_post(req, ev);
618 }
619
620 _PUBLIC_
621 NTSTATUS vfs_not_implemented_offload_read_recv(struct tevent_req *req,
622                                        struct vfs_handle_struct *handle,
623                                        TALLOC_CTX *mem_ctx,
624                                        uint32_t *flags,
625                                        uint64_t *xferlen,
626                                        DATA_BLOB *_token_blob)
627 {
628         NTSTATUS status;
629
630         if (tevent_req_is_nterror(req, &status)) {
631                 tevent_req_received(req);
632                 return status;
633         }
634
635         tevent_req_received(req);
636         return NT_STATUS_OK;
637 }
638
639 struct vfs_not_implemented_offload_write_state {
640         uint64_t unused;
641 };
642
643 _PUBLIC_
644 struct tevent_req *vfs_not_implemented_offload_write_send(
645                         struct vfs_handle_struct *handle,
646                         TALLOC_CTX *mem_ctx,
647                         struct tevent_context *ev,
648                         uint32_t fsctl,
649                         DATA_BLOB *token,
650                         off_t transfer_offset,
651                         struct files_struct *dest_fsp,
652                         off_t dest_off,
653                         off_t num)
654 {
655         struct tevent_req *req;
656         struct vfs_not_implemented_offload_write_state *state;
657
658         req = tevent_req_create(mem_ctx, &state,
659                                 struct vfs_not_implemented_offload_write_state);
660         if (req == NULL) {
661                 return NULL;
662         }
663
664         tevent_req_nterror(req, NT_STATUS_NOT_IMPLEMENTED);
665         return tevent_req_post(req, ev);
666 }
667
668 _PUBLIC_
669 NTSTATUS vfs_not_implemented_offload_write_recv(struct vfs_handle_struct *handle,
670                                                 struct tevent_req *req,
671                                                 off_t *copied)
672 {
673         NTSTATUS status;
674
675         if (tevent_req_is_nterror(req, &status)) {
676                 tevent_req_received(req);
677                 return status;
678         }
679
680         tevent_req_received(req);
681         return NT_STATUS_OK;
682 }
683
684 _PUBLIC_
685 NTSTATUS vfs_not_implemented_fget_compression(struct vfs_handle_struct *handle,
686                                              TALLOC_CTX *mem_ctx,
687                                              struct files_struct *fsp,
688                                              uint16_t *_compression_fmt)
689 {
690         return NT_STATUS_INVALID_DEVICE_REQUEST;
691 }
692
693 _PUBLIC_
694 NTSTATUS vfs_not_implemented_set_compression(struct vfs_handle_struct *handle,
695                                              TALLOC_CTX *mem_ctx,
696                                              struct files_struct *fsp,
697                                              uint16_t compression_fmt)
698 {
699         return NT_STATUS_INVALID_DEVICE_REQUEST;
700 }
701
702 _PUBLIC_
703 NTSTATUS vfs_not_implemented_fstreaminfo(struct vfs_handle_struct *handle,
704                                         struct files_struct *fsp,
705                                         TALLOC_CTX *mem_ctx,
706                                         unsigned int *num_streams,
707                                         struct stream_struct **streams)
708 {
709         return NT_STATUS_NOT_IMPLEMENTED;
710 }
711
712 _PUBLIC_
713 NTSTATUS vfs_not_implemented_get_real_filename_at(
714         struct vfs_handle_struct *handle,
715         struct files_struct *dirfsp,
716         const char *name,
717         TALLOC_CTX *mem_ctx,
718         char **found_name)
719 {
720         return NT_STATUS_NOT_IMPLEMENTED;
721 }
722
723 _PUBLIC_
724 const char *vfs_not_implemented_connectpath(
725         struct vfs_handle_struct *handle,
726         const struct files_struct *dirfsp,
727         const struct smb_filename *smb_fname)
728 {
729         errno = ENOSYS;
730         return NULL;
731 }
732
733 _PUBLIC_
734 NTSTATUS vfs_not_implemented_brl_lock_windows(struct vfs_handle_struct *handle,
735                                               struct byte_range_lock *br_lck,
736                                               struct lock_struct *plock)
737 {
738         return NT_STATUS_NOT_IMPLEMENTED;
739 }
740
741 _PUBLIC_
742 bool vfs_not_implemented_brl_unlock_windows(struct vfs_handle_struct *handle,
743                                             struct byte_range_lock *br_lck,
744                                             const struct lock_struct *plock)
745 {
746         errno = ENOSYS;
747         return false;
748 }
749
750 _PUBLIC_
751 bool vfs_not_implemented_strict_lock_check(struct vfs_handle_struct *handle,
752                                            struct files_struct *fsp,
753                                            struct lock_struct *plock)
754 {
755         errno = ENOSYS;
756         return false;
757 }
758
759 _PUBLIC_
760 NTSTATUS vfs_not_implemented_translate_name(struct vfs_handle_struct *handle,
761                                             const char *mapped_name,
762                                             enum vfs_translate_direction direction,
763                                             TALLOC_CTX *mem_ctx, char **pmapped_name)
764 {
765         return NT_STATUS_NOT_IMPLEMENTED;
766 }
767
768 _PUBLIC_
769 NTSTATUS vfs_not_implemented_parent_pathname(struct vfs_handle_struct *handle,
770                                                     TALLOC_CTX *mem_ctx,
771                                                     const struct smb_filename *smb_fname_in,
772                                                     struct smb_filename **parent_dir_out,
773                                                     struct smb_filename **atname_out)
774 {
775         return NT_STATUS_NOT_IMPLEMENTED;
776 }
777
778 _PUBLIC_
779 NTSTATUS vfs_not_implemented_fsctl(struct vfs_handle_struct *handle,
780                                    struct files_struct *fsp,
781                                    TALLOC_CTX *ctx,
782                                    uint32_t function,
783                                    uint16_t req_flags,  /* Needed for UNICODE ... */
784                                    const uint8_t *_in_data,
785                                    uint32_t in_len,
786                                    uint8_t **_out_data,
787                                    uint32_t max_out_len, uint32_t *out_len)
788 {
789         return NT_STATUS_NOT_IMPLEMENTED;
790 }
791
792 _PUBLIC_
793 NTSTATUS vfs_not_implemented_freaddir_attr(struct vfs_handle_struct *handle,
794                                         struct files_struct *fsp,
795                                         TALLOC_CTX *mem_ctx,
796                                         struct readdir_attr_data **pattr_data)
797 {
798         return NT_STATUS_NOT_IMPLEMENTED;
799 }
800
801 struct vfs_not_implemented_get_dos_attributes_state {
802         struct vfs_aio_state aio_state;
803         uint32_t dosmode;
804 };
805
806 _PUBLIC_
807 struct tevent_req *vfs_not_implemented_get_dos_attributes_send(
808                         TALLOC_CTX *mem_ctx,
809                         struct tevent_context *ev,
810                         struct vfs_handle_struct *handle,
811                         files_struct *dir_fsp,
812                         struct smb_filename *smb_fname)
813 {
814         struct tevent_req *req = NULL;
815         struct vfs_not_implemented_get_dos_attributes_state *state = NULL;
816
817         req = tevent_req_create(mem_ctx, &state,
818                         struct vfs_not_implemented_get_dos_attributes_state);
819         if (req == NULL) {
820                 return NULL;
821         }
822
823         tevent_req_nterror(req, NT_STATUS_NOT_IMPLEMENTED);
824         return tevent_req_post(req, ev);
825 }
826
827 _PUBLIC_
828 NTSTATUS vfs_not_implemented_get_dos_attributes_recv(
829                         struct tevent_req *req,
830                         struct vfs_aio_state *aio_state,
831                         uint32_t *dosmode)
832 {
833         struct vfs_not_implemented_get_dos_attributes_state *state =
834                 tevent_req_data(req,
835                 struct vfs_not_implemented_get_dos_attributes_state);
836         NTSTATUS status;
837
838         if (tevent_req_is_nterror(req, &status)) {
839                 tevent_req_received(req);
840                 return status;
841         }
842
843         *aio_state = state->aio_state;
844         *dosmode = state->dosmode;
845         tevent_req_received(req);
846         return NT_STATUS_OK;
847 }
848
849 _PUBLIC_
850 NTSTATUS vfs_not_implemented_fget_dos_attributes(struct vfs_handle_struct *handle,
851                                                  struct files_struct *fsp,
852                                                  uint32_t *dosmode)
853 {
854         return NT_STATUS_NOT_IMPLEMENTED;
855 }
856
857 _PUBLIC_
858 NTSTATUS vfs_not_implemented_fset_dos_attributes(struct vfs_handle_struct *handle,
859                                                  struct files_struct *fsp,
860                                                  uint32_t dosmode)
861 {
862         return NT_STATUS_NOT_IMPLEMENTED;
863 }
864
865 _PUBLIC_
866 NTSTATUS vfs_not_implemented_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
867                                          uint32_t security_info,
868                                          TALLOC_CTX *mem_ctx,
869                                          struct security_descriptor **ppdesc)
870 {
871         return NT_STATUS_NOT_IMPLEMENTED;
872 }
873
874 _PUBLIC_
875 NTSTATUS vfs_not_implemented_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
876                                          uint32_t security_info_sent,
877                                          const struct security_descriptor *psd)
878 {
879         return NT_STATUS_NOT_IMPLEMENTED;
880 }
881
882 _PUBLIC_
883 SMB_ACL_T vfs_not_implemented_sys_acl_get_fd(vfs_handle_struct *handle,
884                                              files_struct *fsp,
885                                              SMB_ACL_TYPE_T type,
886                                              TALLOC_CTX *mem_ctx)
887 {
888         errno = ENOSYS;
889         return (SMB_ACL_T) NULL;
890 }
891
892 _PUBLIC_
893 int vfs_not_implemented_sys_acl_blob_get_fd(vfs_handle_struct *handle,
894                                 files_struct *fsp, TALLOC_CTX *mem_ctx,
895                                 char **blob_description, DATA_BLOB *blob)
896 {
897         errno = ENOSYS;
898         return -1;
899 }
900
901 _PUBLIC_
902 int vfs_not_implemented_sys_acl_set_fd(vfs_handle_struct *handle,
903                                        struct files_struct *fsp,
904                                        SMB_ACL_TYPE_T type,
905                                        SMB_ACL_T theacl)
906 {
907         errno = ENOSYS;
908         return -1;
909 }
910
911 _PUBLIC_
912 int vfs_not_implemented_sys_acl_delete_def_fd(vfs_handle_struct *handle,
913                                         struct files_struct *fsp)
914 {
915         errno = ENOSYS;
916         return -1;
917 }
918
919 struct vfs_not_implemented_getxattrat_state {
920         struct vfs_aio_state aio_state;
921         ssize_t xattr_size;
922         uint8_t *xattr_value;
923 };
924
925 _PUBLIC_
926 struct tevent_req *vfs_not_implemented_getxattrat_send(
927                         TALLOC_CTX *mem_ctx,
928                         struct tevent_context *ev,
929                         struct vfs_handle_struct *handle,
930                         files_struct *dir_fsp,
931                         const struct smb_filename *smb_fname,
932                         const char *xattr_name,
933                         size_t alloc_hint)
934 {
935         struct tevent_req *req = NULL;
936         struct vfs_not_implemented_getxattrat_state *state = NULL;
937
938         req = tevent_req_create(mem_ctx, &state,
939                                 struct vfs_not_implemented_getxattrat_state);
940         if (req == NULL) {
941                 return NULL;
942         }
943
944         tevent_req_error(req, ENOSYS);
945         return tevent_req_post(req, ev);
946 }
947
948 _PUBLIC_
949 ssize_t vfs_not_implemented_getxattrat_recv(struct tevent_req *req,
950                                     struct vfs_aio_state *aio_state,
951                                     TALLOC_CTX *mem_ctx,
952                                     uint8_t **xattr_value)
953 {
954         struct vfs_not_implemented_getxattrat_state *state = tevent_req_data(
955                 req, struct vfs_not_implemented_getxattrat_state);
956         ssize_t xattr_size;
957
958         if (tevent_req_is_unix_error(req, &aio_state->error)) {
959                 tevent_req_received(req);
960                 return -1;
961         }
962
963         *aio_state = state->aio_state;
964         xattr_size = state->xattr_size;
965         if (xattr_value != NULL) {
966                 *xattr_value = talloc_move(mem_ctx, &state->xattr_value);
967         }
968
969         tevent_req_received(req);
970         return xattr_size;
971 }
972
973 _PUBLIC_
974 ssize_t vfs_not_implemented_fgetxattr(vfs_handle_struct *handle,
975                               struct files_struct *fsp, const char *name,
976                               void *value, size_t size)
977 {
978         errno = ENOSYS;
979         return -1;
980 }
981
982 _PUBLIC_
983 ssize_t vfs_not_implemented_flistxattr(vfs_handle_struct *handle,
984                                        struct files_struct *fsp, char *list,
985                                        size_t size)
986 {
987         errno = ENOSYS;
988         return -1;
989 }
990
991 _PUBLIC_
992 int vfs_not_implemented_fremovexattr(vfs_handle_struct *handle,
993                                      struct files_struct *fsp, const char *name)
994 {
995         errno = ENOSYS;
996         return -1;
997 }
998
999 _PUBLIC_
1000 int vfs_not_implemented_fsetxattr(vfs_handle_struct *handle, struct files_struct *fsp,
1001                                   const char *name, const void *value, size_t size,
1002                                   int flags)
1003 {
1004         errno = ENOSYS;
1005         return -1;
1006 }
1007
1008 _PUBLIC_
1009 bool vfs_not_implemented_aio_force(struct vfs_handle_struct *handle,
1010                                    struct files_struct *fsp)
1011 {
1012         errno = ENOSYS;
1013         return false;
1014 }
1015
1016 _PUBLIC_
1017 NTSTATUS vfs_not_implemented_audit_file(struct vfs_handle_struct *handle,
1018                                         struct smb_filename *file,
1019                                         struct security_acl *sacl,
1020                                         uint32_t access_requested,
1021                                         uint32_t access_denied)
1022 {
1023         return NT_STATUS_NOT_IMPLEMENTED;
1024 }
1025
1026 _PUBLIC_
1027 NTSTATUS vfs_not_implemented_durable_cookie(struct vfs_handle_struct *handle,
1028                                             struct files_struct *fsp,
1029                                             TALLOC_CTX *mem_ctx,
1030                                             DATA_BLOB *cookie)
1031 {
1032         return NT_STATUS_NOT_IMPLEMENTED;
1033 }
1034
1035 _PUBLIC_
1036 NTSTATUS vfs_not_implemented_durable_disconnect(struct vfs_handle_struct *handle,
1037                                                 struct files_struct *fsp,
1038                                                 const DATA_BLOB old_cookie,
1039                                                 TALLOC_CTX *mem_ctx,
1040                                                 DATA_BLOB *new_cookie)
1041 {
1042         return NT_STATUS_NOT_IMPLEMENTED;
1043 }
1044
1045 _PUBLIC_
1046 NTSTATUS vfs_not_implemented_durable_reconnect(struct vfs_handle_struct *handle,
1047                                                struct smb_request *smb1req,
1048                                                struct smbXsrv_open *op,
1049                                                const DATA_BLOB old_cookie,
1050                                                TALLOC_CTX *mem_ctx,
1051                                                struct files_struct **fsp,
1052                                                DATA_BLOB *new_cookie)
1053 {
1054         return NT_STATUS_NOT_IMPLEMENTED;
1055 }
1056
1057 /* VFS operations structure */
1058
1059 static struct vfs_fn_pointers vfs_not_implemented_fns = {
1060         /* Disk operations */
1061
1062         .connect_fn = vfs_not_implemented_connect,
1063         .disconnect_fn = vfs_not_implemented_disconnect,
1064         .disk_free_fn = vfs_not_implemented_disk_free,
1065         .get_quota_fn = vfs_not_implemented_get_quota,
1066         .set_quota_fn = vfs_not_implemented_set_quota,
1067         .get_shadow_copy_data_fn = vfs_not_implemented_get_shadow_copy_data,
1068         .statvfs_fn = vfs_not_implemented_statvfs,
1069         .fs_capabilities_fn = vfs_not_implemented_fs_capabilities,
1070         .get_dfs_referrals_fn = vfs_not_implemented_get_dfs_referrals,
1071         .create_dfs_pathat_fn = vfs_not_implemented_create_dfs_pathat,
1072         .read_dfs_pathat_fn = vfs_not_implemented_read_dfs_pathat,
1073         .snap_check_path_fn = vfs_not_implemented_snap_check_path,
1074         .snap_create_fn = vfs_not_implemented_snap_create,
1075         .snap_delete_fn = vfs_not_implemented_snap_delete,
1076
1077         /* Directory operations */
1078
1079         .fdopendir_fn = vfs_not_implemented_fdopendir,
1080         .readdir_fn = vfs_not_implemented_readdir,
1081         .rewind_dir_fn = vfs_not_implemented_rewind_dir,
1082         .mkdirat_fn = vfs_not_implemented_mkdirat,
1083         .closedir_fn = vfs_not_implemented_closedir,
1084
1085         /* File operations */
1086
1087         .openat_fn = vfs_not_implemented_openat,
1088         .create_file_fn = vfs_not_implemented_create_file,
1089         .close_fn = vfs_not_implemented_close_fn,
1090         .pread_fn = vfs_not_implemented_pread,
1091         .pread_send_fn = vfs_not_implemented_pread_send,
1092         .pread_recv_fn = vfs_not_implemented_pread_recv,
1093         .pwrite_fn = vfs_not_implemented_pwrite,
1094         .pwrite_send_fn = vfs_not_implemented_pwrite_send,
1095         .pwrite_recv_fn = vfs_not_implemented_pwrite_recv,
1096         .lseek_fn = vfs_not_implemented_lseek,
1097         .sendfile_fn = vfs_not_implemented_sendfile,
1098         .recvfile_fn = vfs_not_implemented_recvfile,
1099         .renameat_fn = vfs_not_implemented_renameat,
1100         .fsync_send_fn = vfs_not_implemented_fsync_send,
1101         .fsync_recv_fn = vfs_not_implemented_fsync_recv,
1102         .stat_fn = vfs_not_implemented_stat,
1103         .fstat_fn = vfs_not_implemented_fstat,
1104         .lstat_fn = vfs_not_implemented_lstat,
1105         .fstatat_fn = vfs_not_implemented_fstatat,
1106         .get_alloc_size_fn = vfs_not_implemented_get_alloc_size,
1107         .unlinkat_fn = vfs_not_implemented_unlinkat,
1108         .fchmod_fn = vfs_not_implemented_fchmod,
1109         .fchown_fn = vfs_not_implemented_fchown,
1110         .lchown_fn = vfs_not_implemented_lchown,
1111         .chdir_fn = vfs_not_implemented_chdir,
1112         .getwd_fn = vfs_not_implemented_getwd,
1113         .fntimes_fn = vfs_not_implemented_fntimes,
1114         .ftruncate_fn = vfs_not_implemented_ftruncate,
1115         .fallocate_fn = vfs_not_implemented_fallocate,
1116         .lock_fn = vfs_not_implemented_lock,
1117         .filesystem_sharemode_fn = vfs_not_implemented_filesystem_sharemode,
1118         .fcntl_fn = vfs_not_implemented_fcntl,
1119         .linux_setlease_fn = vfs_not_implemented_linux_setlease,
1120         .getlock_fn = vfs_not_implemented_getlock,
1121         .symlinkat_fn = vfs_not_implemented_symlinkat,
1122         .readlinkat_fn = vfs_not_implemented_vfs_readlinkat,
1123         .linkat_fn = vfs_not_implemented_linkat,
1124         .mknodat_fn = vfs_not_implemented_mknodat,
1125         .realpath_fn = vfs_not_implemented_realpath,
1126         .fchflags_fn = vfs_not_implemented_fchflags,
1127         .file_id_create_fn = vfs_not_implemented_file_id_create,
1128         .fs_file_id_fn = vfs_not_implemented_fs_file_id,
1129         .offload_read_send_fn = vfs_not_implemented_offload_read_send,
1130         .offload_read_recv_fn = vfs_not_implemented_offload_read_recv,
1131         .offload_write_send_fn = vfs_not_implemented_offload_write_send,
1132         .offload_write_recv_fn = vfs_not_implemented_offload_write_recv,
1133         .fget_compression_fn = vfs_not_implemented_fget_compression,
1134         .set_compression_fn = vfs_not_implemented_set_compression,
1135
1136         .fstreaminfo_fn = vfs_not_implemented_fstreaminfo,
1137         .get_real_filename_at_fn = vfs_not_implemented_get_real_filename_at,
1138         .connectpath_fn = vfs_not_implemented_connectpath,
1139         .brl_lock_windows_fn = vfs_not_implemented_brl_lock_windows,
1140         .brl_unlock_windows_fn = vfs_not_implemented_brl_unlock_windows,
1141         .strict_lock_check_fn = vfs_not_implemented_strict_lock_check,
1142         .translate_name_fn = vfs_not_implemented_translate_name,
1143         .parent_pathname_fn = vfs_not_implemented_parent_pathname,
1144         .fsctl_fn = vfs_not_implemented_fsctl,
1145         .freaddir_attr_fn = vfs_not_implemented_freaddir_attr,
1146         .audit_file_fn = vfs_not_implemented_audit_file,
1147
1148         /* DOS attributes. */
1149         .get_dos_attributes_send_fn = vfs_not_implemented_get_dos_attributes_send,
1150         .get_dos_attributes_recv_fn = vfs_not_implemented_get_dos_attributes_recv,
1151         .fget_dos_attributes_fn = vfs_not_implemented_fget_dos_attributes,
1152         .fset_dos_attributes_fn = vfs_not_implemented_fset_dos_attributes,
1153
1154         /* NT ACL operations. */
1155
1156         .fget_nt_acl_fn = vfs_not_implemented_fget_nt_acl,
1157         .fset_nt_acl_fn = vfs_not_implemented_fset_nt_acl,
1158
1159         /* POSIX ACL operations. */
1160
1161         .sys_acl_get_fd_fn = vfs_not_implemented_sys_acl_get_fd,
1162         .sys_acl_blob_get_fd_fn = vfs_not_implemented_sys_acl_blob_get_fd,
1163         .sys_acl_set_fd_fn = vfs_not_implemented_sys_acl_set_fd,
1164         .sys_acl_delete_def_fd_fn = vfs_not_implemented_sys_acl_delete_def_fd,
1165
1166         /* EA operations. */
1167         .getxattrat_send_fn = vfs_not_implemented_getxattrat_send,
1168         .getxattrat_recv_fn = vfs_not_implemented_getxattrat_recv,
1169         .fgetxattr_fn = vfs_not_implemented_fgetxattr,
1170         .flistxattr_fn = vfs_not_implemented_flistxattr,
1171         .fremovexattr_fn = vfs_not_implemented_fremovexattr,
1172         .fsetxattr_fn = vfs_not_implemented_fsetxattr,
1173
1174         /* aio operations */
1175         .aio_force_fn = vfs_not_implemented_aio_force,
1176
1177         /* durable handle operations */
1178         .durable_cookie_fn = vfs_not_implemented_durable_cookie,
1179         .durable_disconnect_fn = vfs_not_implemented_durable_disconnect,
1180         .durable_reconnect_fn = vfs_not_implemented_durable_reconnect,
1181 };
1182
1183 static_decl_vfs;
1184 NTSTATUS vfs_not_implemented_init(TALLOC_CTX *ctx)
1185 {
1186         /*
1187          * smb_vfs_assert_all_fns() makes sure every
1188          * call is implemented.
1189          */
1190         smb_vfs_assert_all_fns(&vfs_not_implemented_fns, "vfs_not_implemented");
1191         return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "vfs_not_implemented",
1192                                 &vfs_not_implemented_fns);
1193 }