selftest: Remove samba3.smb2.lock.*.rw-exclusive from flapping file
[Samba.git] / examples / VFS / skel_transparent.c
blob0c84e19fcd117031442484e10ff6b3ff2407a9ef
1 /*
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 "lib/util/tevent_unix.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.
37 * --metze
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,
55 dfree, dsize);
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 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 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 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, DIR *dirp, long offset)
108 SMB_VFS_NEXT_SEEKDIR(handle, dirp, offset);
111 static long skel_telldir(vfs_handle_struct *handle, DIR *dirp)
113 return SMB_VFS_NEXT_TELLDIR(handle, dirp);
116 static void skel_rewind_dir(vfs_handle_struct *handle, 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, DIR *dir)
133 return SMB_VFS_NEXT_CLOSEDIR(handle, dir);
136 static void skel_init_search_op(struct vfs_handle_struct *handle, 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,
162 int *pinfo)
164 return SMB_VFS_NEXT_CREATE_FILE(handle,
165 req,
166 root_dir_fid,
167 smb_fname,
168 access_mask,
169 share_access,
170 create_disposition,
171 create_options,
172 file_attributes,
173 oplock_request,
174 allocation_size,
175 private_flags,
177 ea_list,
178 result,
179 pinfo);
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, off_t offset)
194 return SMB_VFS_NEXT_PREAD(handle, fsp, data, n, offset);
197 struct skel_pread_state {
198 ssize_t ret;
199 int err;
202 static void skel_pread_done(struct tevent_req *subreq);
204 static struct tevent_req *skel_pread_send(struct vfs_handle_struct *handle,
205 TALLOC_CTX *mem_ctx,
206 struct tevent_context *ev,
207 struct files_struct *fsp,
208 void *data, size_t n, off_t offset)
210 struct tevent_req *req, *subreq;
211 struct skel_pread_state *state;
213 req = tevent_req_create(mem_ctx, &state, struct skel_pread_state);
214 if (req == NULL) {
215 return NULL;
217 subreq = SMB_VFS_NEXT_PREAD_SEND(state, ev, handle, fsp, data,
218 n, offset);
219 if (tevent_req_nomem(subreq, req)) {
220 return tevent_req_post(req, ev);
222 tevent_req_set_callback(subreq, skel_pread_done, req);
223 return req;
226 static void skel_pread_done(struct tevent_req *subreq)
228 struct tevent_req *req = tevent_req_callback_data(
229 subreq, struct tevent_req);
230 struct skel_pread_state *state = tevent_req_data(
231 req, struct skel_pread_state);
233 state->ret = SMB_VFS_PREAD_RECV(subreq, &state->err);
234 TALLOC_FREE(subreq);
235 tevent_req_done(req);
238 static ssize_t skel_pread_recv(struct tevent_req *req, int *err)
240 struct skel_pread_state *state = tevent_req_data(
241 req, struct skel_pread_state);
243 if (tevent_req_is_unix_error(req, err)) {
244 return -1;
246 *err = state->err;
247 return state->ret;
250 static ssize_t skel_write(vfs_handle_struct *handle, files_struct *fsp, const void *data, size_t n)
252 return SMB_VFS_NEXT_WRITE(handle, fsp, data, n);
255 static ssize_t skel_pwrite(vfs_handle_struct *handle, files_struct *fsp, const void *data, size_t n, off_t offset)
257 return SMB_VFS_NEXT_PWRITE(handle, fsp, data, n, offset);
260 struct skel_pwrite_state {
261 ssize_t ret;
262 int err;
265 static void skel_pwrite_done(struct tevent_req *subreq);
267 static struct tevent_req *skel_pwrite_send(struct vfs_handle_struct *handle,
268 TALLOC_CTX *mem_ctx,
269 struct tevent_context *ev,
270 struct files_struct *fsp,
271 const void *data,
272 size_t n, off_t offset)
274 struct tevent_req *req, *subreq;
275 struct skel_pwrite_state *state;
277 req = tevent_req_create(mem_ctx, &state, struct skel_pwrite_state);
278 if (req == NULL) {
279 return NULL;
281 subreq = SMB_VFS_NEXT_PWRITE_SEND(state, ev, handle, fsp, data,
282 n, offset);
283 if (tevent_req_nomem(subreq, req)) {
284 return tevent_req_post(req, ev);
286 tevent_req_set_callback(subreq, skel_pwrite_done, req);
287 return req;
290 static void skel_pwrite_done(struct tevent_req *subreq)
292 struct tevent_req *req = tevent_req_callback_data(
293 subreq, struct tevent_req);
294 struct skel_pwrite_state *state = tevent_req_data(
295 req, struct skel_pwrite_state);
297 state->ret = SMB_VFS_PWRITE_RECV(subreq, &state->err);
298 TALLOC_FREE(subreq);
299 tevent_req_done(req);
302 static ssize_t skel_pwrite_recv(struct tevent_req *req, int *err)
304 struct skel_pwrite_state *state = tevent_req_data(
305 req, struct skel_pwrite_state);
307 if (tevent_req_is_unix_error(req, err)) {
308 return -1;
310 *err = state->err;
311 return state->ret;
314 static off_t skel_lseek(vfs_handle_struct *handle, files_struct *fsp, off_t offset, int whence)
316 return SMB_VFS_NEXT_LSEEK(handle, fsp, offset, whence);
319 static ssize_t skel_sendfile(vfs_handle_struct *handle, int tofd, files_struct *fromfsp, const DATA_BLOB *hdr, off_t offset, size_t n)
321 return SMB_VFS_NEXT_SENDFILE(handle, tofd, fromfsp, hdr, offset, n);
324 static ssize_t skel_recvfile(vfs_handle_struct *handle, int fromfd, files_struct *tofsp, off_t offset, size_t n)
326 return SMB_VFS_NEXT_RECVFILE(handle, fromfd, tofsp, offset, n);
329 static int skel_rename(vfs_handle_struct *handle,
330 const struct smb_filename *smb_fname_src,
331 const struct smb_filename *smb_fname_dst)
333 return SMB_VFS_NEXT_RENAME(handle, smb_fname_src, smb_fname_dst);
336 static int skel_fsync(vfs_handle_struct *handle, files_struct *fsp)
338 return SMB_VFS_NEXT_FSYNC(handle, fsp);
341 struct skel_fsync_state {
342 int ret;
343 int err;
346 static void skel_fsync_done(struct tevent_req *subreq);
348 static struct tevent_req *skel_fsync_send(struct vfs_handle_struct *handle,
349 TALLOC_CTX *mem_ctx,
350 struct tevent_context *ev,
351 struct files_struct *fsp)
353 struct tevent_req *req, *subreq;
354 struct skel_fsync_state *state;
356 req = tevent_req_create(mem_ctx, &state, struct skel_fsync_state);
357 if (req == NULL) {
358 return NULL;
360 subreq = SMB_VFS_NEXT_FSYNC_SEND(state, ev, handle, fsp);
361 if (tevent_req_nomem(subreq, req)) {
362 return tevent_req_post(req, ev);
364 tevent_req_set_callback(subreq, skel_fsync_done, req);
365 return req;
368 static void skel_fsync_done(struct tevent_req *subreq)
370 struct tevent_req *req = tevent_req_callback_data(
371 subreq, struct tevent_req);
372 struct skel_fsync_state *state = tevent_req_data(
373 req, struct skel_fsync_state);
375 state->ret = SMB_VFS_FSYNC_RECV(subreq, &state->err);
376 TALLOC_FREE(subreq);
377 tevent_req_done(req);
380 static int skel_fsync_recv(struct tevent_req *req, int *err)
382 struct skel_fsync_state *state = tevent_req_data(
383 req, struct skel_fsync_state);
385 if (tevent_req_is_unix_error(req, err)) {
386 return -1;
388 *err = state->err;
389 return state->ret;
392 static int skel_stat(vfs_handle_struct *handle, struct smb_filename *smb_fname)
394 return SMB_VFS_NEXT_STAT(handle, smb_fname);
397 static int skel_fstat(vfs_handle_struct *handle, files_struct *fsp, SMB_STRUCT_STAT *sbuf)
399 return SMB_VFS_NEXT_FSTAT(handle, fsp, sbuf);
402 static int skel_lstat(vfs_handle_struct *handle, struct smb_filename *smb_fname)
404 return SMB_VFS_NEXT_LSTAT(handle, smb_fname);
407 static uint64_t skel_get_alloc_size(struct vfs_handle_struct *handle, struct files_struct *fsp, const SMB_STRUCT_STAT *sbuf)
409 return SMB_VFS_NEXT_GET_ALLOC_SIZE(handle, fsp, sbuf);
412 static int skel_unlink(vfs_handle_struct *handle,
413 const struct smb_filename *smb_fname)
415 return SMB_VFS_NEXT_UNLINK(handle, smb_fname);
418 static int skel_chmod(vfs_handle_struct *handle, const char *path, mode_t mode)
420 return SMB_VFS_NEXT_CHMOD(handle, path, mode);
423 static int skel_fchmod(vfs_handle_struct *handle, files_struct *fsp, mode_t mode)
425 return SMB_VFS_NEXT_FCHMOD(handle, fsp, mode);
428 static int skel_chown(vfs_handle_struct *handle, const char *path, uid_t uid, gid_t gid)
430 return SMB_VFS_NEXT_CHOWN(handle, path, uid, gid);
433 static int skel_fchown(vfs_handle_struct *handle, files_struct *fsp, uid_t uid, gid_t gid)
435 return SMB_VFS_NEXT_FCHOWN(handle, fsp, uid, gid);
438 static int skel_lchown(vfs_handle_struct *handle, const char *path, uid_t uid, gid_t gid)
440 return SMB_VFS_NEXT_LCHOWN(handle, path, uid, gid);
443 static int skel_chdir(vfs_handle_struct *handle, const char *path)
445 return SMB_VFS_NEXT_CHDIR(handle, path);
448 static char *skel_getwd(vfs_handle_struct *handle)
450 return SMB_VFS_NEXT_GETWD(handle);
453 static int skel_ntimes(vfs_handle_struct *handle,
454 const struct smb_filename *smb_fname,
455 struct smb_file_time *ft)
457 return SMB_VFS_NEXT_NTIMES(handle, smb_fname, ft);
460 static int skel_ftruncate(vfs_handle_struct *handle, files_struct *fsp, off_t offset)
462 return SMB_VFS_NEXT_FTRUNCATE(handle, fsp, offset);
465 static int skel_fallocate(vfs_handle_struct *handle, files_struct *fsp,
466 enum vfs_fallocate_mode mode,
467 off_t offset,
468 off_t len)
470 return SMB_VFS_NEXT_FALLOCATE(handle, fsp, mode, offset, len);
473 static bool skel_lock(vfs_handle_struct *handle, files_struct *fsp, int op, off_t offset, off_t count, int type)
475 return SMB_VFS_NEXT_LOCK(handle, fsp, op, offset, count, type);
478 static int skel_kernel_flock(struct vfs_handle_struct *handle, struct files_struct *fsp, uint32 share_mode, uint32 access_mask)
480 return SMB_VFS_NEXT_KERNEL_FLOCK(handle, fsp, share_mode, access_mask);
483 static int skel_linux_setlease(struct vfs_handle_struct *handle, struct files_struct *fsp, int leasetype)
485 return SMB_VFS_NEXT_LINUX_SETLEASE(handle, fsp, leasetype);
488 static bool skel_getlock(vfs_handle_struct *handle, files_struct *fsp, off_t *poffset, off_t *pcount, int *ptype, pid_t *ppid)
490 return SMB_VFS_NEXT_GETLOCK(handle, fsp, poffset, pcount, ptype, ppid);
493 static int skel_symlink(vfs_handle_struct *handle, const char *oldpath, const char *newpath)
495 return SMB_VFS_NEXT_SYMLINK(handle, oldpath, newpath);
498 static int skel_vfs_readlink(vfs_handle_struct *handle, const char *path, char *buf, size_t bufsiz)
500 return SMB_VFS_NEXT_READLINK(handle, path, buf, bufsiz);
503 static int skel_link(vfs_handle_struct *handle, const char *oldpath, const char *newpath)
505 return SMB_VFS_NEXT_LINK(handle, oldpath, newpath);
508 static int skel_mknod(vfs_handle_struct *handle, const char *path, mode_t mode, SMB_DEV_T dev)
510 return SMB_VFS_NEXT_MKNOD(handle, path, mode, dev);
513 static char *skel_realpath(vfs_handle_struct *handle, const char *path)
515 return SMB_VFS_NEXT_REALPATH(handle, path);
518 static NTSTATUS skel_notify_watch(
519 struct vfs_handle_struct *handle,
520 struct sys_notify_context *ctx,
521 const char *path,
522 uint32_t *filter,
523 uint32_t *subdir_filter,
524 void (*callback)(struct sys_notify_context *ctx, void *private_data,
525 struct notify_event *ev),
526 void *private_data, void *handle_p)
528 return SMB_VFS_NEXT_NOTIFY_WATCH(handle, ctx, path,
529 filter, subdir_filter, callback,
530 private_data, handle_p);
533 static int skel_chflags(vfs_handle_struct *handle, const char *path, uint flags)
535 return SMB_VFS_NEXT_CHFLAGS(handle, path, flags);
538 static struct file_id skel_file_id_create(vfs_handle_struct *handle,
539 const SMB_STRUCT_STAT *sbuf)
541 return SMB_VFS_NEXT_FILE_ID_CREATE(handle, sbuf);
544 static NTSTATUS skel_streaminfo(struct vfs_handle_struct *handle,
545 struct files_struct *fsp,
546 const char *fname,
547 TALLOC_CTX *mem_ctx,
548 unsigned int *num_streams,
549 struct stream_struct **streams)
551 return SMB_VFS_NEXT_STREAMINFO(handle,
552 fsp,
553 fname,
554 mem_ctx,
555 num_streams,
556 streams);
559 static int skel_get_real_filename(struct vfs_handle_struct *handle,
560 const char *path,
561 const char *name,
562 TALLOC_CTX *mem_ctx,
563 char **found_name)
565 return SMB_VFS_NEXT_GET_REAL_FILENAME(handle,
566 path,
567 name,
568 mem_ctx,
569 found_name);
572 static const char *skel_connectpath(struct vfs_handle_struct *handle,
573 const char *filename)
575 return SMB_VFS_NEXT_CONNECTPATH(handle, filename);
578 static NTSTATUS skel_brl_lock_windows(struct vfs_handle_struct *handle,
579 struct byte_range_lock *br_lck,
580 struct lock_struct *plock,
581 bool blocking_lock,
582 struct blocking_lock_record *blr)
584 return SMB_VFS_NEXT_BRL_LOCK_WINDOWS(handle,
585 br_lck,
586 plock,
587 blocking_lock,
588 blr);
591 static bool skel_brl_unlock_windows(struct vfs_handle_struct *handle,
592 struct messaging_context *msg_ctx,
593 struct byte_range_lock *br_lck,
594 const struct lock_struct *plock)
596 return SMB_VFS_NEXT_BRL_UNLOCK_WINDOWS(handle,
597 msg_ctx,
598 br_lck,
599 plock);
602 static bool skel_brl_cancel_windows(struct vfs_handle_struct *handle,
603 struct byte_range_lock *br_lck,
604 struct lock_struct *plock,
605 struct blocking_lock_record *blr)
607 return SMB_VFS_NEXT_BRL_CANCEL_WINDOWS(handle,
608 br_lck,
609 plock,
610 blr);
613 static bool skel_strict_lock(struct vfs_handle_struct *handle,
614 struct files_struct *fsp,
615 struct lock_struct *plock)
617 return SMB_VFS_NEXT_STRICT_LOCK(handle,
618 fsp,
619 plock);
622 static void skel_strict_unlock(struct vfs_handle_struct *handle,
623 struct files_struct *fsp,
624 struct lock_struct *plock)
626 SMB_VFS_NEXT_STRICT_UNLOCK(handle,
627 fsp,
628 plock);
631 static NTSTATUS skel_translate_name(struct vfs_handle_struct *handle,
632 const char *mapped_name,
633 enum vfs_translate_direction direction,
634 TALLOC_CTX *mem_ctx,
635 char **pmapped_name)
637 return SMB_VFS_NEXT_TRANSLATE_NAME(handle, mapped_name, direction,
638 mem_ctx, pmapped_name);
641 static NTSTATUS skel_fsctl(struct vfs_handle_struct *handle,
642 struct files_struct *fsp,
643 TALLOC_CTX *ctx,
644 uint32_t function,
645 uint16_t req_flags, /* Needed for UNICODE ... */
646 const uint8_t *_in_data,
647 uint32_t in_len,
648 uint8_t **_out_data,
649 uint32_t max_out_len,
650 uint32_t *out_len)
652 return SMB_VFS_NEXT_FSCTL(handle,
653 fsp,
654 ctx,
655 function,
656 req_flags,
657 _in_data,
658 in_len,
659 _out_data,
660 max_out_len,
661 out_len);
664 static NTSTATUS skel_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
665 uint32 security_info,
666 TALLOC_CTX *mem_ctx,
667 struct security_descriptor **ppdesc)
669 return SMB_VFS_NEXT_FGET_NT_ACL(handle, fsp, security_info, mem_ctx, ppdesc);
672 static NTSTATUS skel_get_nt_acl(vfs_handle_struct *handle,
673 const char *name, uint32 security_info,
674 TALLOC_CTX *mem_ctx,
675 struct security_descriptor **ppdesc)
677 return SMB_VFS_NEXT_GET_NT_ACL(handle, name, security_info, mem_ctx, ppdesc);
680 static NTSTATUS skel_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
681 uint32 security_info_sent, const struct security_descriptor *psd)
683 return SMB_VFS_NEXT_FSET_NT_ACL(handle, fsp, security_info_sent, psd);
686 static int skel_chmod_acl(vfs_handle_struct *handle, const char *name, mode_t mode)
688 return SMB_VFS_NEXT_CHMOD_ACL(handle, name, mode);
691 static int skel_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp, mode_t mode)
693 return SMB_VFS_NEXT_FCHMOD_ACL(handle, fsp, mode);
696 static SMB_ACL_T skel_sys_acl_get_file(vfs_handle_struct *handle,
697 const char *path_p,
698 SMB_ACL_TYPE_T type,
699 TALLOC_CTX *mem_ctx)
701 return SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, path_p, type, mem_ctx);
704 static SMB_ACL_T skel_sys_acl_get_fd(vfs_handle_struct *handle,
705 files_struct *fsp,
706 TALLOC_CTX *mem_ctx)
708 return SMB_VFS_NEXT_SYS_ACL_GET_FD(handle, fsp, mem_ctx);
711 static int skel_sys_acl_blob_get_file(vfs_handle_struct *handle, const char *path_p,
712 TALLOC_CTX *mem_ctx,
713 char **blob_description,
714 DATA_BLOB *blob)
716 return SMB_VFS_NEXT_SYS_ACL_BLOB_GET_FILE(handle, path_p, mem_ctx, blob_description, blob);
719 static int skel_sys_acl_blob_get_fd(vfs_handle_struct *handle, files_struct *fsp,
720 TALLOC_CTX *mem_ctx,
721 char **blob_description,
722 DATA_BLOB *blob)
724 return SMB_VFS_NEXT_SYS_ACL_BLOB_GET_FD(handle, fsp, mem_ctx, blob_description, blob);
727 static int skel_sys_acl_set_file(vfs_handle_struct *handle, const char *name, SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl)
729 return SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, name, acltype, theacl);
732 static int skel_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, SMB_ACL_T theacl)
734 return SMB_VFS_NEXT_SYS_ACL_SET_FD(handle, fsp, theacl);
737 static int skel_sys_acl_delete_def_file(vfs_handle_struct *handle, const char *path)
739 return SMB_VFS_NEXT_SYS_ACL_DELETE_DEF_FILE(handle, path);
742 static ssize_t skel_getxattr(vfs_handle_struct *handle, const char *path, const char *name, void *value, size_t size)
744 return SMB_VFS_NEXT_GETXATTR(handle, path, name, value, size);
747 static ssize_t skel_fgetxattr(vfs_handle_struct *handle, struct files_struct *fsp, const char *name, void *value, size_t size)
749 return SMB_VFS_NEXT_FGETXATTR(handle, fsp, name, value, size);
752 static ssize_t skel_listxattr(vfs_handle_struct *handle, const char *path, char *list, size_t size)
754 return SMB_VFS_NEXT_LISTXATTR(handle, path, list, size);
757 static ssize_t skel_flistxattr(vfs_handle_struct *handle, struct files_struct *fsp, char *list, size_t size)
759 return SMB_VFS_NEXT_FLISTXATTR(handle, fsp, list, size);
762 static int skel_removexattr(vfs_handle_struct *handle, const char *path, const char *name)
764 return SMB_VFS_NEXT_REMOVEXATTR(handle, path, name);
767 static int skel_fremovexattr(vfs_handle_struct *handle, struct files_struct *fsp, const char *name)
769 return SMB_VFS_NEXT_FREMOVEXATTR(handle, fsp, name);
772 static int skel_setxattr(vfs_handle_struct *handle, const char *path, const char *name, const void *value, size_t size, int flags)
774 return SMB_VFS_NEXT_SETXATTR(handle, path, name, value, size, flags);
777 static int skel_fsetxattr(vfs_handle_struct *handle, struct files_struct *fsp, const char *name, const void *value, size_t size, int flags)
779 return SMB_VFS_NEXT_FSETXATTR(handle, fsp, name, value, size, flags);
782 static bool skel_aio_force(struct vfs_handle_struct *handle, struct files_struct *fsp)
784 return SMB_VFS_NEXT_AIO_FORCE(handle, fsp);
787 static bool skel_is_offline(struct vfs_handle_struct *handle, const struct smb_filename *fname, SMB_STRUCT_STAT *sbuf)
789 return SMB_VFS_NEXT_IS_OFFLINE(handle, fname, sbuf);
792 static int skel_set_offline(struct vfs_handle_struct *handle, const struct smb_filename *fname)
794 return SMB_VFS_NEXT_SET_OFFLINE(handle, fname);
797 /* VFS operations structure */
799 struct vfs_fn_pointers skel_transparent_fns = {
800 /* Disk operations */
802 .connect_fn = skel_connect,
803 .disconnect_fn = skel_disconnect,
804 .disk_free_fn = skel_disk_free,
805 .get_quota_fn = skel_get_quota,
806 .set_quota_fn = skel_set_quota,
807 .get_shadow_copy_data_fn = skel_get_shadow_copy_data,
808 .statvfs_fn = skel_statvfs,
809 .fs_capabilities_fn = skel_fs_capabilities,
810 .get_dfs_referrals_fn = skel_get_dfs_referrals,
812 /* Directory operations */
814 .opendir_fn = skel_opendir,
815 .fdopendir_fn = skel_fdopendir,
816 .readdir_fn = skel_readdir,
817 .seekdir_fn = skel_seekdir,
818 .telldir_fn = skel_telldir,
819 .rewind_dir_fn = skel_rewind_dir,
820 .mkdir_fn = skel_mkdir,
821 .rmdir_fn = skel_rmdir,
822 .closedir_fn = skel_closedir,
823 .init_search_op_fn = skel_init_search_op,
825 /* File operations */
827 .open_fn = skel_open,
828 .create_file_fn = skel_create_file,
829 .close_fn = skel_close_fn,
830 .read_fn = skel_vfs_read,
831 .pread_fn = skel_pread,
832 .pread_send_fn = skel_pread_send,
833 .pread_recv_fn = skel_pread_recv,
834 .write_fn = skel_write,
835 .pwrite_fn = skel_pwrite,
836 .pwrite_send_fn = skel_pwrite_send,
837 .pwrite_recv_fn = skel_pwrite_recv,
838 .lseek_fn = skel_lseek,
839 .sendfile_fn = skel_sendfile,
840 .recvfile_fn = skel_recvfile,
841 .rename_fn = skel_rename,
842 .fsync_fn = skel_fsync,
843 .fsync_send_fn = skel_fsync_send,
844 .fsync_recv_fn = skel_fsync_recv,
845 .stat_fn = skel_stat,
846 .fstat_fn = skel_fstat,
847 .lstat_fn = skel_lstat,
848 .get_alloc_size_fn = skel_get_alloc_size,
849 .unlink_fn = skel_unlink,
850 .chmod_fn = skel_chmod,
851 .fchmod_fn = skel_fchmod,
852 .chown_fn = skel_chown,
853 .fchown_fn = skel_fchown,
854 .lchown_fn = skel_lchown,
855 .chdir_fn = skel_chdir,
856 .getwd_fn = skel_getwd,
857 .ntimes_fn = skel_ntimes,
858 .ftruncate_fn = skel_ftruncate,
859 .fallocate_fn = skel_fallocate,
860 .lock_fn = skel_lock,
861 .kernel_flock_fn = skel_kernel_flock,
862 .linux_setlease_fn = skel_linux_setlease,
863 .getlock_fn = skel_getlock,
864 .symlink_fn = skel_symlink,
865 .readlink_fn = skel_vfs_readlink,
866 .link_fn = skel_link,
867 .mknod_fn = skel_mknod,
868 .realpath_fn = skel_realpath,
869 .notify_watch_fn = skel_notify_watch,
870 .chflags_fn = skel_chflags,
871 .file_id_create_fn = skel_file_id_create,
873 .streaminfo_fn = skel_streaminfo,
874 .get_real_filename_fn = skel_get_real_filename,
875 .connectpath_fn = skel_connectpath,
876 .brl_lock_windows_fn = skel_brl_lock_windows,
877 .brl_unlock_windows_fn = skel_brl_unlock_windows,
878 .brl_cancel_windows_fn = skel_brl_cancel_windows,
879 .strict_lock_fn = skel_strict_lock,
880 .strict_unlock_fn = skel_strict_unlock,
881 .translate_name_fn = skel_translate_name,
882 .fsctl_fn = skel_fsctl,
884 /* NT ACL operations. */
886 .fget_nt_acl_fn = skel_fget_nt_acl,
887 .get_nt_acl_fn = skel_get_nt_acl,
888 .fset_nt_acl_fn = skel_fset_nt_acl,
890 /* POSIX ACL operations. */
892 .chmod_acl_fn = skel_chmod_acl,
893 .fchmod_acl_fn = skel_fchmod_acl,
895 .sys_acl_get_file_fn = skel_sys_acl_get_file,
896 .sys_acl_get_fd_fn = skel_sys_acl_get_fd,
897 .sys_acl_blob_get_file_fn = skel_sys_acl_blob_get_file,
898 .sys_acl_blob_get_fd_fn = skel_sys_acl_blob_get_fd,
899 .sys_acl_set_file_fn = skel_sys_acl_set_file,
900 .sys_acl_set_fd_fn = skel_sys_acl_set_fd,
901 .sys_acl_delete_def_file_fn = skel_sys_acl_delete_def_file,
903 /* EA operations. */
904 .getxattr_fn = skel_getxattr,
905 .fgetxattr_fn = skel_fgetxattr,
906 .listxattr_fn = skel_listxattr,
907 .flistxattr_fn = skel_flistxattr,
908 .removexattr_fn = skel_removexattr,
909 .fremovexattr_fn = skel_fremovexattr,
910 .setxattr_fn = skel_setxattr,
911 .fsetxattr_fn = skel_fsetxattr,
913 /* aio operations */
914 .aio_force_fn = skel_aio_force,
916 /* offline operations */
917 .is_offline_fn = skel_is_offline,
918 .set_offline_fn = skel_set_offline
921 NTSTATUS vfs_skel_transparent_init(void)
923 return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "skel_transparent", &skel_transparent_fns);