2 Unix SMB/CIFS implementation.
3 Wrap disk only vfs functions to sidestep dodgy compilers.
4 Copyright (C) Tim Potter 1998
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 #define DBGC_CLASS DBGC_VFS
27 /* Check for NULL pointer parameters in vfswrap_* functions */
29 /* We don't want to have NULL function pointers lying around. Someone
30 is sure to try and execute them. These stubs are used to prevent
33 int vfswrap_dummy_connect(vfs_handle_struct
*handle
, connection_struct
*conn
, const char *service
, const char *user
)
35 return 0; /* Return >= 0 for success */
38 void vfswrap_dummy_disconnect(vfs_handle_struct
*handle
, connection_struct
*conn
)
44 SMB_BIG_UINT
vfswrap_disk_free(vfs_handle_struct
*handle
, connection_struct
*conn
, const char *path
, BOOL small_query
, SMB_BIG_UINT
*bsize
,
45 SMB_BIG_UINT
*dfree
, SMB_BIG_UINT
*dsize
)
49 result
= sys_disk_free(path
, small_query
, bsize
, dfree
, dsize
);
53 int vfswrap_get_quota(struct vfs_handle_struct
*handle
, struct connection_struct
*conn
, enum SMB_QUOTA_TYPE qtype
, unid_t id
, SMB_DISK_QUOTA
*qt
)
55 #ifdef HAVE_SYS_QUOTAS
58 START_PROFILE(syscall_get_quota
);
59 result
= sys_get_quota(conn
->connectpath
, qtype
, id
, qt
);
60 END_PROFILE(syscall_get_quota
);
68 int vfswrap_set_quota(struct vfs_handle_struct
*handle
, struct connection_struct
*conn
, enum SMB_QUOTA_TYPE qtype
, unid_t id
, SMB_DISK_QUOTA
*qt
)
70 #ifdef HAVE_SYS_QUOTAS
73 START_PROFILE(syscall_set_quota
);
74 result
= sys_set_quota(conn
->connectpath
, qtype
, id
, qt
);
75 END_PROFILE(syscall_set_quota
);
83 int vfswrap_get_shadow_copy_data(struct vfs_handle_struct
*handle
, struct files_struct
*fsp
, SHADOW_COPY_DATA
*shadow_copy_data
, BOOL labels
)
86 return -1; /* Not implemented. */
89 /* Directory operations */
91 DIR *vfswrap_opendir(vfs_handle_struct
*handle
, connection_struct
*conn
, const char *fname
)
95 START_PROFILE(syscall_opendir
);
96 result
= opendir(fname
);
97 END_PROFILE(syscall_opendir
);
101 struct dirent
*vfswrap_readdir(vfs_handle_struct
*handle
, connection_struct
*conn
, DIR *dirp
)
103 struct dirent
*result
;
105 START_PROFILE(syscall_readdir
);
106 result
= readdir(dirp
);
107 END_PROFILE(syscall_readdir
);
111 int vfswrap_mkdir(vfs_handle_struct
*handle
, connection_struct
*conn
, const char *path
, mode_t mode
)
114 BOOL has_dacl
= False
;
116 START_PROFILE(syscall_mkdir
);
118 if (lp_inherit_acls(SNUM(conn
)) && (has_dacl
= directory_has_default_acl(conn
, parent_dirname(path
))))
121 result
= mkdir(path
, mode
);
123 if (result
== 0 && !has_dacl
) {
125 * We need to do this as the default behavior of POSIX ACLs
126 * is to set the mask to be the requested group permission
127 * bits, not the group permission bits to be the requested
128 * group permission bits. This is not what we want, as it will
129 * mess up any inherited ACL bits that were set. JRA.
131 int saved_errno
= errno
; /* We may get ENOSYS */
132 if ((SMB_VFS_CHMOD_ACL(conn
, path
, mode
) == -1) && (errno
== ENOSYS
))
136 END_PROFILE(syscall_mkdir
);
140 int vfswrap_rmdir(vfs_handle_struct
*handle
, connection_struct
*conn
, const char *path
)
144 START_PROFILE(syscall_rmdir
);
145 result
= rmdir(path
);
146 END_PROFILE(syscall_rmdir
);
150 int vfswrap_closedir(vfs_handle_struct
*handle
, connection_struct
*conn
, DIR *dirp
)
154 START_PROFILE(syscall_closedir
);
155 result
= closedir(dirp
);
156 END_PROFILE(syscall_closedir
);
160 /* File operations */
162 int vfswrap_open(vfs_handle_struct
*handle
, connection_struct
*conn
, const char *fname
, int flags
, mode_t mode
)
166 START_PROFILE(syscall_open
);
167 result
= sys_open(fname
, flags
, mode
);
168 END_PROFILE(syscall_open
);
172 int vfswrap_close(vfs_handle_struct
*handle
, files_struct
*fsp
, int fd
)
176 START_PROFILE(syscall_close
);
179 END_PROFILE(syscall_close
);
183 ssize_t
vfswrap_read(vfs_handle_struct
*handle
, files_struct
*fsp
, int fd
, void *data
, size_t n
)
187 START_PROFILE_BYTES(syscall_read
, n
);
188 result
= sys_read(fd
, data
, n
);
189 END_PROFILE(syscall_read
);
193 ssize_t
vfswrap_write(vfs_handle_struct
*handle
, files_struct
*fsp
, int fd
, const void *data
, size_t n
)
197 START_PROFILE_BYTES(syscall_write
, n
);
198 result
= sys_write(fd
, data
, n
);
199 END_PROFILE(syscall_write
);
203 SMB_OFF_T
vfswrap_lseek(vfs_handle_struct
*handle
, files_struct
*fsp
, int filedes
, SMB_OFF_T offset
, int whence
)
205 SMB_OFF_T result
= 0;
207 START_PROFILE(syscall_lseek
);
209 /* Cope with 'stat' file opens. */
211 result
= sys_lseek(filedes
, offset
, whence
);
214 * We want to maintain the fiction that we can seek
215 * on a fifo for file system purposes. This allows
216 * people to set up UNIX fifo's that feed data to Windows
220 if((result
== -1) && (errno
== ESPIPE
)) {
225 END_PROFILE(syscall_lseek
);
229 ssize_t
vfswrap_sendfile(vfs_handle_struct
*handle
, int tofd
, files_struct
*fsp
, int fromfd
, const DATA_BLOB
*hdr
,
230 SMB_OFF_T offset
, size_t n
)
234 START_PROFILE_BYTES(syscall_sendfile
, n
);
235 result
= sys_sendfile(tofd
, fromfd
, hdr
, offset
, n
);
236 END_PROFILE(syscall_sendfile
);
240 /*********************************************************
241 For rename across filesystems Patch from Warren Birnbaum
242 <warrenb@hpcvscdp.cv.hp.com>
243 **********************************************************/
245 static int copy_reg(const char *source
, const char *dest
)
247 SMB_STRUCT_STAT source_stats
;
252 if (sys_lstat (source
, &source_stats
) == -1)
255 if (!S_ISREG (source_stats
.st_mode
))
258 if((ifd
= sys_open (source
, O_RDONLY
, 0)) < 0)
261 if (unlink (dest
) && errno
!= ENOENT
)
265 if((ofd
= sys_open (dest
, O_WRONLY
| O_CREAT
| O_TRUNC
| O_NOFOLLOW
, 0600)) < 0 )
267 if((ofd
= sys_open (dest
, O_WRONLY
| O_CREAT
| O_TRUNC
, 0600)) < 0 )
271 if (transfer_file(ifd
, ofd
, (size_t)-1) == -1)
275 * Try to preserve ownership. For non-root it might fail, but that's ok.
276 * But root probably wants to know, e.g. if NFS disallows it.
279 if ((fchown(ofd
, source_stats
.st_uid
, source_stats
.st_gid
) == -1) && (errno
!= EPERM
))
283 * fchown turns off set[ug]id bits for non-root,
284 * so do the chmod last.
287 #if defined(HAVE_FCHMOD)
288 if (fchmod (ofd
, source_stats
.st_mode
& 07777))
290 if (chmod (dest
, source_stats
.st_mode
& 07777))
294 if (close (ifd
) == -1)
297 if (close (ofd
) == -1)
300 /* Try to copy the old file's modtime and access time. */
304 tv
.actime
= source_stats
.st_atime
;
305 tv
.modtime
= source_stats
.st_mtime
;
309 if (unlink (source
) == -1)
325 int vfswrap_rename(vfs_handle_struct
*handle
, connection_struct
*conn
, const char *old
, const char *new)
329 START_PROFILE(syscall_rename
);
330 result
= rename(old
, new);
331 if (errno
== EXDEV
) {
332 /* Rename across filesystems needed. */
333 result
= copy_reg(old
, new);
336 END_PROFILE(syscall_rename
);
340 int vfswrap_fsync(vfs_handle_struct
*handle
, files_struct
*fsp
, int fd
)
345 START_PROFILE(syscall_fsync
);
348 END_PROFILE(syscall_fsync
);
355 int vfswrap_stat(vfs_handle_struct
*handle
, connection_struct
*conn
, const char *fname
, SMB_STRUCT_STAT
*sbuf
)
359 START_PROFILE(syscall_stat
);
360 result
= sys_stat(fname
, sbuf
);
361 END_PROFILE(syscall_stat
);
365 int vfswrap_fstat(vfs_handle_struct
*handle
, files_struct
*fsp
, int fd
, SMB_STRUCT_STAT
*sbuf
)
369 START_PROFILE(syscall_fstat
);
370 result
= sys_fstat(fd
, sbuf
);
371 END_PROFILE(syscall_fstat
);
375 int vfswrap_lstat(vfs_handle_struct
*handle
, connection_struct
*conn
, const char *path
, SMB_STRUCT_STAT
*sbuf
)
379 START_PROFILE(syscall_lstat
);
380 result
= sys_lstat(path
, sbuf
);
381 END_PROFILE(syscall_lstat
);
385 int vfswrap_unlink(vfs_handle_struct
*handle
, connection_struct
*conn
, const char *path
)
389 START_PROFILE(syscall_unlink
);
390 result
= unlink(path
);
391 END_PROFILE(syscall_unlink
);
395 int vfswrap_chmod(vfs_handle_struct
*handle
, connection_struct
*conn
, const char *path
, mode_t mode
)
399 START_PROFILE(syscall_chmod
);
402 * We need to do this due to the fact that the default POSIX ACL
403 * chmod modifies the ACL *mask* for the group owner, not the
404 * group owner bits directly. JRA.
409 int saved_errno
= errno
; /* We might get ENOSYS */
410 if ((result
= SMB_VFS_CHMOD_ACL(conn
, path
, mode
)) == 0) {
411 END_PROFILE(syscall_chmod
);
414 /* Error - return the old errno. */
418 result
= chmod(path
, mode
);
419 END_PROFILE(syscall_chmod
);
423 int vfswrap_fchmod(vfs_handle_struct
*handle
, files_struct
*fsp
, int fd
, mode_t mode
)
427 START_PROFILE(syscall_fchmod
);
430 * We need to do this due to the fact that the default POSIX ACL
431 * chmod modifies the ACL *mask* for the group owner, not the
432 * group owner bits directly. JRA.
436 int saved_errno
= errno
; /* We might get ENOSYS */
437 if ((result
= SMB_VFS_FCHMOD_ACL(fsp
, fd
, mode
)) == 0) {
438 END_PROFILE(syscall_chmod
);
441 /* Error - return the old errno. */
445 #if defined(HAVE_FCHMOD)
446 result
= fchmod(fd
, mode
);
452 END_PROFILE(syscall_fchmod
);
456 int vfswrap_chown(vfs_handle_struct
*handle
, connection_struct
*conn
, const char *path
, uid_t uid
, gid_t gid
)
460 START_PROFILE(syscall_chown
);
461 result
= sys_chown(path
, uid
, gid
);
462 END_PROFILE(syscall_chown
);
466 int vfswrap_fchown(vfs_handle_struct
*handle
, files_struct
*fsp
, int fd
, uid_t uid
, gid_t gid
)
471 START_PROFILE(syscall_fchown
);
473 result
= fchown(fd
, uid
, gid
);
474 END_PROFILE(syscall_fchown
);
482 int vfswrap_chdir(vfs_handle_struct
*handle
, connection_struct
*conn
, const char *path
)
486 START_PROFILE(syscall_chdir
);
487 result
= chdir(path
);
488 END_PROFILE(syscall_chdir
);
492 char *vfswrap_getwd(vfs_handle_struct
*handle
, connection_struct
*conn
, char *path
)
496 START_PROFILE(syscall_getwd
);
497 result
= sys_getwd(path
);
498 END_PROFILE(syscall_getwd
);
502 int vfswrap_utime(vfs_handle_struct
*handle
, connection_struct
*conn
, const char *path
, struct utimbuf
*times
)
506 START_PROFILE(syscall_utime
);
507 result
= utime(path
, times
);
508 END_PROFILE(syscall_utime
);
512 /*********************************************************************
513 A version of ftruncate that will write the space on disk if strict
515 **********************************************************************/
517 static int strict_allocate_ftruncate(vfs_handle_struct
*handle
, files_struct
*fsp
, int fd
, SMB_OFF_T len
)
520 SMB_OFF_T currpos
= SMB_VFS_LSEEK(fsp
, fd
, 0, SEEK_CUR
);
521 unsigned char zero_space
[4096];
522 SMB_OFF_T space_to_write
;
527 if (SMB_VFS_FSTAT(fsp
, fd
, &st
) == -1)
530 space_to_write
= len
- st
.st_size
;
533 if (S_ISFIFO(st
.st_mode
))
537 if (st
.st_size
== len
)
540 /* Shrink - just ftruncate. */
541 if (st
.st_size
> len
)
542 return sys_ftruncate(fd
, len
);
544 /* Write out the real space on disk. */
545 if (SMB_VFS_LSEEK(fsp
, fd
, st
.st_size
, SEEK_SET
) != st
.st_size
)
548 space_to_write
= len
- st
.st_size
;
550 memset(zero_space
, '\0', sizeof(zero_space
));
551 while ( space_to_write
> 0) {
553 SMB_OFF_T current_len_to_write
= MIN(sizeof(zero_space
),space_to_write
);
555 retlen
= SMB_VFS_WRITE(fsp
,fsp
->fd
,(char *)zero_space
,current_len_to_write
);
559 space_to_write
-= retlen
;
562 /* Seek to where we were */
563 if (SMB_VFS_LSEEK(fsp
, fd
, currpos
, SEEK_SET
) != currpos
)
569 int vfswrap_ftruncate(vfs_handle_struct
*handle
, files_struct
*fsp
, int fd
, SMB_OFF_T len
)
576 START_PROFILE(syscall_ftruncate
);
578 if (lp_strict_allocate(SNUM(fsp
->conn
))) {
579 result
= strict_allocate_ftruncate(handle
, fsp
, fd
, len
);
580 END_PROFILE(syscall_ftruncate
);
584 /* we used to just check HAVE_FTRUNCATE_EXTEND and only use
585 sys_ftruncate if the system supports it. Then I discovered that
586 you can have some filesystems that support ftruncate
587 expansion and some that don't! On Linux fat can't do
588 ftruncate extend but ext2 can. */
590 result
= sys_ftruncate(fd
, len
);
594 /* According to W. R. Stevens advanced UNIX prog. Pure 4.3 BSD cannot
595 extend a file with ftruncate. Provide alternate implementation
597 currpos
= SMB_VFS_LSEEK(fsp
, fd
, 0, SEEK_CUR
);
602 /* Do an fstat to see if the file is longer than the requested
603 size in which case the ftruncate above should have
604 succeeded or shorter, in which case seek to len - 1 and
605 write 1 byte of zero */
606 if (SMB_VFS_FSTAT(fsp
, fd
, &st
) == -1) {
611 if (S_ISFIFO(st
.st_mode
)) {
617 if (st
.st_size
== len
) {
622 if (st
.st_size
> len
) {
623 /* the sys_ftruncate should have worked */
627 if (SMB_VFS_LSEEK(fsp
, fd
, len
-1, SEEK_SET
) != len
-1)
630 if (SMB_VFS_WRITE(fsp
, fd
, &c
, 1)!=1)
633 /* Seek to where we were */
634 if (SMB_VFS_LSEEK(fsp
, fd
, currpos
, SEEK_SET
) != currpos
)
640 END_PROFILE(syscall_ftruncate
);
644 BOOL
vfswrap_lock(vfs_handle_struct
*handle
, files_struct
*fsp
, int fd
, int op
, SMB_OFF_T offset
, SMB_OFF_T count
, int type
)
648 START_PROFILE(syscall_fcntl_lock
);
650 result
= fcntl_lock(fd
, op
, offset
, count
,type
);
651 END_PROFILE(syscall_fcntl_lock
);
655 int vfswrap_symlink(vfs_handle_struct
*handle
, connection_struct
*conn
, const char *oldpath
, const char *newpath
)
659 START_PROFILE(syscall_symlink
);
660 result
= sys_symlink(oldpath
, newpath
);
661 END_PROFILE(syscall_symlink
);
665 int vfswrap_readlink(vfs_handle_struct
*handle
, connection_struct
*conn
, const char *path
, char *buf
, size_t bufsiz
)
669 START_PROFILE(syscall_readlink
);
670 result
= sys_readlink(path
, buf
, bufsiz
);
671 END_PROFILE(syscall_readlink
);
675 int vfswrap_link(vfs_handle_struct
*handle
, connection_struct
*conn
, const char *oldpath
, const char *newpath
)
679 START_PROFILE(syscall_link
);
680 result
= sys_link(oldpath
, newpath
);
681 END_PROFILE(syscall_link
);
685 int vfswrap_mknod(vfs_handle_struct
*handle
, connection_struct
*conn
, const char *pathname
, mode_t mode
, SMB_DEV_T dev
)
689 START_PROFILE(syscall_mknod
);
690 result
= sys_mknod(pathname
, mode
, dev
);
691 END_PROFILE(syscall_mknod
);
695 char *vfswrap_realpath(vfs_handle_struct
*handle
, connection_struct
*conn
, const char *path
, char *resolved_path
)
699 START_PROFILE(syscall_realpath
);
700 result
= sys_realpath(path
, resolved_path
);
701 END_PROFILE(syscall_realpath
);
705 size_t vfswrap_fget_nt_acl(vfs_handle_struct
*handle
, files_struct
*fsp
, int fd
, uint32 security_info
, SEC_DESC
**ppdesc
)
709 START_PROFILE(fget_nt_acl
);
710 result
= get_nt_acl(fsp
, security_info
, ppdesc
);
711 END_PROFILE(fget_nt_acl
);
715 size_t vfswrap_get_nt_acl(vfs_handle_struct
*handle
, files_struct
*fsp
, const char *name
, uint32 security_info
, SEC_DESC
**ppdesc
)
719 START_PROFILE(get_nt_acl
);
720 result
= get_nt_acl(fsp
, security_info
, ppdesc
);
721 END_PROFILE(get_nt_acl
);
725 BOOL
vfswrap_fset_nt_acl(vfs_handle_struct
*handle
, files_struct
*fsp
, int fd
, uint32 security_info_sent
, SEC_DESC
*psd
)
729 START_PROFILE(fset_nt_acl
);
730 result
= set_nt_acl(fsp
, security_info_sent
, psd
);
731 END_PROFILE(fset_nt_acl
);
735 BOOL
vfswrap_set_nt_acl(vfs_handle_struct
*handle
, files_struct
*fsp
, const char *name
, uint32 security_info_sent
, SEC_DESC
*psd
)
739 START_PROFILE(set_nt_acl
);
740 result
= set_nt_acl(fsp
, security_info_sent
, psd
);
741 END_PROFILE(set_nt_acl
);
745 int vfswrap_chmod_acl(vfs_handle_struct
*handle
, connection_struct
*conn
, const char *name
, mode_t mode
)
753 START_PROFILE(chmod_acl
);
754 result
= chmod_acl(conn
, name
, mode
);
755 END_PROFILE(chmod_acl
);
760 int vfswrap_fchmod_acl(vfs_handle_struct
*handle
, files_struct
*fsp
, int fd
, mode_t mode
)
768 START_PROFILE(fchmod_acl
);
769 result
= fchmod_acl(fsp
, fd
, mode
);
770 END_PROFILE(fchmod_acl
);
775 int vfswrap_sys_acl_get_entry(vfs_handle_struct
*handle
, connection_struct
*conn
, SMB_ACL_T theacl
, int entry_id
, SMB_ACL_ENTRY_T
*entry_p
)
777 return sys_acl_get_entry(theacl
, entry_id
, entry_p
);
780 int vfswrap_sys_acl_get_tag_type(vfs_handle_struct
*handle
, connection_struct
*conn
, SMB_ACL_ENTRY_T entry_d
, SMB_ACL_TAG_T
*tag_type_p
)
782 return sys_acl_get_tag_type(entry_d
, tag_type_p
);
785 int vfswrap_sys_acl_get_permset(vfs_handle_struct
*handle
, connection_struct
*conn
, SMB_ACL_ENTRY_T entry_d
, SMB_ACL_PERMSET_T
*permset_p
)
787 return sys_acl_get_permset(entry_d
, permset_p
);
790 void * vfswrap_sys_acl_get_qualifier(vfs_handle_struct
*handle
, connection_struct
*conn
, SMB_ACL_ENTRY_T entry_d
)
792 return sys_acl_get_qualifier(entry_d
);
795 SMB_ACL_T
vfswrap_sys_acl_get_file(vfs_handle_struct
*handle
, connection_struct
*conn
, const char *path_p
, SMB_ACL_TYPE_T type
)
797 return sys_acl_get_file(path_p
, type
);
800 SMB_ACL_T
vfswrap_sys_acl_get_fd(vfs_handle_struct
*handle
, files_struct
*fsp
, int fd
)
802 return sys_acl_get_fd(fd
);
805 int vfswrap_sys_acl_clear_perms(vfs_handle_struct
*handle
, connection_struct
*conn
, SMB_ACL_PERMSET_T permset
)
807 return sys_acl_clear_perms(permset
);
810 int vfswrap_sys_acl_add_perm(vfs_handle_struct
*handle
, connection_struct
*conn
, SMB_ACL_PERMSET_T permset
, SMB_ACL_PERM_T perm
)
812 return sys_acl_add_perm(permset
, perm
);
815 char * vfswrap_sys_acl_to_text(vfs_handle_struct
*handle
, connection_struct
*conn
, SMB_ACL_T theacl
, ssize_t
*plen
)
817 return sys_acl_to_text(theacl
, plen
);
820 SMB_ACL_T
vfswrap_sys_acl_init(vfs_handle_struct
*handle
, connection_struct
*conn
, int count
)
822 return sys_acl_init(count
);
825 int vfswrap_sys_acl_create_entry(vfs_handle_struct
*handle
, connection_struct
*conn
, SMB_ACL_T
*pacl
, SMB_ACL_ENTRY_T
*pentry
)
827 return sys_acl_create_entry(pacl
, pentry
);
830 int vfswrap_sys_acl_set_tag_type(vfs_handle_struct
*handle
, connection_struct
*conn
, SMB_ACL_ENTRY_T entry
, SMB_ACL_TAG_T tagtype
)
832 return sys_acl_set_tag_type(entry
, tagtype
);
835 int vfswrap_sys_acl_set_qualifier(vfs_handle_struct
*handle
, connection_struct
*conn
, SMB_ACL_ENTRY_T entry
, void *qual
)
837 return sys_acl_set_qualifier(entry
, qual
);
840 int vfswrap_sys_acl_set_permset(vfs_handle_struct
*handle
, connection_struct
*conn
, SMB_ACL_ENTRY_T entry
, SMB_ACL_PERMSET_T permset
)
842 return sys_acl_set_permset(entry
, permset
);
845 int vfswrap_sys_acl_valid(vfs_handle_struct
*handle
, connection_struct
*conn
, SMB_ACL_T theacl
)
847 return sys_acl_valid(theacl
);
850 int vfswrap_sys_acl_set_file(vfs_handle_struct
*handle
, connection_struct
*conn
, const char *name
, SMB_ACL_TYPE_T acltype
, SMB_ACL_T theacl
)
852 return sys_acl_set_file(name
, acltype
, theacl
);
855 int vfswrap_sys_acl_set_fd(vfs_handle_struct
*handle
, files_struct
*fsp
, int fd
, SMB_ACL_T theacl
)
857 return sys_acl_set_fd(fd
, theacl
);
860 int vfswrap_sys_acl_delete_def_file(vfs_handle_struct
*handle
, connection_struct
*conn
, const char *path
)
862 return sys_acl_delete_def_file(path
);
865 int vfswrap_sys_acl_get_perm(vfs_handle_struct
*handle
, connection_struct
*conn
, SMB_ACL_PERMSET_T permset
, SMB_ACL_PERM_T perm
)
867 return sys_acl_get_perm(permset
, perm
);
870 int vfswrap_sys_acl_free_text(vfs_handle_struct
*handle
, connection_struct
*conn
, char *text
)
872 return sys_acl_free_text(text
);
875 int vfswrap_sys_acl_free_acl(vfs_handle_struct
*handle
, connection_struct
*conn
, SMB_ACL_T posix_acl
)
877 return sys_acl_free_acl(posix_acl
);
880 int vfswrap_sys_acl_free_qualifier(vfs_handle_struct
*handle
, connection_struct
*conn
, void *qualifier
, SMB_ACL_TAG_T tagtype
)
882 return sys_acl_free_qualifier(qualifier
, tagtype
);
885 /****************************************************************
886 Extended attribute operations.
887 *****************************************************************/
889 ssize_t
vfswrap_getxattr(struct vfs_handle_struct
*handle
,struct connection_struct
*conn
,const char *path
, const char *name
, void *value
, size_t size
)
891 return sys_getxattr(path
, name
, value
, size
);
894 ssize_t
vfswrap_lgetxattr(struct vfs_handle_struct
*handle
,struct connection_struct
*conn
,const char *path
, const char *name
, void *value
, size_t size
)
896 return sys_lgetxattr(path
, name
, value
, size
);
899 ssize_t
vfswrap_fgetxattr(struct vfs_handle_struct
*handle
, struct files_struct
*fsp
,int fd
, const char *name
, void *value
, size_t size
)
901 return sys_fgetxattr(fd
, name
, value
, size
);
904 ssize_t
vfswrap_listxattr(struct vfs_handle_struct
*handle
, struct connection_struct
*conn
,const char *path
, char *list
, size_t size
)
906 return sys_listxattr(path
, list
, size
);
909 ssize_t
vfswrap_llistxattr(struct vfs_handle_struct
*handle
, struct connection_struct
*conn
,const char *path
, char *list
, size_t size
)
911 return sys_llistxattr(path
, list
, size
);
914 ssize_t
vfswrap_flistxattr(struct vfs_handle_struct
*handle
, struct files_struct
*fsp
,int fd
, char *list
, size_t size
)
916 return sys_flistxattr(fd
, list
, size
);
919 int vfswrap_removexattr(struct vfs_handle_struct
*handle
, struct connection_struct
*conn
,const char *path
, const char *name
)
921 return sys_removexattr(path
, name
);
924 int vfswrap_lremovexattr(struct vfs_handle_struct
*handle
, struct connection_struct
*conn
,const char *path
, const char *name
)
926 return sys_lremovexattr(path
, name
);
929 int vfswrap_fremovexattr(struct vfs_handle_struct
*handle
, struct files_struct
*fsp
,int fd
, const char *name
)
931 return sys_fremovexattr(fd
, name
);
934 int vfswrap_setxattr(struct vfs_handle_struct
*handle
, struct connection_struct
*conn
,const char *path
, const char *name
, const void *value
, size_t size
, int flags
)
936 return sys_setxattr(path
, name
, value
, size
, flags
);
939 int vfswrap_lsetxattr(struct vfs_handle_struct
*handle
, struct connection_struct
*conn
,const char *path
, const char *name
, const void *value
, size_t size
, int flags
)
941 return sys_lsetxattr(path
, name
, value
, size
, flags
);
944 int vfswrap_fsetxattr(struct vfs_handle_struct
*handle
, struct files_struct
*fsp
,int fd
, const char *name
, const void *value
, size_t size
, int flags
)
946 return sys_fsetxattr(fd
, name
, value
, size
, flags
);