2 * Skeleton VFS module. Implements passthrough operation of all VFS
3 * calls to disk functions.
5 * Copyright (C) Tim Potter, 1999-2000
6 * Copyright (C) Alexander Bokovoy, 2002
7 * Copyright (C) Stefan (metze) Metzmacher, 2003
8 * Copyright (C) Jeremy Allison 2009
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 3 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, see <http://www.gnu.org/licenses/>.
25 #include "../source3/include/includes.h"
26 #include "smbd/proto.h"
28 /* PLEASE,PLEASE READ THE VFS MODULES CHAPTER OF THE
29 SAMBA DEVELOPERS GUIDE!!!!!!
32 /* If you take this file as template for your module
33 * please make sure that you remove all skel_XXX() functions you don't
34 * want to implement!! The passthrough operations are not
35 * neccessary in a real module.
40 static int skel_connect(vfs_handle_struct
*handle
, const char *service
, const char *user
)
42 return SMB_VFS_NEXT_CONNECT(handle
, service
, user
);
45 static void skel_disconnect(vfs_handle_struct
*handle
)
47 SMB_VFS_NEXT_DISCONNECT(handle
);
50 static uint64_t skel_disk_free(vfs_handle_struct
*handle
, const char *path
,
51 bool small_query
, uint64_t *bsize
,
52 uint64_t *dfree
, uint64_t *dsize
)
54 return SMB_VFS_NEXT_DISK_FREE(handle
, path
, small_query
, bsize
,
58 static int skel_get_quota(vfs_handle_struct
*handle
, enum SMB_QUOTA_TYPE qtype
, unid_t id
, SMB_DISK_QUOTA
*dq
)
60 return SMB_VFS_NEXT_GET_QUOTA(handle
, qtype
, id
, dq
);
63 static int skel_set_quota(vfs_handle_struct
*handle
, enum SMB_QUOTA_TYPE qtype
, unid_t id
, SMB_DISK_QUOTA
*dq
)
65 return SMB_VFS_NEXT_SET_QUOTA(handle
, qtype
, id
, dq
);
68 static int skel_get_shadow_copy_data(vfs_handle_struct
*handle
, files_struct
*fsp
, struct shadow_copy_data
*shadow_copy_data
, bool labels
)
70 return SMB_VFS_NEXT_GET_SHADOW_COPY_DATA(handle
, fsp
, shadow_copy_data
, labels
);
73 static int skel_statvfs(struct vfs_handle_struct
*handle
, const char *path
, struct vfs_statvfs_struct
*statbuf
)
75 return SMB_VFS_NEXT_STATVFS(handle
, path
, statbuf
);
78 static uint32_t skel_fs_capabilities(struct vfs_handle_struct
*handle
, enum timestamp_set_resolution
*p_ts_res
)
80 return SMB_VFS_NEXT_FS_CAPABILITIES(handle
, p_ts_res
);
83 static NTSTATUS
skel_get_dfs_referrals(struct vfs_handle_struct
*handle
,
84 struct dfs_GetDFSReferral
*r
)
86 return SMB_VFS_NEXT_GET_DFS_REFERRALS(handle
, r
);
89 static SMB_STRUCT_DIR
*skel_opendir(vfs_handle_struct
*handle
, const char *fname
, const char *mask
, uint32 attr
)
91 return SMB_VFS_NEXT_OPENDIR(handle
, fname
, mask
, attr
);
94 static SMB_STRUCT_DIR
*skel_fdopendir(vfs_handle_struct
*handle
, files_struct
*fsp
, const char *mask
, uint32 attr
)
96 return SMB_VFS_NEXT_FDOPENDIR(handle
, fsp
, mask
, attr
);
99 static struct dirent
*skel_readdir(vfs_handle_struct
*handle
,
100 SMB_STRUCT_DIR
*dirp
,
101 SMB_STRUCT_STAT
*sbuf
)
103 return SMB_VFS_NEXT_READDIR(handle
, dirp
, sbuf
);
106 static void skel_seekdir(vfs_handle_struct
*handle
, SMB_STRUCT_DIR
*dirp
, long offset
)
108 SMB_VFS_NEXT_SEEKDIR(handle
, dirp
, offset
);
111 static long skel_telldir(vfs_handle_struct
*handle
, SMB_STRUCT_DIR
*dirp
)
113 return SMB_VFS_NEXT_TELLDIR(handle
, dirp
);
116 static void skel_rewind_dir(vfs_handle_struct
*handle
, SMB_STRUCT_DIR
*dirp
)
118 SMB_VFS_NEXT_REWINDDIR(handle
, dirp
);
121 static int skel_mkdir(vfs_handle_struct
*handle
, const char *path
, mode_t mode
)
123 return SMB_VFS_NEXT_MKDIR(handle
, path
, mode
);
126 static int skel_rmdir(vfs_handle_struct
*handle
, const char *path
)
128 return SMB_VFS_NEXT_RMDIR(handle
, path
);
131 static int skel_closedir(vfs_handle_struct
*handle
, SMB_STRUCT_DIR
*dir
)
133 return SMB_VFS_NEXT_CLOSEDIR(handle
, dir
);
136 static void skel_init_search_op(struct vfs_handle_struct
*handle
, SMB_STRUCT_DIR
*dirp
)
138 SMB_VFS_NEXT_INIT_SEARCH_OP(handle
, dirp
);
141 static int skel_open(vfs_handle_struct
*handle
, struct smb_filename
*smb_fname
,
142 files_struct
*fsp
, int flags
, mode_t mode
)
144 return SMB_VFS_NEXT_OPEN(handle
, smb_fname
, fsp
, flags
, mode
);
147 static NTSTATUS
skel_create_file(struct vfs_handle_struct
*handle
,
148 struct smb_request
*req
,
149 uint16_t root_dir_fid
,
150 struct smb_filename
*smb_fname
,
151 uint32_t access_mask
,
152 uint32_t share_access
,
153 uint32_t create_disposition
,
154 uint32_t create_options
,
155 uint32_t file_attributes
,
156 uint32_t oplock_request
,
157 uint64_t allocation_size
,
158 uint32_t private_flags
,
159 struct security_descriptor
*sd
,
160 struct ea_list
*ea_list
,
161 files_struct
**result
,
164 return SMB_VFS_NEXT_CREATE_FILE(handle
,
182 static int skel_close_fn(vfs_handle_struct
*handle
, files_struct
*fsp
)
184 return SMB_VFS_NEXT_CLOSE(handle
, fsp
);
187 static ssize_t
skel_vfs_read(vfs_handle_struct
*handle
, files_struct
*fsp
, void *data
, size_t n
)
189 return SMB_VFS_NEXT_READ(handle
, fsp
, data
, n
);
192 static ssize_t
skel_pread(vfs_handle_struct
*handle
, files_struct
*fsp
, void *data
, size_t n
, SMB_OFF_T offset
)
194 return SMB_VFS_NEXT_PREAD(handle
, fsp
, data
, n
, offset
);
197 static ssize_t
skel_write(vfs_handle_struct
*handle
, files_struct
*fsp
, const void *data
, size_t n
)
199 return SMB_VFS_NEXT_WRITE(handle
, fsp
, data
, n
);
202 static ssize_t
skel_pwrite(vfs_handle_struct
*handle
, files_struct
*fsp
, const void *data
, size_t n
, SMB_OFF_T offset
)
204 return SMB_VFS_NEXT_PWRITE(handle
, fsp
, data
, n
, offset
);
207 static SMB_OFF_T
skel_lseek(vfs_handle_struct
*handle
, files_struct
*fsp
, SMB_OFF_T offset
, int whence
)
209 return SMB_VFS_NEXT_LSEEK(handle
, fsp
, offset
, whence
);
212 static ssize_t
skel_sendfile(vfs_handle_struct
*handle
, int tofd
, files_struct
*fromfsp
, const DATA_BLOB
*hdr
, SMB_OFF_T offset
, size_t n
)
214 return SMB_VFS_NEXT_SENDFILE(handle
, tofd
, fromfsp
, hdr
, offset
, n
);
217 static ssize_t
skel_recvfile(vfs_handle_struct
*handle
, int fromfd
, files_struct
*tofsp
, SMB_OFF_T offset
, size_t n
)
219 return SMB_VFS_NEXT_RECVFILE(handle
, fromfd
, tofsp
, offset
, n
);
222 static int skel_rename(vfs_handle_struct
*handle
,
223 const struct smb_filename
*smb_fname_src
,
224 const struct smb_filename
*smb_fname_dst
)
226 return SMB_VFS_NEXT_RENAME(handle
, smb_fname_src
, smb_fname_dst
);
229 static int skel_fsync(vfs_handle_struct
*handle
, files_struct
*fsp
)
231 return SMB_VFS_NEXT_FSYNC(handle
, fsp
);
234 static int skel_stat(vfs_handle_struct
*handle
, struct smb_filename
*smb_fname
)
236 return SMB_VFS_NEXT_STAT(handle
, smb_fname
);
239 static int skel_fstat(vfs_handle_struct
*handle
, files_struct
*fsp
, SMB_STRUCT_STAT
*sbuf
)
241 return SMB_VFS_NEXT_FSTAT(handle
, fsp
, sbuf
);
244 static int skel_lstat(vfs_handle_struct
*handle
, struct smb_filename
*smb_fname
)
246 return SMB_VFS_NEXT_LSTAT(handle
, smb_fname
);
249 static uint64_t skel_get_alloc_size(struct vfs_handle_struct
*handle
, struct files_struct
*fsp
, const SMB_STRUCT_STAT
*sbuf
)
251 return SMB_VFS_NEXT_GET_ALLOC_SIZE(handle
, fsp
, sbuf
);
254 static int skel_unlink(vfs_handle_struct
*handle
,
255 const struct smb_filename
*smb_fname
)
257 return SMB_VFS_NEXT_UNLINK(handle
, smb_fname
);
260 static int skel_chmod(vfs_handle_struct
*handle
, const char *path
, mode_t mode
)
262 return SMB_VFS_NEXT_CHMOD(handle
, path
, mode
);
265 static int skel_fchmod(vfs_handle_struct
*handle
, files_struct
*fsp
, mode_t mode
)
267 return SMB_VFS_NEXT_FCHMOD(handle
, fsp
, mode
);
270 static int skel_chown(vfs_handle_struct
*handle
, const char *path
, uid_t uid
, gid_t gid
)
272 return SMB_VFS_NEXT_CHOWN(handle
, path
, uid
, gid
);
275 static int skel_fchown(vfs_handle_struct
*handle
, files_struct
*fsp
, uid_t uid
, gid_t gid
)
277 return SMB_VFS_NEXT_FCHOWN(handle
, fsp
, uid
, gid
);
280 static int skel_lchown(vfs_handle_struct
*handle
, const char *path
, uid_t uid
, gid_t gid
)
282 return SMB_VFS_NEXT_LCHOWN(handle
, path
, uid
, gid
);
285 static int skel_chdir(vfs_handle_struct
*handle
, const char *path
)
287 return SMB_VFS_NEXT_CHDIR(handle
, path
);
290 static char *skel_getwd(vfs_handle_struct
*handle
)
292 return SMB_VFS_NEXT_GETWD(handle
);
295 static int skel_ntimes(vfs_handle_struct
*handle
,
296 const struct smb_filename
*smb_fname
,
297 struct smb_file_time
*ft
)
299 return SMB_VFS_NEXT_NTIMES(handle
, smb_fname
, ft
);
302 static int skel_ftruncate(vfs_handle_struct
*handle
, files_struct
*fsp
, SMB_OFF_T offset
)
304 return SMB_VFS_NEXT_FTRUNCATE(handle
, fsp
, offset
);
307 static int skel_fallocate(vfs_handle_struct
*handle
, files_struct
*fsp
,
308 enum vfs_fallocate_mode mode
,
312 return SMB_VFS_NEXT_FALLOCATE(handle
, fsp
, mode
, offset
, len
);
315 static bool skel_lock(vfs_handle_struct
*handle
, files_struct
*fsp
, int op
, SMB_OFF_T offset
, SMB_OFF_T count
, int type
)
317 return SMB_VFS_NEXT_LOCK(handle
, fsp
, op
, offset
, count
, type
);
320 static int skel_kernel_flock(struct vfs_handle_struct
*handle
, struct files_struct
*fsp
, uint32 share_mode
, uint32 access_mask
)
322 return SMB_VFS_NEXT_KERNEL_FLOCK(handle
, fsp
, share_mode
, access_mask
);
325 static int skel_linux_setlease(struct vfs_handle_struct
*handle
, struct files_struct
*fsp
, int leasetype
)
327 return SMB_VFS_NEXT_LINUX_SETLEASE(handle
, fsp
, leasetype
);
330 static bool skel_getlock(vfs_handle_struct
*handle
, files_struct
*fsp
, SMB_OFF_T
*poffset
, SMB_OFF_T
*pcount
, int *ptype
, pid_t
*ppid
)
332 return SMB_VFS_NEXT_GETLOCK(handle
, fsp
, poffset
, pcount
, ptype
, ppid
);
335 static int skel_symlink(vfs_handle_struct
*handle
, const char *oldpath
, const char *newpath
)
337 return SMB_VFS_NEXT_SYMLINK(handle
, oldpath
, newpath
);
340 static int skel_vfs_readlink(vfs_handle_struct
*handle
, const char *path
, char *buf
, size_t bufsiz
)
342 return SMB_VFS_NEXT_READLINK(handle
, path
, buf
, bufsiz
);
345 static int skel_link(vfs_handle_struct
*handle
, const char *oldpath
, const char *newpath
)
347 return SMB_VFS_NEXT_LINK(handle
, oldpath
, newpath
);
350 static int skel_mknod(vfs_handle_struct
*handle
, const char *path
, mode_t mode
, SMB_DEV_T dev
)
352 return SMB_VFS_NEXT_MKNOD(handle
, path
, mode
, dev
);
355 static char *skel_realpath(vfs_handle_struct
*handle
, const char *path
)
357 return SMB_VFS_NEXT_REALPATH(handle
, path
);
360 static NTSTATUS
skel_notify_watch(
361 struct vfs_handle_struct
*handle
,
362 struct sys_notify_context
*ctx
,
365 uint32_t *subdir_filter
,
366 void (*callback
)(struct sys_notify_context
*ctx
, void *private_data
,
367 struct notify_event
*ev
),
368 void *private_data
, void *handle_p
)
370 return SMB_VFS_NEXT_NOTIFY_WATCH(handle
, ctx
, path
,
371 filter
, subdir_filter
, callback
,
372 private_data
, handle_p
);
375 static int skel_chflags(vfs_handle_struct
*handle
, const char *path
, uint flags
)
377 return SMB_VFS_NEXT_CHFLAGS(handle
, path
, flags
);
380 static struct file_id
skel_file_id_create(vfs_handle_struct
*handle
,
381 const SMB_STRUCT_STAT
*sbuf
)
383 return SMB_VFS_NEXT_FILE_ID_CREATE(handle
, sbuf
);
386 static NTSTATUS
skel_streaminfo(struct vfs_handle_struct
*handle
,
387 struct files_struct
*fsp
,
390 unsigned int *num_streams
,
391 struct stream_struct
**streams
)
393 return SMB_VFS_NEXT_STREAMINFO(handle
,
401 static int skel_get_real_filename(struct vfs_handle_struct
*handle
,
407 return SMB_VFS_NEXT_GET_REAL_FILENAME(handle
,
414 static const char *skel_connectpath(struct vfs_handle_struct
*handle
,
415 const char *filename
)
417 return SMB_VFS_NEXT_CONNECTPATH(handle
, filename
);
420 static NTSTATUS
skel_brl_lock_windows(struct vfs_handle_struct
*handle
,
421 struct byte_range_lock
*br_lck
,
422 struct lock_struct
*plock
,
424 struct blocking_lock_record
*blr
)
426 return SMB_VFS_NEXT_BRL_LOCK_WINDOWS(handle
,
433 static bool skel_brl_unlock_windows(struct vfs_handle_struct
*handle
,
434 struct messaging_context
*msg_ctx
,
435 struct byte_range_lock
*br_lck
,
436 const struct lock_struct
*plock
)
438 return SMB_VFS_NEXT_BRL_UNLOCK_WINDOWS(handle
,
444 static bool skel_brl_cancel_windows(struct vfs_handle_struct
*handle
,
445 struct byte_range_lock
*br_lck
,
446 struct lock_struct
*plock
,
447 struct blocking_lock_record
*blr
)
449 return SMB_VFS_NEXT_BRL_CANCEL_WINDOWS(handle
,
455 static bool skel_strict_lock(struct vfs_handle_struct
*handle
,
456 struct files_struct
*fsp
,
457 struct lock_struct
*plock
)
459 return SMB_VFS_NEXT_STRICT_LOCK(handle
,
464 static void skel_strict_unlock(struct vfs_handle_struct
*handle
,
465 struct files_struct
*fsp
,
466 struct lock_struct
*plock
)
468 SMB_VFS_NEXT_STRICT_UNLOCK(handle
,
473 static NTSTATUS
skel_translate_name(struct vfs_handle_struct
*handle
,
474 const char *mapped_name
,
475 enum vfs_translate_direction direction
,
479 return SMB_VFS_NEXT_TRANSLATE_NAME(handle
, mapped_name
, direction
,
480 mem_ctx
, pmapped_name
);
483 static NTSTATUS
skel_fsctl(struct vfs_handle_struct
*handle
,
484 struct files_struct
*fsp
,
487 uint16_t req_flags
, /* Needed for UNICODE ... */
488 const uint8_t *_in_data
,
491 uint32_t max_out_len
,
494 return SMB_VFS_NEXT_FSCTL(handle
,
506 static NTSTATUS
skel_fget_nt_acl(vfs_handle_struct
*handle
, files_struct
*fsp
,
507 uint32 security_info
, struct security_descriptor
**ppdesc
)
509 return SMB_VFS_NEXT_FGET_NT_ACL(handle
, fsp
, security_info
, ppdesc
);
512 static NTSTATUS
skel_get_nt_acl(vfs_handle_struct
*handle
,
513 const char *name
, uint32 security_info
, struct security_descriptor
**ppdesc
)
515 return SMB_VFS_NEXT_GET_NT_ACL(handle
, name
, security_info
, ppdesc
);
518 static NTSTATUS
skel_fset_nt_acl(vfs_handle_struct
*handle
, files_struct
*fsp
,
519 uint32 security_info_sent
, const struct security_descriptor
*psd
)
521 return SMB_VFS_NEXT_FSET_NT_ACL(handle
, fsp
, security_info_sent
, psd
);
524 static int skel_chmod_acl(vfs_handle_struct
*handle
, const char *name
, mode_t mode
)
526 return SMB_VFS_NEXT_CHMOD_ACL(handle
, name
, mode
);
529 static int skel_fchmod_acl(vfs_handle_struct
*handle
, files_struct
*fsp
, mode_t mode
)
531 return SMB_VFS_NEXT_FCHMOD_ACL(handle
, fsp
, mode
);
534 static int skel_sys_acl_get_entry(vfs_handle_struct
*handle
, SMB_ACL_T theacl
, int entry_id
, SMB_ACL_ENTRY_T
*entry_p
)
536 return SMB_VFS_NEXT_SYS_ACL_GET_ENTRY(handle
, theacl
, entry_id
, entry_p
);
539 static int skel_sys_acl_get_tag_type(vfs_handle_struct
*handle
, SMB_ACL_ENTRY_T entry_d
, SMB_ACL_TAG_T
*tag_type_p
)
541 return SMB_VFS_NEXT_SYS_ACL_GET_TAG_TYPE(handle
, entry_d
, tag_type_p
);
544 static int skel_sys_acl_get_permset(vfs_handle_struct
*handle
, SMB_ACL_ENTRY_T entry_d
, SMB_ACL_PERMSET_T
*permset_p
)
546 return SMB_VFS_NEXT_SYS_ACL_GET_PERMSET(handle
, entry_d
, permset_p
);
549 static void *skel_sys_acl_get_qualifier(vfs_handle_struct
*handle
, SMB_ACL_ENTRY_T entry_d
)
551 return SMB_VFS_NEXT_SYS_ACL_GET_QUALIFIER(handle
, entry_d
);
554 static SMB_ACL_T
skel_sys_acl_get_file(vfs_handle_struct
*handle
, const char *path_p
, SMB_ACL_TYPE_T type
)
556 return SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle
, path_p
, type
);
559 static SMB_ACL_T
skel_sys_acl_get_fd(vfs_handle_struct
*handle
, files_struct
*fsp
)
561 return SMB_VFS_NEXT_SYS_ACL_GET_FD(handle
, fsp
);
564 static int skel_sys_acl_clear_perms(vfs_handle_struct
*handle
, SMB_ACL_PERMSET_T permset
)
566 return SMB_VFS_NEXT_SYS_ACL_CLEAR_PERMS(handle
, permset
);
569 static int skel_sys_acl_add_perm(vfs_handle_struct
*handle
, SMB_ACL_PERMSET_T permset
, SMB_ACL_PERM_T perm
)
571 return SMB_VFS_NEXT_SYS_ACL_ADD_PERM(handle
, permset
, perm
);
574 static char *skel_sys_acl_to_text(vfs_handle_struct
*handle
, SMB_ACL_T theacl
, ssize_t
*plen
)
576 return SMB_VFS_NEXT_SYS_ACL_TO_TEXT(handle
, theacl
, plen
);
579 static SMB_ACL_T
skel_sys_acl_init(vfs_handle_struct
*handle
, int count
)
581 return SMB_VFS_NEXT_SYS_ACL_INIT(handle
, count
);
584 static int skel_sys_acl_create_entry(vfs_handle_struct
*handle
, SMB_ACL_T
*pacl
, SMB_ACL_ENTRY_T
*pentry
)
586 return SMB_VFS_NEXT_SYS_ACL_CREATE_ENTRY(handle
, pacl
, pentry
);
589 static int skel_sys_acl_set_tag_type(vfs_handle_struct
*handle
, SMB_ACL_ENTRY_T entry
, SMB_ACL_TAG_T tagtype
)
591 return SMB_VFS_NEXT_SYS_ACL_SET_TAG_TYPE(handle
, entry
, tagtype
);
594 static int skel_sys_acl_set_qualifier(vfs_handle_struct
*handle
, SMB_ACL_ENTRY_T entry
, void *qual
)
596 return SMB_VFS_NEXT_SYS_ACL_SET_QUALIFIER(handle
, entry
, qual
);
599 static int skel_sys_acl_set_permset(vfs_handle_struct
*handle
, SMB_ACL_ENTRY_T entry
, SMB_ACL_PERMSET_T permset
)
601 return SMB_VFS_NEXT_SYS_ACL_SET_PERMSET(handle
, entry
, permset
);
604 static int skel_sys_acl_valid(vfs_handle_struct
*handle
, SMB_ACL_T theacl
)
606 return SMB_VFS_NEXT_SYS_ACL_VALID(handle
, theacl
);
609 static int skel_sys_acl_set_file(vfs_handle_struct
*handle
, const char *name
, SMB_ACL_TYPE_T acltype
, SMB_ACL_T theacl
)
611 return SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle
, name
, acltype
, theacl
);
614 static int skel_sys_acl_set_fd(vfs_handle_struct
*handle
, files_struct
*fsp
, SMB_ACL_T theacl
)
616 return SMB_VFS_NEXT_SYS_ACL_SET_FD(handle
, fsp
, theacl
);
619 static int skel_sys_acl_delete_def_file(vfs_handle_struct
*handle
, const char *path
)
621 return SMB_VFS_NEXT_SYS_ACL_DELETE_DEF_FILE(handle
, path
);
624 static int skel_sys_acl_get_perm(vfs_handle_struct
*handle
, SMB_ACL_PERMSET_T permset
, SMB_ACL_PERM_T perm
)
626 return SMB_VFS_NEXT_SYS_ACL_GET_PERM(handle
, permset
, perm
);
629 static int skel_sys_acl_free_text(vfs_handle_struct
*handle
, char *text
)
631 return SMB_VFS_NEXT_SYS_ACL_FREE_TEXT(handle
, text
);
634 static int skel_sys_acl_free_acl(vfs_handle_struct
*handle
, SMB_ACL_T posix_acl
)
636 return SMB_VFS_NEXT_SYS_ACL_FREE_ACL(handle
, posix_acl
);
639 static int skel_sys_acl_free_qualifier(vfs_handle_struct
*handle
, void *qualifier
, SMB_ACL_TAG_T tagtype
)
641 return SMB_VFS_NEXT_SYS_ACL_FREE_QUALIFIER(handle
, qualifier
, tagtype
);
644 static ssize_t
skel_getxattr(vfs_handle_struct
*handle
, const char *path
, const char *name
, void *value
, size_t size
)
646 return SMB_VFS_NEXT_GETXATTR(handle
, path
, name
, value
, size
);
649 static ssize_t
skel_lgetxattr(vfs_handle_struct
*handle
, const char *path
, const char *name
, void *value
, size_t
652 return SMB_VFS_NEXT_LGETXATTR(handle
, path
, name
, value
, size
);
655 static ssize_t
skel_fgetxattr(vfs_handle_struct
*handle
, struct files_struct
*fsp
, const char *name
, void *value
, size_t size
)
657 return SMB_VFS_NEXT_FGETXATTR(handle
, fsp
, name
, value
, size
);
660 static ssize_t
skel_listxattr(vfs_handle_struct
*handle
, const char *path
, char *list
, size_t size
)
662 return SMB_VFS_NEXT_LISTXATTR(handle
, path
, list
, size
);
665 static ssize_t
skel_llistxattr(vfs_handle_struct
*handle
, const char *path
, char *list
, size_t size
)
667 return SMB_VFS_NEXT_LLISTXATTR(handle
, path
, list
, size
);
670 static ssize_t
skel_flistxattr(vfs_handle_struct
*handle
, struct files_struct
*fsp
, char *list
, size_t size
)
672 return SMB_VFS_NEXT_FLISTXATTR(handle
, fsp
, list
, size
);
675 static int skel_removexattr(vfs_handle_struct
*handle
, const char *path
, const char *name
)
677 return SMB_VFS_NEXT_REMOVEXATTR(handle
, path
, name
);
680 static int skel_lremovexattr(vfs_handle_struct
*handle
, const char *path
, const char *name
)
682 return SMB_VFS_NEXT_LREMOVEXATTR(handle
, path
, name
);
685 static int skel_fremovexattr(vfs_handle_struct
*handle
, struct files_struct
*fsp
, const char *name
)
687 return SMB_VFS_NEXT_FREMOVEXATTR(handle
, fsp
, name
);
690 static int skel_setxattr(vfs_handle_struct
*handle
, const char *path
, const char *name
, const void *value
, size_t size
, int flags
)
692 return SMB_VFS_NEXT_SETXATTR(handle
, path
, name
, value
, size
, flags
);
695 static int skel_lsetxattr(vfs_handle_struct
*handle
, const char *path
, const char *name
, const void *value
, size_t size
, int flags
)
697 return SMB_VFS_NEXT_LSETXATTR(handle
, path
, name
, value
, size
, flags
);
700 static int skel_fsetxattr(vfs_handle_struct
*handle
, struct files_struct
*fsp
, const char *name
, const void *value
, size_t size
, int flags
)
702 return SMB_VFS_NEXT_FSETXATTR(handle
, fsp
, name
, value
, size
, flags
);
705 static int skel_aio_read(struct vfs_handle_struct
*handle
, struct files_struct
*fsp
, SMB_STRUCT_AIOCB
*aiocb
)
707 return SMB_VFS_NEXT_AIO_READ(handle
, fsp
, aiocb
);
710 static int skel_aio_write(struct vfs_handle_struct
*handle
, struct files_struct
*fsp
, SMB_STRUCT_AIOCB
*aiocb
)
712 return SMB_VFS_NEXT_AIO_WRITE(handle
, fsp
, aiocb
);
715 static ssize_t
skel_aio_return_fn(struct vfs_handle_struct
*handle
, struct files_struct
*fsp
, SMB_STRUCT_AIOCB
*aiocb
)
717 return SMB_VFS_NEXT_AIO_RETURN(handle
, fsp
, aiocb
);
720 static int skel_aio_cancel(struct vfs_handle_struct
*handle
, struct files_struct
*fsp
, SMB_STRUCT_AIOCB
*aiocb
)
722 return SMB_VFS_NEXT_AIO_CANCEL(handle
, fsp
, aiocb
);
725 static int skel_aio_error_fn(struct vfs_handle_struct
*handle
, struct files_struct
*fsp
, SMB_STRUCT_AIOCB
*aiocb
)
727 return SMB_VFS_NEXT_AIO_ERROR(handle
, fsp
, aiocb
);
730 static int skel_aio_fsync(struct vfs_handle_struct
*handle
, struct files_struct
*fsp
, int op
, SMB_STRUCT_AIOCB
*aiocb
)
732 return SMB_VFS_NEXT_AIO_FSYNC(handle
, fsp
, op
, aiocb
);
735 static int skel_aio_suspend(struct vfs_handle_struct
*handle
, struct files_struct
*fsp
, const SMB_STRUCT_AIOCB
* const aiocb
[], int n
, const struct timespec
*ts
)
737 return SMB_VFS_NEXT_AIO_SUSPEND(handle
, fsp
, aiocb
, n
, ts
);
740 static bool skel_aio_force(struct vfs_handle_struct
*handle
, struct files_struct
*fsp
)
742 return SMB_VFS_NEXT_AIO_FORCE(handle
, fsp
);
745 static bool skel_is_offline(struct vfs_handle_struct
*handle
, const struct smb_filename
*fname
, SMB_STRUCT_STAT
*sbuf
)
747 return SMB_VFS_NEXT_IS_OFFLINE(handle
, fname
, sbuf
);
750 static int skel_set_offline(struct vfs_handle_struct
*handle
, const struct smb_filename
*fname
)
752 return SMB_VFS_NEXT_SET_OFFLINE(handle
, fname
);
755 /* VFS operations structure */
757 struct vfs_fn_pointers skel_transparent_fns
= {
758 /* Disk operations */
760 .connect_fn
= skel_connect
,
761 .disconnect_fn
= skel_disconnect
,
762 .disk_free_fn
= skel_disk_free
,
763 .get_quota_fn
= skel_get_quota
,
764 .set_quota_fn
= skel_set_quota
,
765 .get_shadow_copy_data_fn
= skel_get_shadow_copy_data
,
766 .statvfs_fn
= skel_statvfs
,
767 .fs_capabilities_fn
= skel_fs_capabilities
,
768 .get_dfs_referrals_fn
= skel_get_dfs_referrals
,
770 /* Directory operations */
772 .opendir_fn
= skel_opendir
,
773 .fdopendir_fn
= skel_fdopendir
,
774 .readdir_fn
= skel_readdir
,
775 .seekdir_fn
= skel_seekdir
,
776 .telldir_fn
= skel_telldir
,
777 .rewind_dir_fn
= skel_rewind_dir
,
778 .mkdir_fn
= skel_mkdir
,
779 .rmdir_fn
= skel_rmdir
,
780 .closedir_fn
= skel_closedir
,
781 .init_search_op_fn
= skel_init_search_op
,
783 /* File operations */
785 .open_fn
= skel_open
,
786 .create_file_fn
= skel_create_file
,
787 .close_fn
= skel_close_fn
,
788 .read_fn
= skel_vfs_read
,
789 .pread_fn
= skel_pread
,
790 .write_fn
= skel_write
,
791 .pwrite_fn
= skel_pwrite
,
792 .lseek_fn
= skel_lseek
,
793 .sendfile_fn
= skel_sendfile
,
794 .recvfile_fn
= skel_recvfile
,
795 .rename_fn
= skel_rename
,
796 .fsync_fn
= skel_fsync
,
797 .stat_fn
= skel_stat
,
798 .fstat_fn
= skel_fstat
,
799 .lstat_fn
= skel_lstat
,
800 .get_alloc_size_fn
= skel_get_alloc_size
,
801 .unlink_fn
= skel_unlink
,
802 .chmod_fn
= skel_chmod
,
803 .fchmod_fn
= skel_fchmod
,
804 .chown_fn
= skel_chown
,
805 .fchown_fn
= skel_fchown
,
806 .lchown_fn
= skel_lchown
,
807 .chdir_fn
= skel_chdir
,
808 .getwd_fn
= skel_getwd
,
809 .ntimes_fn
= skel_ntimes
,
810 .ftruncate_fn
= skel_ftruncate
,
811 .fallocate_fn
= skel_fallocate
,
812 .lock_fn
= skel_lock
,
813 .kernel_flock_fn
= skel_kernel_flock
,
814 .linux_setlease_fn
= skel_linux_setlease
,
815 .getlock_fn
= skel_getlock
,
816 .symlink_fn
= skel_symlink
,
817 .readlink_fn
= skel_vfs_readlink
,
818 .link_fn
= skel_link
,
819 .mknod_fn
= skel_mknod
,
820 .realpath_fn
= skel_realpath
,
821 .notify_watch_fn
= skel_notify_watch
,
822 .chflags_fn
= skel_chflags
,
823 .file_id_create_fn
= skel_file_id_create
,
825 .streaminfo_fn
= skel_streaminfo
,
826 .get_real_filename_fn
= skel_get_real_filename
,
827 .connectpath_fn
= skel_connectpath
,
828 .brl_lock_windows_fn
= skel_brl_lock_windows
,
829 .brl_unlock_windows_fn
= skel_brl_unlock_windows
,
830 .brl_cancel_windows_fn
= skel_brl_cancel_windows
,
831 .strict_lock_fn
= skel_strict_lock
,
832 .strict_unlock_fn
= skel_strict_unlock
,
833 .translate_name_fn
= skel_translate_name
,
834 .fsctl_fn
= skel_fsctl
,
836 /* NT ACL operations. */
838 .fget_nt_acl_fn
= skel_fget_nt_acl
,
839 .get_nt_acl_fn
= skel_get_nt_acl
,
840 .fset_nt_acl_fn
= skel_fset_nt_acl
,
842 /* POSIX ACL operations. */
844 .chmod_acl_fn
= skel_chmod_acl
,
845 .fchmod_acl_fn
= skel_fchmod_acl
,
847 .sys_acl_get_entry_fn
= skel_sys_acl_get_entry
,
848 .sys_acl_get_tag_type_fn
= skel_sys_acl_get_tag_type
,
849 .sys_acl_get_permset_fn
= skel_sys_acl_get_permset
,
850 .sys_acl_get_qualifier_fn
= skel_sys_acl_get_qualifier
,
851 .sys_acl_get_file_fn
= skel_sys_acl_get_file
,
852 .sys_acl_get_fd_fn
= skel_sys_acl_get_fd
,
853 .sys_acl_clear_perms_fn
= skel_sys_acl_clear_perms
,
854 .sys_acl_add_perm_fn
= skel_sys_acl_add_perm
,
855 .sys_acl_to_text_fn
= skel_sys_acl_to_text
,
856 .sys_acl_init_fn
= skel_sys_acl_init
,
857 .sys_acl_create_entry_fn
= skel_sys_acl_create_entry
,
858 .sys_acl_set_tag_type_fn
= skel_sys_acl_set_tag_type
,
859 .sys_acl_set_qualifier_fn
= skel_sys_acl_set_qualifier
,
860 .sys_acl_set_permset_fn
= skel_sys_acl_set_permset
,
861 .sys_acl_valid_fn
= skel_sys_acl_valid
,
862 .sys_acl_set_file_fn
= skel_sys_acl_set_file
,
863 .sys_acl_set_fd_fn
= skel_sys_acl_set_fd
,
864 .sys_acl_delete_def_file_fn
= skel_sys_acl_delete_def_file
,
865 .sys_acl_get_perm_fn
= skel_sys_acl_get_perm
,
866 .sys_acl_free_text_fn
= skel_sys_acl_free_text
,
867 .sys_acl_free_acl_fn
= skel_sys_acl_free_acl
,
868 .sys_acl_free_qualifier_fn
= skel_sys_acl_free_qualifier
,
871 .getxattr_fn
= skel_getxattr
,
872 .lgetxattr_fn
= skel_lgetxattr
,
873 .fgetxattr_fn
= skel_fgetxattr
,
874 .listxattr_fn
= skel_listxattr
,
875 .llistxattr_fn
= skel_llistxattr
,
876 .flistxattr_fn
= skel_flistxattr
,
877 .removexattr_fn
= skel_removexattr
,
878 .lremovexattr_fn
= skel_lremovexattr
,
879 .fremovexattr_fn
= skel_fremovexattr
,
880 .setxattr_fn
= skel_setxattr
,
881 .lsetxattr_fn
= skel_lsetxattr
,
882 .fsetxattr_fn
= skel_fsetxattr
,
885 .aio_read_fn
= skel_aio_read
,
886 .aio_write_fn
= skel_aio_write
,
887 .aio_return_fn
= skel_aio_return_fn
,
888 .aio_cancel_fn
= skel_aio_cancel
,
889 .aio_error_fn
= skel_aio_error_fn
,
890 .aio_fsync_fn
= skel_aio_fsync
,
891 .aio_suspend_fn
= skel_aio_suspend
,
892 .aio_force_fn
= skel_aio_force
,
894 /* offline operations */
895 .is_offline_fn
= skel_is_offline
,
896 .set_offline_fn
= skel_set_offline
899 NTSTATUS
vfs_skel_transparent_init(void)
901 return smb_register_vfs(SMB_VFS_INTERFACE_VERSION
, "skel_transparent", &skel_transparent_fns
);