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 SMB_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(struct vfs_handle_struct
*handle
,
361 struct sys_notify_context
*ctx
, struct notify_entry
*e
,
362 void (*callback
)(struct sys_notify_context
*ctx
, void *private_data
, struct notify_event
*ev
),
363 void *private_data
, void *handle_p
)
365 return SMB_VFS_NEXT_NOTIFY_WATCH(handle
, ctx
, e
, callback
,
366 private_data
, handle_p
);
369 static int skel_chflags(vfs_handle_struct
*handle
, const char *path
, uint flags
)
371 return SMB_VFS_NEXT_CHFLAGS(handle
, path
, flags
);
374 static struct file_id
skel_file_id_create(vfs_handle_struct
*handle
,
375 const SMB_STRUCT_STAT
*sbuf
)
377 return SMB_VFS_NEXT_FILE_ID_CREATE(handle
, sbuf
);
380 static NTSTATUS
skel_streaminfo(struct vfs_handle_struct
*handle
,
381 struct files_struct
*fsp
,
384 unsigned int *num_streams
,
385 struct stream_struct
**streams
)
387 return SMB_VFS_NEXT_STREAMINFO(handle
,
395 static int skel_get_real_filename(struct vfs_handle_struct
*handle
,
401 return SMB_VFS_NEXT_GET_REAL_FILENAME(handle
,
408 static const char *skel_connectpath(struct vfs_handle_struct
*handle
,
409 const char *filename
)
411 return SMB_VFS_NEXT_CONNECTPATH(handle
, filename
);
414 static NTSTATUS
skel_brl_lock_windows(struct vfs_handle_struct
*handle
,
415 struct byte_range_lock
*br_lck
,
416 struct lock_struct
*plock
,
418 struct blocking_lock_record
*blr
)
420 return SMB_VFS_NEXT_BRL_LOCK_WINDOWS(handle
,
427 static bool skel_brl_unlock_windows(struct vfs_handle_struct
*handle
,
428 struct messaging_context
*msg_ctx
,
429 struct byte_range_lock
*br_lck
,
430 const struct lock_struct
*plock
)
432 return SMB_VFS_NEXT_BRL_UNLOCK_WINDOWS(handle
,
438 static bool skel_brl_cancel_windows(struct vfs_handle_struct
*handle
,
439 struct byte_range_lock
*br_lck
,
440 struct lock_struct
*plock
,
441 struct blocking_lock_record
*blr
)
443 return SMB_VFS_NEXT_BRL_CANCEL_WINDOWS(handle
,
449 static bool skel_strict_lock(struct vfs_handle_struct
*handle
,
450 struct files_struct
*fsp
,
451 struct lock_struct
*plock
)
453 return SMB_VFS_NEXT_STRICT_LOCK(handle
,
458 static void skel_strict_unlock(struct vfs_handle_struct
*handle
,
459 struct files_struct
*fsp
,
460 struct lock_struct
*plock
)
462 SMB_VFS_NEXT_STRICT_UNLOCK(handle
,
467 static NTSTATUS
skel_translate_name(struct vfs_handle_struct
*handle
,
468 const char *mapped_name
,
469 enum vfs_translate_direction direction
,
473 return SMB_VFS_NEXT_TRANSLATE_NAME(handle
, mapped_name
, direction
,
474 mem_ctx
, pmapped_name
);
477 static NTSTATUS
skel_fsctl(struct vfs_handle_struct
*handle
,
478 struct files_struct
*fsp
,
481 uint16_t req_flags
, /* Needed for UNICODE ... */
482 const uint8_t *_in_data
,
485 uint32_t max_out_len
,
488 return SMB_VFS_NEXT_FSCTL(handle
,
500 static NTSTATUS
skel_fget_nt_acl(vfs_handle_struct
*handle
, files_struct
*fsp
,
501 uint32 security_info
, struct security_descriptor
**ppdesc
)
503 return SMB_VFS_NEXT_FGET_NT_ACL(handle
, fsp
, security_info
, ppdesc
);
506 static NTSTATUS
skel_get_nt_acl(vfs_handle_struct
*handle
,
507 const char *name
, uint32 security_info
, struct security_descriptor
**ppdesc
)
509 return SMB_VFS_NEXT_GET_NT_ACL(handle
, name
, security_info
, ppdesc
);
512 static NTSTATUS
skel_fset_nt_acl(vfs_handle_struct
*handle
, files_struct
*fsp
,
513 uint32 security_info_sent
, const struct security_descriptor
*psd
)
515 return SMB_VFS_NEXT_FSET_NT_ACL(handle
, fsp
, security_info_sent
, psd
);
518 static int skel_chmod_acl(vfs_handle_struct
*handle
, const char *name
, mode_t mode
)
520 return SMB_VFS_NEXT_CHMOD_ACL(handle
, name
, mode
);
523 static int skel_fchmod_acl(vfs_handle_struct
*handle
, files_struct
*fsp
, mode_t mode
)
525 return SMB_VFS_NEXT_FCHMOD_ACL(handle
, fsp
, mode
);
528 static int skel_sys_acl_get_entry(vfs_handle_struct
*handle
, SMB_ACL_T theacl
, int entry_id
, SMB_ACL_ENTRY_T
*entry_p
)
530 return SMB_VFS_NEXT_SYS_ACL_GET_ENTRY(handle
, theacl
, entry_id
, entry_p
);
533 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
)
535 return SMB_VFS_NEXT_SYS_ACL_GET_TAG_TYPE(handle
, entry_d
, tag_type_p
);
538 static int skel_sys_acl_get_permset(vfs_handle_struct
*handle
, SMB_ACL_ENTRY_T entry_d
, SMB_ACL_PERMSET_T
*permset_p
)
540 return SMB_VFS_NEXT_SYS_ACL_GET_PERMSET(handle
, entry_d
, permset_p
);
543 static void *skel_sys_acl_get_qualifier(vfs_handle_struct
*handle
, SMB_ACL_ENTRY_T entry_d
)
545 return SMB_VFS_NEXT_SYS_ACL_GET_QUALIFIER(handle
, entry_d
);
548 static SMB_ACL_T
skel_sys_acl_get_file(vfs_handle_struct
*handle
, const char *path_p
, SMB_ACL_TYPE_T type
)
550 return SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle
, path_p
, type
);
553 static SMB_ACL_T
skel_sys_acl_get_fd(vfs_handle_struct
*handle
, files_struct
*fsp
)
555 return SMB_VFS_NEXT_SYS_ACL_GET_FD(handle
, fsp
);
558 static int skel_sys_acl_clear_perms(vfs_handle_struct
*handle
, SMB_ACL_PERMSET_T permset
)
560 return SMB_VFS_NEXT_SYS_ACL_CLEAR_PERMS(handle
, permset
);
563 static int skel_sys_acl_add_perm(vfs_handle_struct
*handle
, SMB_ACL_PERMSET_T permset
, SMB_ACL_PERM_T perm
)
565 return SMB_VFS_NEXT_SYS_ACL_ADD_PERM(handle
, permset
, perm
);
568 static char *skel_sys_acl_to_text(vfs_handle_struct
*handle
, SMB_ACL_T theacl
, ssize_t
*plen
)
570 return SMB_VFS_NEXT_SYS_ACL_TO_TEXT(handle
, theacl
, plen
);
573 static SMB_ACL_T
skel_sys_acl_init(vfs_handle_struct
*handle
, int count
)
575 return SMB_VFS_NEXT_SYS_ACL_INIT(handle
, count
);
578 static int skel_sys_acl_create_entry(vfs_handle_struct
*handle
, SMB_ACL_T
*pacl
, SMB_ACL_ENTRY_T
*pentry
)
580 return SMB_VFS_NEXT_SYS_ACL_CREATE_ENTRY(handle
, pacl
, pentry
);
583 static int skel_sys_acl_set_tag_type(vfs_handle_struct
*handle
, SMB_ACL_ENTRY_T entry
, SMB_ACL_TAG_T tagtype
)
585 return SMB_VFS_NEXT_SYS_ACL_SET_TAG_TYPE(handle
, entry
, tagtype
);
588 static int skel_sys_acl_set_qualifier(vfs_handle_struct
*handle
, SMB_ACL_ENTRY_T entry
, void *qual
)
590 return SMB_VFS_NEXT_SYS_ACL_SET_QUALIFIER(handle
, entry
, qual
);
593 static int skel_sys_acl_set_permset(vfs_handle_struct
*handle
, SMB_ACL_ENTRY_T entry
, SMB_ACL_PERMSET_T permset
)
595 return SMB_VFS_NEXT_SYS_ACL_SET_PERMSET(handle
, entry
, permset
);
598 static int skel_sys_acl_valid(vfs_handle_struct
*handle
, SMB_ACL_T theacl
)
600 return SMB_VFS_NEXT_SYS_ACL_VALID(handle
, theacl
);
603 static int skel_sys_acl_set_file(vfs_handle_struct
*handle
, const char *name
, SMB_ACL_TYPE_T acltype
, SMB_ACL_T theacl
)
605 return SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle
, name
, acltype
, theacl
);
608 static int skel_sys_acl_set_fd(vfs_handle_struct
*handle
, files_struct
*fsp
, SMB_ACL_T theacl
)
610 return SMB_VFS_NEXT_SYS_ACL_SET_FD(handle
, fsp
, theacl
);
613 static int skel_sys_acl_delete_def_file(vfs_handle_struct
*handle
, const char *path
)
615 return SMB_VFS_NEXT_SYS_ACL_DELETE_DEF_FILE(handle
, path
);
618 static int skel_sys_acl_get_perm(vfs_handle_struct
*handle
, SMB_ACL_PERMSET_T permset
, SMB_ACL_PERM_T perm
)
620 return SMB_VFS_NEXT_SYS_ACL_GET_PERM(handle
, permset
, perm
);
623 static int skel_sys_acl_free_text(vfs_handle_struct
*handle
, char *text
)
625 return SMB_VFS_NEXT_SYS_ACL_FREE_TEXT(handle
, text
);
628 static int skel_sys_acl_free_acl(vfs_handle_struct
*handle
, SMB_ACL_T posix_acl
)
630 return SMB_VFS_NEXT_SYS_ACL_FREE_ACL(handle
, posix_acl
);
633 static int skel_sys_acl_free_qualifier(vfs_handle_struct
*handle
, void *qualifier
, SMB_ACL_TAG_T tagtype
)
635 return SMB_VFS_NEXT_SYS_ACL_FREE_QUALIFIER(handle
, qualifier
, tagtype
);
638 static ssize_t
skel_getxattr(vfs_handle_struct
*handle
, const char *path
, const char *name
, void *value
, size_t size
)
640 return SMB_VFS_NEXT_GETXATTR(handle
, path
, name
, value
, size
);
643 static ssize_t
skel_lgetxattr(vfs_handle_struct
*handle
, const char *path
, const char *name
, void *value
, size_t
646 return SMB_VFS_NEXT_LGETXATTR(handle
, path
, name
, value
, size
);
649 static ssize_t
skel_fgetxattr(vfs_handle_struct
*handle
, struct files_struct
*fsp
, const char *name
, void *value
, size_t size
)
651 return SMB_VFS_NEXT_FGETXATTR(handle
, fsp
, name
, value
, size
);
654 static ssize_t
skel_listxattr(vfs_handle_struct
*handle
, const char *path
, char *list
, size_t size
)
656 return SMB_VFS_NEXT_LISTXATTR(handle
, path
, list
, size
);
659 static ssize_t
skel_llistxattr(vfs_handle_struct
*handle
, const char *path
, char *list
, size_t size
)
661 return SMB_VFS_NEXT_LLISTXATTR(handle
, path
, list
, size
);
664 static ssize_t
skel_flistxattr(vfs_handle_struct
*handle
, struct files_struct
*fsp
, char *list
, size_t size
)
666 return SMB_VFS_NEXT_FLISTXATTR(handle
, fsp
, list
, size
);
669 static int skel_removexattr(vfs_handle_struct
*handle
, const char *path
, const char *name
)
671 return SMB_VFS_NEXT_REMOVEXATTR(handle
, path
, name
);
674 static int skel_lremovexattr(vfs_handle_struct
*handle
, const char *path
, const char *name
)
676 return SMB_VFS_NEXT_LREMOVEXATTR(handle
, path
, name
);
679 static int skel_fremovexattr(vfs_handle_struct
*handle
, struct files_struct
*fsp
, const char *name
)
681 return SMB_VFS_NEXT_FREMOVEXATTR(handle
, fsp
, name
);
684 static int skel_setxattr(vfs_handle_struct
*handle
, const char *path
, const char *name
, const void *value
, size_t size
, int flags
)
686 return SMB_VFS_NEXT_SETXATTR(handle
, path
, name
, value
, size
, flags
);
689 static int skel_lsetxattr(vfs_handle_struct
*handle
, const char *path
, const char *name
, const void *value
, size_t size
, int flags
)
691 return SMB_VFS_NEXT_LSETXATTR(handle
, path
, name
, value
, size
, flags
);
694 static int skel_fsetxattr(vfs_handle_struct
*handle
, struct files_struct
*fsp
, const char *name
, const void *value
, size_t size
, int flags
)
696 return SMB_VFS_NEXT_FSETXATTR(handle
, fsp
, name
, value
, size
, flags
);
699 static int skel_aio_read(struct vfs_handle_struct
*handle
, struct files_struct
*fsp
, SMB_STRUCT_AIOCB
*aiocb
)
701 return SMB_VFS_NEXT_AIO_READ(handle
, fsp
, aiocb
);
704 static int skel_aio_write(struct vfs_handle_struct
*handle
, struct files_struct
*fsp
, SMB_STRUCT_AIOCB
*aiocb
)
706 return SMB_VFS_NEXT_AIO_WRITE(handle
, fsp
, aiocb
);
709 static ssize_t
skel_aio_return_fn(struct vfs_handle_struct
*handle
, struct files_struct
*fsp
, SMB_STRUCT_AIOCB
*aiocb
)
711 return SMB_VFS_NEXT_AIO_RETURN(handle
, fsp
, aiocb
);
714 static int skel_aio_cancel(struct vfs_handle_struct
*handle
, struct files_struct
*fsp
, SMB_STRUCT_AIOCB
*aiocb
)
716 return SMB_VFS_NEXT_AIO_CANCEL(handle
, fsp
, aiocb
);
719 static int skel_aio_error_fn(struct vfs_handle_struct
*handle
, struct files_struct
*fsp
, SMB_STRUCT_AIOCB
*aiocb
)
721 return SMB_VFS_NEXT_AIO_ERROR(handle
, fsp
, aiocb
);
724 static int skel_aio_fsync(struct vfs_handle_struct
*handle
, struct files_struct
*fsp
, int op
, SMB_STRUCT_AIOCB
*aiocb
)
726 return SMB_VFS_NEXT_AIO_FSYNC(handle
, fsp
, op
, aiocb
);
729 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
)
731 return SMB_VFS_NEXT_AIO_SUSPEND(handle
, fsp
, aiocb
, n
, ts
);
734 static bool skel_aio_force(struct vfs_handle_struct
*handle
, struct files_struct
*fsp
)
736 return SMB_VFS_NEXT_AIO_FORCE(handle
, fsp
);
739 static bool skel_is_offline(struct vfs_handle_struct
*handle
, const struct smb_filename
*fname
, SMB_STRUCT_STAT
*sbuf
)
741 return SMB_VFS_NEXT_IS_OFFLINE(handle
, fname
, sbuf
);
744 static int skel_set_offline(struct vfs_handle_struct
*handle
, const struct smb_filename
*fname
)
746 return SMB_VFS_NEXT_SET_OFFLINE(handle
, fname
);
749 /* VFS operations structure */
751 struct vfs_fn_pointers skel_transparent_fns
= {
752 /* Disk operations */
754 .connect_fn
= skel_connect
,
755 .disconnect_fn
= skel_disconnect
,
756 .disk_free_fn
= skel_disk_free
,
757 .get_quota_fn
= skel_get_quota
,
758 .set_quota_fn
= skel_set_quota
,
759 .get_shadow_copy_data_fn
= skel_get_shadow_copy_data
,
760 .statvfs_fn
= skel_statvfs
,
761 .fs_capabilities_fn
= skel_fs_capabilities
,
762 .get_dfs_referrals_fn
= skel_get_dfs_referrals
,
764 /* Directory operations */
766 .opendir_fn
= skel_opendir
,
767 .fdopendir_fn
= skel_fdopendir
,
768 .readdir_fn
= skel_readdir
,
769 .seekdir_fn
= skel_seekdir
,
770 .telldir_fn
= skel_telldir
,
771 .rewind_dir_fn
= skel_rewind_dir
,
772 .mkdir_fn
= skel_mkdir
,
773 .rmdir_fn
= skel_rmdir
,
774 .closedir_fn
= skel_closedir
,
775 .init_search_op_fn
= skel_init_search_op
,
777 /* File operations */
779 .open_fn
= skel_open
,
780 .create_file_fn
= skel_create_file
,
781 .close_fn
= skel_close_fn
,
782 .read_fn
= skel_vfs_read
,
783 .pread_fn
= skel_pread
,
784 .write_fn
= skel_write
,
785 .pwrite_fn
= skel_pwrite
,
786 .lseek_fn
= skel_lseek
,
787 .sendfile_fn
= skel_sendfile
,
788 .recvfile_fn
= skel_recvfile
,
789 .rename_fn
= skel_rename
,
790 .fsync_fn
= skel_fsync
,
791 .stat_fn
= skel_stat
,
792 .fstat_fn
= skel_fstat
,
793 .lstat_fn
= skel_lstat
,
794 .get_alloc_size_fn
= skel_get_alloc_size
,
795 .unlink_fn
= skel_unlink
,
796 .chmod_fn
= skel_chmod
,
797 .fchmod_fn
= skel_fchmod
,
798 .chown_fn
= skel_chown
,
799 .fchown_fn
= skel_fchown
,
800 .lchown_fn
= skel_lchown
,
801 .chdir_fn
= skel_chdir
,
802 .getwd_fn
= skel_getwd
,
803 .ntimes_fn
= skel_ntimes
,
804 .ftruncate_fn
= skel_ftruncate
,
805 .fallocate_fn
= skel_fallocate
,
806 .lock_fn
= skel_lock
,
807 .kernel_flock_fn
= skel_kernel_flock
,
808 .linux_setlease_fn
= skel_linux_setlease
,
809 .getlock_fn
= skel_getlock
,
810 .symlink_fn
= skel_symlink
,
811 .readlink_fn
= skel_vfs_readlink
,
812 .link_fn
= skel_link
,
813 .mknod_fn
= skel_mknod
,
814 .realpath_fn
= skel_realpath
,
815 .notify_watch_fn
= skel_notify_watch
,
816 .chflags_fn
= skel_chflags
,
817 .file_id_create_fn
= skel_file_id_create
,
819 .streaminfo_fn
= skel_streaminfo
,
820 .get_real_filename_fn
= skel_get_real_filename
,
821 .connectpath_fn
= skel_connectpath
,
822 .brl_lock_windows_fn
= skel_brl_lock_windows
,
823 .brl_unlock_windows_fn
= skel_brl_unlock_windows
,
824 .brl_cancel_windows_fn
= skel_brl_cancel_windows
,
825 .strict_lock_fn
= skel_strict_lock
,
826 .strict_unlock_fn
= skel_strict_unlock
,
827 .translate_name_fn
= skel_translate_name
,
828 .fsctl_fn
= skel_fsctl
,
830 /* NT ACL operations. */
832 .fget_nt_acl_fn
= skel_fget_nt_acl
,
833 .get_nt_acl_fn
= skel_get_nt_acl
,
834 .fset_nt_acl_fn
= skel_fset_nt_acl
,
836 /* POSIX ACL operations. */
838 .chmod_acl_fn
= skel_chmod_acl
,
839 .fchmod_acl_fn
= skel_fchmod_acl
,
841 .sys_acl_get_entry_fn
= skel_sys_acl_get_entry
,
842 .sys_acl_get_tag_type_fn
= skel_sys_acl_get_tag_type
,
843 .sys_acl_get_permset_fn
= skel_sys_acl_get_permset
,
844 .sys_acl_get_qualifier_fn
= skel_sys_acl_get_qualifier
,
845 .sys_acl_get_file_fn
= skel_sys_acl_get_file
,
846 .sys_acl_get_fd_fn
= skel_sys_acl_get_fd
,
847 .sys_acl_clear_perms_fn
= skel_sys_acl_clear_perms
,
848 .sys_acl_add_perm_fn
= skel_sys_acl_add_perm
,
849 .sys_acl_to_text_fn
= skel_sys_acl_to_text
,
850 .sys_acl_init_fn
= skel_sys_acl_init
,
851 .sys_acl_create_entry_fn
= skel_sys_acl_create_entry
,
852 .sys_acl_set_tag_type_fn
= skel_sys_acl_set_tag_type
,
853 .sys_acl_set_qualifier_fn
= skel_sys_acl_set_qualifier
,
854 .sys_acl_set_permset_fn
= skel_sys_acl_set_permset
,
855 .sys_acl_valid_fn
= skel_sys_acl_valid
,
856 .sys_acl_set_file_fn
= skel_sys_acl_set_file
,
857 .sys_acl_set_fd_fn
= skel_sys_acl_set_fd
,
858 .sys_acl_delete_def_file_fn
= skel_sys_acl_delete_def_file
,
859 .sys_acl_get_perm_fn
= skel_sys_acl_get_perm
,
860 .sys_acl_free_text_fn
= skel_sys_acl_free_text
,
861 .sys_acl_free_acl_fn
= skel_sys_acl_free_acl
,
862 .sys_acl_free_qualifier_fn
= skel_sys_acl_free_qualifier
,
865 .getxattr_fn
= skel_getxattr
,
866 .lgetxattr_fn
= skel_lgetxattr
,
867 .fgetxattr_fn
= skel_fgetxattr
,
868 .listxattr_fn
= skel_listxattr
,
869 .llistxattr_fn
= skel_llistxattr
,
870 .flistxattr_fn
= skel_flistxattr
,
871 .removexattr_fn
= skel_removexattr
,
872 .lremovexattr_fn
= skel_lremovexattr
,
873 .fremovexattr_fn
= skel_fremovexattr
,
874 .setxattr_fn
= skel_setxattr
,
875 .lsetxattr_fn
= skel_lsetxattr
,
876 .fsetxattr_fn
= skel_fsetxattr
,
879 .aio_read_fn
= skel_aio_read
,
880 .aio_write_fn
= skel_aio_write
,
881 .aio_return_fn
= skel_aio_return_fn
,
882 .aio_cancel_fn
= skel_aio_cancel
,
883 .aio_error_fn
= skel_aio_error_fn
,
884 .aio_fsync_fn
= skel_aio_fsync
,
885 .aio_suspend_fn
= skel_aio_suspend
,
886 .aio_force_fn
= skel_aio_force
,
888 /* offline operations */
889 .is_offline_fn
= skel_is_offline
,
890 .set_offline_fn
= skel_set_offline
893 NTSTATUS
vfs_skel_transparent_init(void)
895 return smb_register_vfs(SMB_VFS_INTERFACE_VERSION
, "skel_transparent", &skel_transparent_fns
);