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