s3:vfs: Initialize pid to 0 in test_netatalk_lock()
[Samba.git] / source3 / modules / vfs_not_implemented.c
blob214390204a5b194b7c51cead13f6a010044e048a
1 /*
2 * VFS module with "not implemented " helper functions for other modules.
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
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.
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.
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/>.
23 #include "includes.h"
24 #include "lib/util/tevent_unix.h"
25 #include "lib/util/tevent_ntstatus.h"
27 int vfs_not_implemented_connect(
28 vfs_handle_struct *handle,
29 const char *service,
30 const char *user)
32 errno = ENOSYS;
33 return -1;
36 void vfs_not_implemented_disconnect(vfs_handle_struct *handle)
41 uint64_t vfs_not_implemented_disk_free(vfs_handle_struct *handle,
42 const struct smb_filename *smb_fname,
43 uint64_t *bsize,
44 uint64_t *dfree,
45 uint64_t *dsize)
47 *bsize = 0;
48 *dfree = 0;
49 *dsize = 0;
50 return 0;
53 int vfs_not_implemented_get_quota(vfs_handle_struct *handle,
54 const struct smb_filename *smb_fname,
55 enum SMB_QUOTA_TYPE qtype,
56 unid_t id,
57 SMB_DISK_QUOTA *dq)
59 errno = ENOSYS;
60 return -1;
63 int vfs_not_implemented_set_quota(vfs_handle_struct *handle,
64 enum SMB_QUOTA_TYPE qtype,
65 unid_t id, SMB_DISK_QUOTA *dq)
67 errno = ENOSYS;
68 return -1;
71 int vfs_not_implemented_get_shadow_copy_data(vfs_handle_struct *handle,
72 files_struct *fsp,
73 struct shadow_copy_data *shadow_copy_data,
74 bool labels)
76 errno = ENOSYS;
77 return -1;
80 int vfs_not_implemented_statvfs(struct vfs_handle_struct *handle,
81 const struct smb_filename *smb_fname,
82 struct vfs_statvfs_struct *statbuf)
84 errno = ENOSYS;
85 return -1;
88 uint32_t vfs_not_implemented_fs_capabilities(struct vfs_handle_struct *handle,
89 enum timestamp_set_resolution *p_ts_res)
91 return 0;
94 NTSTATUS vfs_not_implemented_get_dfs_referrals(struct vfs_handle_struct *handle,
95 struct dfs_GetDFSReferral *r)
97 return NT_STATUS_NOT_IMPLEMENTED;
100 DIR *vfs_not_implemented_opendir(vfs_handle_struct *handle,
101 const struct smb_filename *smb_fname,
102 const char *mask,
103 uint32_t attr)
105 return NULL;
108 NTSTATUS vfs_not_implemented_snap_check_path(struct vfs_handle_struct *handle,
109 TALLOC_CTX *mem_ctx,
110 const char *service_path,
111 char **base_volume)
113 return NT_STATUS_NOT_SUPPORTED;
116 NTSTATUS vfs_not_implemented_snap_create(struct vfs_handle_struct *handle,
117 TALLOC_CTX *mem_ctx,
118 const char *base_volume,
119 time_t *tstamp,
120 bool rw,
121 char **base_path,
122 char **snap_path)
124 return NT_STATUS_NOT_SUPPORTED;
127 NTSTATUS vfs_not_implemented_snap_delete(struct vfs_handle_struct *handle,
128 TALLOC_CTX *mem_ctx,
129 char *base_path,
130 char *snap_path)
132 return NT_STATUS_NOT_SUPPORTED;
135 DIR *vfs_not_implemented_fdopendir(vfs_handle_struct *handle, files_struct *fsp,
136 const char *mask, uint32_t attr)
138 errno = ENOSYS;
139 return NULL;
142 struct dirent *vfs_not_implemented_readdir(vfs_handle_struct *handle,
143 DIR *dirp, SMB_STRUCT_STAT *sbuf)
145 errno = ENOSYS;
146 return NULL;
149 void vfs_not_implemented_seekdir(vfs_handle_struct *handle, DIR *dirp, long offset)
154 long vfs_not_implemented_telldir(vfs_handle_struct *handle, DIR *dirp)
156 errno = ENOSYS;
157 return (long)-1;
160 void vfs_not_implemented_rewind_dir(vfs_handle_struct *handle, DIR *dirp)
165 int vfs_not_implemented_mkdir(vfs_handle_struct *handle,
166 const struct smb_filename *smb_fname,
167 mode_t mode)
169 errno = ENOSYS;
170 return -1;
173 int vfs_not_implemented_rmdir(vfs_handle_struct *handle,
174 const struct smb_filename *smb_fname)
176 errno = ENOSYS;
177 return -1;
180 int vfs_not_implemented_closedir(vfs_handle_struct *handle, DIR *dir)
182 errno = ENOSYS;
183 return -1;
186 int vfs_not_implemented_open(vfs_handle_struct *handle,
187 struct smb_filename *smb_fname,
188 files_struct *fsp, int flags, mode_t mode)
190 errno = ENOSYS;
191 return -1;
194 NTSTATUS vfs_not_implemented_create_file(struct vfs_handle_struct *handle,
195 struct smb_request *req,
196 uint16_t root_dir_fid,
197 struct smb_filename *smb_fname,
198 uint32_t access_mask,
199 uint32_t share_access,
200 uint32_t create_disposition,
201 uint32_t create_options,
202 uint32_t file_attributes,
203 uint32_t oplock_request,
204 struct smb2_lease *lease,
205 uint64_t allocation_size,
206 uint32_t private_flags,
207 struct security_descriptor *sd,
208 struct ea_list *ea_list,
209 files_struct **result, int *pinfo,
210 const struct smb2_create_blobs *in_context_blobs,
211 struct smb2_create_blobs *out_context_blobs)
213 return NT_STATUS_NOT_IMPLEMENTED;
216 int vfs_not_implemented_close_fn(vfs_handle_struct *handle, files_struct *fsp)
218 errno = ENOSYS;
219 return -1;
222 ssize_t vfs_not_implemented_pread(vfs_handle_struct *handle, files_struct *fsp,
223 void *data, size_t n, off_t offset)
225 errno = ENOSYS;
226 return -1;
229 struct tevent_req *vfs_not_implemented_pread_send(struct vfs_handle_struct *handle,
230 TALLOC_CTX *mem_ctx,
231 struct tevent_context *ev,
232 struct files_struct *fsp,
233 void *data, size_t n, off_t offset)
235 return NULL;
238 ssize_t vfs_not_implemented_pread_recv(struct tevent_req *req,
239 struct vfs_aio_state *vfs_aio_state)
241 vfs_aio_state->error = ENOSYS;
242 return -1;
245 ssize_t vfs_not_implemented_pwrite(vfs_handle_struct *handle, files_struct *fsp,
246 const void *data, size_t n, off_t offset)
248 errno = ENOSYS;
249 return -1;
252 struct tevent_req *vfs_not_implemented_pwrite_send(struct vfs_handle_struct *handle,
253 TALLOC_CTX *mem_ctx,
254 struct tevent_context *ev,
255 struct files_struct *fsp,
256 const void *data,
257 size_t n, off_t offset)
259 return NULL;
262 ssize_t vfs_not_implemented_pwrite_recv(struct tevent_req *req,
263 struct vfs_aio_state *vfs_aio_state)
265 vfs_aio_state->error = ENOSYS;
266 return -1;
269 off_t vfs_not_implemented_lseek(vfs_handle_struct *handle, files_struct *fsp,
270 off_t offset, int whence)
272 errno = ENOSYS;
273 return (off_t) - 1;
276 ssize_t vfs_not_implemented_sendfile(vfs_handle_struct *handle, int tofd,
277 files_struct *fromfsp, const DATA_BLOB *hdr,
278 off_t offset, size_t n)
280 errno = ENOSYS;
281 return -1;
284 ssize_t vfs_not_implemented_recvfile(vfs_handle_struct *handle, int fromfd,
285 files_struct *tofsp, off_t offset, size_t n)
287 errno = ENOSYS;
288 return -1;
291 int vfs_not_implemented_rename(vfs_handle_struct *handle,
292 const struct smb_filename *smb_fname_src,
293 const struct smb_filename *smb_fname_dst)
295 errno = ENOSYS;
296 return -1;
299 struct tevent_req *vfs_not_implemented_fsync_send(struct vfs_handle_struct *handle,
300 TALLOC_CTX *mem_ctx,
301 struct tevent_context *ev,
302 struct files_struct *fsp)
304 return NULL;
307 int vfs_not_implemented_fsync_recv(struct tevent_req *req,
308 struct vfs_aio_state *vfs_aio_state)
310 vfs_aio_state->error = ENOSYS;
311 return -1;
314 int vfs_not_implemented_stat(vfs_handle_struct *handle, struct smb_filename *smb_fname)
316 errno = ENOSYS;
317 return -1;
320 int vfs_not_implemented_fstat(vfs_handle_struct *handle, files_struct *fsp,
321 SMB_STRUCT_STAT *sbuf)
323 errno = ENOSYS;
324 return -1;
327 int vfs_not_implemented_lstat(vfs_handle_struct *handle,
328 struct smb_filename *smb_fname)
330 errno = ENOSYS;
331 return -1;
334 uint64_t vfs_not_implemented_get_alloc_size(struct vfs_handle_struct *handle,
335 struct files_struct *fsp,
336 const SMB_STRUCT_STAT *sbuf)
338 errno = ENOSYS;
339 return -1;
342 int vfs_not_implemented_unlink(vfs_handle_struct *handle,
343 const struct smb_filename *smb_fname)
345 errno = ENOSYS;
346 return -1;
349 int vfs_not_implemented_chmod(vfs_handle_struct *handle,
350 const struct smb_filename *smb_fname,
351 mode_t mode)
353 errno = ENOSYS;
354 return -1;
357 int vfs_not_implemented_fchmod(vfs_handle_struct *handle, files_struct *fsp,
358 mode_t mode)
360 errno = ENOSYS;
361 return -1;
364 int vfs_not_implemented_chown(vfs_handle_struct *handle,
365 const struct smb_filename *smb_fname,
366 uid_t uid,
367 gid_t gid)
369 errno = ENOSYS;
370 return -1;
373 int vfs_not_implemented_fchown(vfs_handle_struct *handle, files_struct *fsp,
374 uid_t uid, gid_t gid)
376 errno = ENOSYS;
377 return -1;
380 int vfs_not_implemented_lchown(vfs_handle_struct *handle,
381 const struct smb_filename *smb_fname,
382 uid_t uid,
383 gid_t gid)
385 errno = ENOSYS;
386 return -1;
389 int vfs_not_implemented_chdir(vfs_handle_struct *handle,
390 const struct smb_filename *smb_fname)
392 errno = ENOSYS;
393 return -1;
396 struct smb_filename *vfs_not_implemented_getwd(vfs_handle_struct *handle,
397 TALLOC_CTX *ctx)
399 errno = ENOSYS;
400 return NULL;
403 int vfs_not_implemented_ntimes(vfs_handle_struct *handle,
404 const struct smb_filename *smb_fname,
405 struct smb_file_time *ft)
407 errno = ENOSYS;
408 return -1;
411 int vfs_not_implemented_ftruncate(vfs_handle_struct *handle, files_struct *fsp,
412 off_t offset)
414 errno = ENOSYS;
415 return -1;
418 int vfs_not_implemented_fallocate(vfs_handle_struct *handle, files_struct *fsp,
419 uint32_t mode, off_t offset, off_t len)
421 errno = ENOSYS;
422 return -1;
425 bool vfs_not_implemented_lock(vfs_handle_struct *handle, files_struct *fsp, int op,
426 off_t offset, off_t count, int type)
428 errno = ENOSYS;
429 return false;
432 int vfs_not_implemented_kernel_flock(struct vfs_handle_struct *handle,
433 struct files_struct *fsp,
434 uint32_t share_mode, uint32_t access_mask)
436 errno = ENOSYS;
437 return -1;
440 int vfs_not_implemented_linux_setlease(struct vfs_handle_struct *handle,
441 struct files_struct *fsp, int leasetype)
443 errno = ENOSYS;
444 return -1;
447 bool vfs_not_implemented_getlock(vfs_handle_struct *handle, files_struct *fsp,
448 off_t *poffset, off_t *pcount, int *ptype,
449 pid_t *ppid)
451 errno = ENOSYS;
452 return false;
455 int vfs_not_implemented_symlink(vfs_handle_struct *handle,
456 const char *link_contents,
457 const struct smb_filename *new_smb_fname)
459 errno = ENOSYS;
460 return -1;
463 int vfs_not_implemented_vfs_readlink(vfs_handle_struct *handle,
464 const struct smb_filename *smb_fname,
465 char *buf,
466 size_t bufsiz)
468 errno = ENOSYS;
469 return -1;
472 int vfs_not_implemented_link(vfs_handle_struct *handle,
473 const struct smb_filename *old_smb_fname,
474 const struct smb_filename *new_smb_fname)
476 errno = ENOSYS;
477 return -1;
480 int vfs_not_implemented_mknod(vfs_handle_struct *handle,
481 const struct smb_filename *smb_fname,
482 mode_t mode,
483 SMB_DEV_T dev)
485 errno = ENOSYS;
486 return -1;
489 struct smb_filename *vfs_not_implemented_realpath(vfs_handle_struct *handle,
490 TALLOC_CTX *ctx,
491 const struct smb_filename *smb_fname)
493 errno = ENOSYS;
494 return NULL;
497 int vfs_not_implemented_chflags(vfs_handle_struct *handle,
498 const struct smb_filename *smb_fname,
499 uint flags)
501 errno = ENOSYS;
502 return -1;
505 struct file_id vfs_not_implemented_file_id_create(vfs_handle_struct *handle,
506 const SMB_STRUCT_STAT *sbuf)
508 struct file_id id;
509 ZERO_STRUCT(id);
510 errno = ENOSYS;
511 return id;
514 struct vfs_not_implemented_offload_read_state {
515 bool dummy;
518 struct tevent_req *vfs_not_implemented_offload_read_send(
519 TALLOC_CTX *mem_ctx,
520 struct tevent_context *ev,
521 struct vfs_handle_struct *handle,
522 struct files_struct *fsp,
523 uint32_t fsctl,
524 uint32_t ttl,
525 off_t offset,
526 size_t to_copy)
528 struct tevent_req *req = NULL;
529 struct vfs_not_implemented_offload_read_state *state = NULL;
531 req = tevent_req_create(mem_ctx, &state,
532 struct vfs_not_implemented_offload_read_state);
533 if (req == NULL) {
534 return NULL;
537 tevent_req_nterror(req, NT_STATUS_NOT_IMPLEMENTED);
538 return tevent_req_post(req, ev);
541 NTSTATUS vfs_not_implemented_offload_read_recv(struct tevent_req *req,
542 struct vfs_handle_struct *handle,
543 TALLOC_CTX *mem_ctx,
544 DATA_BLOB *_token_blob)
546 NTSTATUS status;
548 if (tevent_req_is_nterror(req, &status)) {
549 tevent_req_received(req);
550 return status;
553 tevent_req_received(req);
554 return NT_STATUS_OK;
557 struct vfs_not_implemented_offload_write_state {
558 uint64_t unused;
561 struct tevent_req *vfs_not_implemented_offload_write_send(
562 struct vfs_handle_struct *handle,
563 TALLOC_CTX *mem_ctx,
564 struct tevent_context *ev,
565 uint32_t fsctl,
566 DATA_BLOB *token,
567 off_t transfer_offset,
568 struct files_struct *dest_fsp,
569 off_t dest_off,
570 off_t num)
572 struct tevent_req *req;
573 struct vfs_not_implemented_offload_write_state *state;
575 req = tevent_req_create(mem_ctx, &state,
576 struct vfs_not_implemented_offload_write_state);
577 if (req == NULL) {
578 return NULL;
581 tevent_req_nterror(req, NT_STATUS_NOT_IMPLEMENTED);
582 return tevent_req_post(req, ev);
585 NTSTATUS vfs_not_implemented_offload_write_recv(struct vfs_handle_struct *handle,
586 struct tevent_req *req,
587 off_t *copied)
589 NTSTATUS status;
591 if (tevent_req_is_nterror(req, &status)) {
592 tevent_req_received(req);
593 return status;
596 tevent_req_received(req);
597 return NT_STATUS_OK;
600 NTSTATUS vfs_not_implemented_get_compression(struct vfs_handle_struct *handle,
601 TALLOC_CTX *mem_ctx,
602 struct files_struct *fsp,
603 struct smb_filename *smb_fname,
604 uint16_t *_compression_fmt)
606 return NT_STATUS_INVALID_DEVICE_REQUEST;
609 NTSTATUS vfs_not_implemented_set_compression(struct vfs_handle_struct *handle,
610 TALLOC_CTX *mem_ctx,
611 struct files_struct *fsp,
612 uint16_t compression_fmt)
614 return NT_STATUS_INVALID_DEVICE_REQUEST;
617 NTSTATUS vfs_not_implemented_streaminfo(struct vfs_handle_struct *handle,
618 struct files_struct *fsp,
619 const struct smb_filename *smb_fname,
620 TALLOC_CTX *mem_ctx,
621 unsigned int *num_streams,
622 struct stream_struct **streams)
624 return NT_STATUS_NOT_IMPLEMENTED;
627 int vfs_not_implemented_get_real_filename(struct vfs_handle_struct *handle,
628 const char *path,
629 const char *name,
630 TALLOC_CTX *mem_ctx,
631 char **found_name)
633 errno = ENOSYS;
634 return -1;
637 const char *vfs_not_implemented_connectpath(struct vfs_handle_struct *handle,
638 const struct smb_filename *smb_fname)
640 errno = ENOSYS;
641 return NULL;
644 NTSTATUS vfs_not_implemented_brl_lock_windows(struct vfs_handle_struct *handle,
645 struct byte_range_lock *br_lck,
646 struct lock_struct *plock,
647 bool blocking_lock)
649 return NT_STATUS_NOT_IMPLEMENTED;
652 bool vfs_not_implemented_brl_unlock_windows(struct vfs_handle_struct *handle,
653 struct messaging_context *msg_ctx,
654 struct byte_range_lock *br_lck,
655 const struct lock_struct *plock)
657 errno = ENOSYS;
658 return false;
661 bool vfs_not_implemented_brl_cancel_windows(struct vfs_handle_struct *handle,
662 struct byte_range_lock *br_lck,
663 struct lock_struct *plock)
665 errno = ENOSYS;
666 return false;
669 bool vfs_not_implemented_strict_lock_check(struct vfs_handle_struct *handle,
670 struct files_struct *fsp,
671 struct lock_struct *plock)
673 errno = ENOSYS;
674 return false;
677 NTSTATUS vfs_not_implemented_translate_name(struct vfs_handle_struct *handle,
678 const char *mapped_name,
679 enum vfs_translate_direction direction,
680 TALLOC_CTX *mem_ctx, char **pmapped_name)
682 return NT_STATUS_NOT_IMPLEMENTED;
685 NTSTATUS vfs_not_implemented_fsctl(struct vfs_handle_struct *handle,
686 struct files_struct *fsp,
687 TALLOC_CTX *ctx,
688 uint32_t function,
689 uint16_t req_flags, /* Needed for UNICODE ... */
690 const uint8_t *_in_data,
691 uint32_t in_len,
692 uint8_t **_out_data,
693 uint32_t max_out_len, uint32_t *out_len)
695 return NT_STATUS_NOT_IMPLEMENTED;
698 NTSTATUS vfs_not_implemented_readdir_attr(struct vfs_handle_struct *handle,
699 const struct smb_filename *fname,
700 TALLOC_CTX *mem_ctx,
701 struct readdir_attr_data **pattr_data)
703 return NT_STATUS_NOT_IMPLEMENTED;
706 NTSTATUS vfs_not_implemented_get_dos_attributes(struct vfs_handle_struct *handle,
707 struct smb_filename *smb_fname,
708 uint32_t *dosmode)
710 return NT_STATUS_NOT_IMPLEMENTED;
713 struct vfs_not_implemented_get_dos_attributes_state {
714 struct vfs_aio_state aio_state;
715 uint32_t dosmode;
718 struct tevent_req *vfs_not_implemented_get_dos_attributes_send(
719 TALLOC_CTX *mem_ctx,
720 struct tevent_context *ev,
721 struct vfs_handle_struct *handle,
722 files_struct *dir_fsp,
723 struct smb_filename *smb_fname)
725 struct tevent_req *req = NULL;
726 struct vfs_not_implemented_get_dos_attributes_state *state = NULL;
728 req = tevent_req_create(mem_ctx, &state,
729 struct vfs_not_implemented_get_dos_attributes_state);
730 if (req == NULL) {
731 return NULL;
734 tevent_req_nterror(req, NT_STATUS_NOT_IMPLEMENTED);
735 return tevent_req_post(req, ev);
738 NTSTATUS vfs_not_implemented_get_dos_attributes_recv(
739 struct tevent_req *req,
740 struct vfs_aio_state *aio_state,
741 uint32_t *dosmode)
743 struct vfs_not_implemented_get_dos_attributes_state *state =
744 tevent_req_data(req,
745 struct vfs_not_implemented_get_dos_attributes_state);
746 NTSTATUS status;
748 if (tevent_req_is_nterror(req, &status)) {
749 tevent_req_received(req);
750 return status;
753 *aio_state = state->aio_state;
754 *dosmode = state->dosmode;
755 tevent_req_received(req);
756 return NT_STATUS_OK;
759 NTSTATUS vfs_not_implemented_fget_dos_attributes(struct vfs_handle_struct *handle,
760 struct files_struct *fsp,
761 uint32_t *dosmode)
763 return NT_STATUS_NOT_IMPLEMENTED;
766 NTSTATUS vfs_not_implemented_set_dos_attributes(struct vfs_handle_struct *handle,
767 const struct smb_filename *smb_fname,
768 uint32_t dosmode)
770 return NT_STATUS_NOT_IMPLEMENTED;
773 NTSTATUS vfs_not_implemented_fset_dos_attributes(struct vfs_handle_struct *handle,
774 struct files_struct *fsp,
775 uint32_t dosmode)
777 return NT_STATUS_NOT_IMPLEMENTED;
780 NTSTATUS vfs_not_implemented_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
781 uint32_t security_info,
782 TALLOC_CTX *mem_ctx,
783 struct security_descriptor **ppdesc)
785 return NT_STATUS_NOT_IMPLEMENTED;
788 NTSTATUS vfs_not_implemented_get_nt_acl(vfs_handle_struct *handle,
789 const struct smb_filename *smb_fname,
790 uint32_t security_info,
791 TALLOC_CTX *mem_ctx,
792 struct security_descriptor **ppdesc)
794 return NT_STATUS_NOT_IMPLEMENTED;
797 NTSTATUS vfs_not_implemented_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
798 uint32_t security_info_sent,
799 const struct security_descriptor *psd)
801 return NT_STATUS_NOT_IMPLEMENTED;
804 SMB_ACL_T vfs_not_implemented_sys_acl_get_file(vfs_handle_struct *handle,
805 const struct smb_filename *smb_fname,
806 SMB_ACL_TYPE_T type,
807 TALLOC_CTX *mem_ctx)
809 errno = ENOSYS;
810 return (SMB_ACL_T) NULL;
813 SMB_ACL_T vfs_not_implemented_sys_acl_get_fd(vfs_handle_struct *handle,
814 files_struct *fsp, TALLOC_CTX *mem_ctx)
816 errno = ENOSYS;
817 return (SMB_ACL_T) NULL;
820 int vfs_not_implemented_sys_acl_blob_get_file(vfs_handle_struct *handle,
821 const struct smb_filename *smb_fname,
822 TALLOC_CTX *mem_ctx,
823 char **blob_description,
824 DATA_BLOB *blob)
826 errno = ENOSYS;
827 return -1;
830 int vfs_not_implemented_sys_acl_blob_get_fd(vfs_handle_struct *handle,
831 files_struct *fsp, TALLOC_CTX *mem_ctx,
832 char **blob_description, DATA_BLOB *blob)
834 errno = ENOSYS;
835 return -1;
838 int vfs_not_implemented_sys_acl_set_file(vfs_handle_struct *handle,
839 const struct smb_filename *smb_fname,
840 SMB_ACL_TYPE_T acltype,
841 SMB_ACL_T theacl)
843 errno = ENOSYS;
844 return -1;
847 int vfs_not_implemented_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,
848 SMB_ACL_T theacl)
850 errno = ENOSYS;
851 return -1;
854 int vfs_not_implemented_sys_acl_delete_def_file(vfs_handle_struct *handle,
855 const struct smb_filename *smb_fname)
857 errno = ENOSYS;
858 return -1;
861 ssize_t vfs_not_implemented_getxattr(vfs_handle_struct *handle,
862 const struct smb_filename *smb_fname,
863 const char *name,
864 void *value,
865 size_t size)
867 errno = ENOSYS;
868 return -1;
871 struct vfs_not_implemented_getxattrat_state {
872 struct vfs_aio_state aio_state;
873 ssize_t xattr_size;
874 uint8_t *xattr_value;
877 struct tevent_req *vfs_not_implemented_getxattrat_send(
878 TALLOC_CTX *mem_ctx,
879 struct tevent_context *ev,
880 struct vfs_handle_struct *handle,
881 files_struct *dir_fsp,
882 const struct smb_filename *smb_fname,
883 const char *xattr_name,
884 size_t alloc_hint)
886 struct tevent_req *req = NULL;
887 struct vfs_not_implemented_getxattrat_state *state = NULL;
889 req = tevent_req_create(mem_ctx, &state,
890 struct vfs_not_implemented_getxattrat_state);
891 if (req == NULL) {
892 return NULL;
895 tevent_req_error(req, ENOSYS);
896 return tevent_req_post(req, ev);
899 ssize_t vfs_not_implemented_getxattrat_recv(struct tevent_req *req,
900 struct vfs_aio_state *aio_state,
901 TALLOC_CTX *mem_ctx,
902 uint8_t **xattr_value)
904 struct vfs_not_implemented_getxattrat_state *state = tevent_req_data(
905 req, struct vfs_not_implemented_getxattrat_state);
906 ssize_t xattr_size;
908 if (tevent_req_is_unix_error(req, &aio_state->error)) {
909 tevent_req_received(req);
910 return -1;
913 *aio_state = state->aio_state;
914 xattr_size = state->xattr_size;
915 if (xattr_value != NULL) {
916 *xattr_value = talloc_move(mem_ctx, &state->xattr_value);
919 tevent_req_received(req);
920 return xattr_size;
923 ssize_t vfs_not_implemented_fgetxattr(vfs_handle_struct *handle,
924 struct files_struct *fsp, const char *name,
925 void *value, size_t size)
927 errno = ENOSYS;
928 return -1;
931 ssize_t vfs_not_implemented_listxattr(vfs_handle_struct *handle,
932 const struct smb_filename *smb_fname,
933 char *list,
934 size_t size)
936 errno = ENOSYS;
937 return -1;
940 ssize_t vfs_not_implemented_flistxattr(vfs_handle_struct *handle,
941 struct files_struct *fsp, char *list,
942 size_t size)
944 errno = ENOSYS;
945 return -1;
948 int vfs_not_implemented_removexattr(vfs_handle_struct *handle,
949 const struct smb_filename *smb_fname,
950 const char *name)
952 errno = ENOSYS;
953 return -1;
956 int vfs_not_implemented_fremovexattr(vfs_handle_struct *handle,
957 struct files_struct *fsp, const char *name)
959 errno = ENOSYS;
960 return -1;
963 int vfs_not_implemented_setxattr(vfs_handle_struct *handle,
964 const struct smb_filename *smb_fname,
965 const char *name,
966 const void *value,
967 size_t size,
968 int flags)
970 errno = ENOSYS;
971 return -1;
974 int vfs_not_implemented_fsetxattr(vfs_handle_struct *handle, struct files_struct *fsp,
975 const char *name, const void *value, size_t size,
976 int flags)
978 errno = ENOSYS;
979 return -1;
982 bool vfs_not_implemented_aio_force(struct vfs_handle_struct *handle,
983 struct files_struct *fsp)
985 errno = ENOSYS;
986 return false;
989 NTSTATUS vfs_not_implemented_audit_file(struct vfs_handle_struct *handle,
990 struct smb_filename *file,
991 struct security_acl *sacl,
992 uint32_t access_requested,
993 uint32_t access_denied)
995 return NT_STATUS_NOT_IMPLEMENTED;
998 NTSTATUS vfs_not_implemented_durable_cookie(struct vfs_handle_struct *handle,
999 struct files_struct *fsp,
1000 TALLOC_CTX *mem_ctx,
1001 DATA_BLOB *cookie)
1003 return NT_STATUS_NOT_IMPLEMENTED;
1006 NTSTATUS vfs_not_implemented_durable_disconnect(struct vfs_handle_struct *handle,
1007 struct files_struct *fsp,
1008 const DATA_BLOB old_cookie,
1009 TALLOC_CTX *mem_ctx,
1010 DATA_BLOB *new_cookie)
1012 return NT_STATUS_NOT_IMPLEMENTED;
1015 NTSTATUS vfs_not_implemented_durable_reconnect(struct vfs_handle_struct *handle,
1016 struct smb_request *smb1req,
1017 struct smbXsrv_open *op,
1018 const DATA_BLOB old_cookie,
1019 TALLOC_CTX *mem_ctx,
1020 struct files_struct **fsp,
1021 DATA_BLOB *new_cookie)
1023 return NT_STATUS_NOT_IMPLEMENTED;
1026 /* VFS operations structure */
1028 static struct vfs_fn_pointers vfs_not_implemented_fns = {
1029 /* Disk operations */
1031 .connect_fn = vfs_not_implemented_connect,
1032 .disconnect_fn = vfs_not_implemented_disconnect,
1033 .disk_free_fn = vfs_not_implemented_disk_free,
1034 .get_quota_fn = vfs_not_implemented_get_quota,
1035 .set_quota_fn = vfs_not_implemented_set_quota,
1036 .get_shadow_copy_data_fn = vfs_not_implemented_get_shadow_copy_data,
1037 .statvfs_fn = vfs_not_implemented_statvfs,
1038 .fs_capabilities_fn = vfs_not_implemented_fs_capabilities,
1039 .get_dfs_referrals_fn = vfs_not_implemented_get_dfs_referrals,
1040 .snap_check_path_fn = vfs_not_implemented_snap_check_path,
1041 .snap_create_fn = vfs_not_implemented_snap_create,
1042 .snap_delete_fn = vfs_not_implemented_snap_delete,
1044 /* Directory operations */
1046 .opendir_fn = vfs_not_implemented_opendir,
1047 .fdopendir_fn = vfs_not_implemented_fdopendir,
1048 .readdir_fn = vfs_not_implemented_readdir,
1049 .seekdir_fn = vfs_not_implemented_seekdir,
1050 .telldir_fn = vfs_not_implemented_telldir,
1051 .rewind_dir_fn = vfs_not_implemented_rewind_dir,
1052 .mkdir_fn = vfs_not_implemented_mkdir,
1053 .rmdir_fn = vfs_not_implemented_rmdir,
1054 .closedir_fn = vfs_not_implemented_closedir,
1056 /* File operations */
1058 .open_fn = vfs_not_implemented_open,
1059 .create_file_fn = vfs_not_implemented_create_file,
1060 .close_fn = vfs_not_implemented_close_fn,
1061 .pread_fn = vfs_not_implemented_pread,
1062 .pread_send_fn = vfs_not_implemented_pread_send,
1063 .pread_recv_fn = vfs_not_implemented_pread_recv,
1064 .pwrite_fn = vfs_not_implemented_pwrite,
1065 .pwrite_send_fn = vfs_not_implemented_pwrite_send,
1066 .pwrite_recv_fn = vfs_not_implemented_pwrite_recv,
1067 .lseek_fn = vfs_not_implemented_lseek,
1068 .sendfile_fn = vfs_not_implemented_sendfile,
1069 .recvfile_fn = vfs_not_implemented_recvfile,
1070 .rename_fn = vfs_not_implemented_rename,
1071 .fsync_send_fn = vfs_not_implemented_fsync_send,
1072 .fsync_recv_fn = vfs_not_implemented_fsync_recv,
1073 .stat_fn = vfs_not_implemented_stat,
1074 .fstat_fn = vfs_not_implemented_fstat,
1075 .lstat_fn = vfs_not_implemented_lstat,
1076 .get_alloc_size_fn = vfs_not_implemented_get_alloc_size,
1077 .unlink_fn = vfs_not_implemented_unlink,
1078 .chmod_fn = vfs_not_implemented_chmod,
1079 .fchmod_fn = vfs_not_implemented_fchmod,
1080 .chown_fn = vfs_not_implemented_chown,
1081 .fchown_fn = vfs_not_implemented_fchown,
1082 .lchown_fn = vfs_not_implemented_lchown,
1083 .chdir_fn = vfs_not_implemented_chdir,
1084 .getwd_fn = vfs_not_implemented_getwd,
1085 .ntimes_fn = vfs_not_implemented_ntimes,
1086 .ftruncate_fn = vfs_not_implemented_ftruncate,
1087 .fallocate_fn = vfs_not_implemented_fallocate,
1088 .lock_fn = vfs_not_implemented_lock,
1089 .kernel_flock_fn = vfs_not_implemented_kernel_flock,
1090 .linux_setlease_fn = vfs_not_implemented_linux_setlease,
1091 .getlock_fn = vfs_not_implemented_getlock,
1092 .symlink_fn = vfs_not_implemented_symlink,
1093 .readlink_fn = vfs_not_implemented_vfs_readlink,
1094 .link_fn = vfs_not_implemented_link,
1095 .mknod_fn = vfs_not_implemented_mknod,
1096 .realpath_fn = vfs_not_implemented_realpath,
1097 .chflags_fn = vfs_not_implemented_chflags,
1098 .file_id_create_fn = vfs_not_implemented_file_id_create,
1099 .offload_read_send_fn = vfs_not_implemented_offload_read_send,
1100 .offload_read_recv_fn = vfs_not_implemented_offload_read_recv,
1101 .offload_write_send_fn = vfs_not_implemented_offload_write_send,
1102 .offload_write_recv_fn = vfs_not_implemented_offload_write_recv,
1103 .get_compression_fn = vfs_not_implemented_get_compression,
1104 .set_compression_fn = vfs_not_implemented_set_compression,
1106 .streaminfo_fn = vfs_not_implemented_streaminfo,
1107 .get_real_filename_fn = vfs_not_implemented_get_real_filename,
1108 .connectpath_fn = vfs_not_implemented_connectpath,
1109 .brl_lock_windows_fn = vfs_not_implemented_brl_lock_windows,
1110 .brl_unlock_windows_fn = vfs_not_implemented_brl_unlock_windows,
1111 .brl_cancel_windows_fn = vfs_not_implemented_brl_cancel_windows,
1112 .strict_lock_check_fn = vfs_not_implemented_strict_lock_check,
1113 .translate_name_fn = vfs_not_implemented_translate_name,
1114 .fsctl_fn = vfs_not_implemented_fsctl,
1115 .readdir_attr_fn = vfs_not_implemented_readdir_attr,
1116 .audit_file_fn = vfs_not_implemented_audit_file,
1118 /* DOS attributes. */
1119 .get_dos_attributes_fn = vfs_not_implemented_get_dos_attributes,
1120 .get_dos_attributes_send_fn = vfs_not_implemented_get_dos_attributes_send,
1121 .get_dos_attributes_recv_fn = vfs_not_implemented_get_dos_attributes_recv,
1122 .fget_dos_attributes_fn = vfs_not_implemented_fget_dos_attributes,
1123 .set_dos_attributes_fn = vfs_not_implemented_set_dos_attributes,
1124 .fset_dos_attributes_fn = vfs_not_implemented_fset_dos_attributes,
1126 /* NT ACL operations. */
1128 .fget_nt_acl_fn = vfs_not_implemented_fget_nt_acl,
1129 .get_nt_acl_fn = vfs_not_implemented_get_nt_acl,
1130 .fset_nt_acl_fn = vfs_not_implemented_fset_nt_acl,
1132 /* POSIX ACL operations. */
1134 .sys_acl_get_file_fn = vfs_not_implemented_sys_acl_get_file,
1135 .sys_acl_get_fd_fn = vfs_not_implemented_sys_acl_get_fd,
1136 .sys_acl_blob_get_file_fn = vfs_not_implemented_sys_acl_blob_get_file,
1137 .sys_acl_blob_get_fd_fn = vfs_not_implemented_sys_acl_blob_get_fd,
1138 .sys_acl_set_file_fn = vfs_not_implemented_sys_acl_set_file,
1139 .sys_acl_set_fd_fn = vfs_not_implemented_sys_acl_set_fd,
1140 .sys_acl_delete_def_file_fn = vfs_not_implemented_sys_acl_delete_def_file,
1142 /* EA operations. */
1143 .getxattr_fn = vfs_not_implemented_getxattr,
1144 .getxattrat_send_fn = vfs_not_implemented_getxattrat_send,
1145 .getxattrat_recv_fn = vfs_not_implemented_getxattrat_recv,
1146 .fgetxattr_fn = vfs_not_implemented_fgetxattr,
1147 .listxattr_fn = vfs_not_implemented_listxattr,
1148 .flistxattr_fn = vfs_not_implemented_flistxattr,
1149 .removexattr_fn = vfs_not_implemented_removexattr,
1150 .fremovexattr_fn = vfs_not_implemented_fremovexattr,
1151 .setxattr_fn = vfs_not_implemented_setxattr,
1152 .fsetxattr_fn = vfs_not_implemented_fsetxattr,
1154 /* aio operations */
1155 .aio_force_fn = vfs_not_implemented_aio_force,
1157 /* durable handle operations */
1158 .durable_cookie_fn = vfs_not_implemented_durable_cookie,
1159 .durable_disconnect_fn = vfs_not_implemented_durable_disconnect,
1160 .durable_reconnect_fn = vfs_not_implemented_durable_reconnect,
1163 static_decl_vfs;
1164 NTSTATUS vfs_not_implemented_init(TALLOC_CTX *ctx)
1167 * smb_vfs_assert_all_fns() makes sure every
1168 * call is implemented.
1170 smb_vfs_assert_all_fns(&vfs_not_implemented_fns, "vfs_not_implemented");
1171 return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "vfs_not_implemented",
1172 &vfs_not_implemented_fns);