Coverage Report

Created: 2025-11-16 06:57

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