A fix to allow configure to find iconv on a number of systems including those
[Samba/gebeck_regimport.git] / source3 / smbd / vfs-wrap.c
bloba76a7a6abdcd22413a4e20755bfed64da4d3f0ea
1 /*
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.
21 #include "includes.h"
23 #undef DBGC_CLASS
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
31 this possibility. */
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)
42 /* Disk operations */
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)
47 SMB_BIG_UINT result;
49 result = sys_disk_free(path, small_query, bsize, dfree, dsize);
50 return result;
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
56 int result;
58 START_PROFILE(syscall_get_quota);
59 result = sys_get_quota(conn->connectpath, qtype, id, qt);
60 END_PROFILE(syscall_get_quota);
61 return result;
62 #else
63 errno = ENOSYS;
64 return -1;
65 #endif
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
71 int result;
73 START_PROFILE(syscall_set_quota);
74 result = sys_set_quota(conn->connectpath, qtype, id, qt);
75 END_PROFILE(syscall_set_quota);
76 return result;
77 #else
78 errno = ENOSYS;
79 return -1;
80 #endif
83 int vfswrap_get_shadow_copy_data(struct vfs_handle_struct *handle, struct files_struct *fsp, SHADOW_COPY_DATA *shadow_copy_data, BOOL labels)
85 errno = ENOSYS;
86 return -1; /* Not implemented. */
89 /* Directory operations */
91 DIR *vfswrap_opendir(vfs_handle_struct *handle, connection_struct *conn, const char *fname)
93 DIR *result;
95 START_PROFILE(syscall_opendir);
96 result = opendir(fname);
97 END_PROFILE(syscall_opendir);
98 return result;
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);
108 return result;
111 int vfswrap_mkdir(vfs_handle_struct *handle, connection_struct *conn, const char *path, mode_t mode)
113 int result;
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))))
119 mode = 0777;
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))
133 errno = saved_errno;
136 END_PROFILE(syscall_mkdir);
137 return result;
140 int vfswrap_rmdir(vfs_handle_struct *handle, connection_struct *conn, const char *path)
142 int result;
144 START_PROFILE(syscall_rmdir);
145 result = rmdir(path);
146 END_PROFILE(syscall_rmdir);
147 return result;
150 int vfswrap_closedir(vfs_handle_struct *handle, connection_struct *conn, DIR *dirp)
152 int result;
154 START_PROFILE(syscall_closedir);
155 result = closedir(dirp);
156 END_PROFILE(syscall_closedir);
157 return result;
160 /* File operations */
162 int vfswrap_open(vfs_handle_struct *handle, connection_struct *conn, const char *fname, int flags, mode_t mode)
164 int result;
166 START_PROFILE(syscall_open);
167 result = sys_open(fname, flags, mode);
168 END_PROFILE(syscall_open);
169 return result;
172 int vfswrap_close(vfs_handle_struct *handle, files_struct *fsp, int fd)
174 int result;
176 START_PROFILE(syscall_close);
178 result = close(fd);
179 END_PROFILE(syscall_close);
180 return result;
183 ssize_t vfswrap_read(vfs_handle_struct *handle, files_struct *fsp, int fd, void *data, size_t n)
185 ssize_t result;
187 START_PROFILE_BYTES(syscall_read, n);
188 result = sys_read(fd, data, n);
189 END_PROFILE(syscall_read);
190 return result;
193 ssize_t vfswrap_write(vfs_handle_struct *handle, files_struct *fsp, int fd, const void *data, size_t n)
195 ssize_t result;
197 START_PROFILE_BYTES(syscall_write, n);
198 result = sys_write(fd, data, n);
199 END_PROFILE(syscall_write);
200 return result;
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. */
210 if (filedes != -1)
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
217 * applications. JRA.
220 if((result == -1) && (errno == ESPIPE)) {
221 result = 0;
222 errno = 0;
225 END_PROFILE(syscall_lseek);
226 return result;
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)
232 ssize_t result;
234 START_PROFILE_BYTES(syscall_sendfile, n);
235 result = sys_sendfile(tofd, fromfd, hdr, offset, n);
236 END_PROFILE(syscall_sendfile);
237 return result;
240 int vfswrap_rename(vfs_handle_struct *handle, connection_struct *conn, const char *old, const char *new)
242 int result;
244 START_PROFILE(syscall_rename);
245 result = rename(old, new);
246 END_PROFILE(syscall_rename);
247 return result;
250 int vfswrap_fsync(vfs_handle_struct *handle, files_struct *fsp, int fd)
252 #ifdef HAVE_FSYNC
253 int result;
255 START_PROFILE(syscall_fsync);
257 result = fsync(fd);
258 END_PROFILE(syscall_fsync);
259 return result;
260 #else
261 return 0;
262 #endif
265 int vfswrap_stat(vfs_handle_struct *handle, connection_struct *conn, const char *fname, SMB_STRUCT_STAT *sbuf)
267 int result;
269 START_PROFILE(syscall_stat);
270 result = sys_stat(fname, sbuf);
271 END_PROFILE(syscall_stat);
272 return result;
275 int vfswrap_fstat(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_STRUCT_STAT *sbuf)
277 int result;
279 START_PROFILE(syscall_fstat);
280 result = sys_fstat(fd, sbuf);
281 END_PROFILE(syscall_fstat);
282 return result;
285 int vfswrap_lstat(vfs_handle_struct *handle, connection_struct *conn, const char *path, SMB_STRUCT_STAT *sbuf)
287 int result;
289 START_PROFILE(syscall_lstat);
290 result = sys_lstat(path, sbuf);
291 END_PROFILE(syscall_lstat);
292 return result;
295 int vfswrap_unlink(vfs_handle_struct *handle, connection_struct *conn, const char *path)
297 int result;
299 START_PROFILE(syscall_unlink);
300 result = unlink(path);
301 END_PROFILE(syscall_unlink);
302 return result;
305 int vfswrap_chmod(vfs_handle_struct *handle, connection_struct *conn, const char *path, mode_t mode)
307 int result;
309 START_PROFILE(syscall_chmod);
312 * We need to do this due to the fact that the default POSIX ACL
313 * chmod modifies the ACL *mask* for the group owner, not the
314 * group owner bits directly. JRA.
319 int saved_errno = errno; /* We might get ENOSYS */
320 if ((result = SMB_VFS_CHMOD_ACL(conn, path, mode)) == 0) {
321 END_PROFILE(syscall_chmod);
322 return result;
324 /* Error - return the old errno. */
325 errno = saved_errno;
328 result = chmod(path, mode);
329 END_PROFILE(syscall_chmod);
330 return result;
333 int vfswrap_fchmod(vfs_handle_struct *handle, files_struct *fsp, int fd, mode_t mode)
335 int result;
337 START_PROFILE(syscall_fchmod);
340 * We need to do this due to the fact that the default POSIX ACL
341 * chmod modifies the ACL *mask* for the group owner, not the
342 * group owner bits directly. JRA.
346 int saved_errno = errno; /* We might get ENOSYS */
347 if ((result = SMB_VFS_FCHMOD_ACL(fsp, fd, mode)) == 0) {
348 END_PROFILE(syscall_chmod);
349 return result;
351 /* Error - return the old errno. */
352 errno = saved_errno;
355 #if defined(HAVE_FCHMOD)
356 result = fchmod(fd, mode);
357 #else
358 result = -1;
359 errno = ENOSYS;
360 #endif
362 END_PROFILE(syscall_fchmod);
363 return result;
366 int vfswrap_chown(vfs_handle_struct *handle, connection_struct *conn, const char *path, uid_t uid, gid_t gid)
368 int result;
370 START_PROFILE(syscall_chown);
371 result = sys_chown(path, uid, gid);
372 END_PROFILE(syscall_chown);
373 return result;
376 int vfswrap_fchown(vfs_handle_struct *handle, files_struct *fsp, int fd, uid_t uid, gid_t gid)
378 #ifdef HAVE_FCHOWN
379 int result;
381 START_PROFILE(syscall_fchown);
383 result = fchown(fd, uid, gid);
384 END_PROFILE(syscall_fchown);
385 return result;
386 #else
387 errno = ENOSYS;
388 return -1;
389 #endif
392 int vfswrap_chdir(vfs_handle_struct *handle, connection_struct *conn, const char *path)
394 int result;
396 START_PROFILE(syscall_chdir);
397 result = chdir(path);
398 END_PROFILE(syscall_chdir);
399 return result;
402 char *vfswrap_getwd(vfs_handle_struct *handle, connection_struct *conn, char *path)
404 char *result;
406 START_PROFILE(syscall_getwd);
407 result = sys_getwd(path);
408 END_PROFILE(syscall_getwd);
409 return result;
412 int vfswrap_utime(vfs_handle_struct *handle, connection_struct *conn, const char *path, struct utimbuf *times)
414 int result;
416 START_PROFILE(syscall_utime);
417 result = utime(path, times);
418 END_PROFILE(syscall_utime);
419 return result;
422 /*********************************************************************
423 A version of ftruncate that will write the space on disk if strict
424 allocate is set.
425 **********************************************************************/
427 static int strict_allocate_ftruncate(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_OFF_T len)
429 SMB_STRUCT_STAT st;
430 SMB_OFF_T currpos = SMB_VFS_LSEEK(fsp, fd, 0, SEEK_CUR);
431 unsigned char zero_space[4096];
432 SMB_OFF_T space_to_write;
434 if (currpos == -1)
435 return -1;
437 if (SMB_VFS_FSTAT(fsp, fd, &st) == -1)
438 return -1;
440 space_to_write = len - st.st_size;
442 #ifdef S_ISFIFO
443 if (S_ISFIFO(st.st_mode))
444 return 0;
445 #endif
447 if (st.st_size == len)
448 return 0;
450 /* Shrink - just ftruncate. */
451 if (st.st_size > len)
452 return sys_ftruncate(fd, len);
454 /* Write out the real space on disk. */
455 if (SMB_VFS_LSEEK(fsp, fd, st.st_size, SEEK_SET) != st.st_size)
456 return -1;
458 space_to_write = len - st.st_size;
460 memset(zero_space, '\0', sizeof(zero_space));
461 while ( space_to_write > 0) {
462 SMB_OFF_T retlen;
463 SMB_OFF_T current_len_to_write = MIN(sizeof(zero_space),space_to_write);
465 retlen = SMB_VFS_WRITE(fsp,fsp->fd,(char *)zero_space,current_len_to_write);
466 if (retlen <= 0)
467 return -1;
469 space_to_write -= retlen;
472 /* Seek to where we were */
473 if (SMB_VFS_LSEEK(fsp, fd, currpos, SEEK_SET) != currpos)
474 return -1;
476 return 0;
479 int vfswrap_ftruncate(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_OFF_T len)
481 int result = -1;
482 SMB_STRUCT_STAT st;
483 char c = 0;
484 SMB_OFF_T currpos;
486 START_PROFILE(syscall_ftruncate);
488 if (lp_strict_allocate(SNUM(fsp->conn))) {
489 result = strict_allocate_ftruncate(handle, fsp, fd, len);
490 END_PROFILE(syscall_ftruncate);
491 return result;
494 /* we used to just check HAVE_FTRUNCATE_EXTEND and only use
495 sys_ftruncate if the system supports it. Then I discovered that
496 you can have some filesystems that support ftruncate
497 expansion and some that don't! On Linux fat can't do
498 ftruncate extend but ext2 can. */
500 result = sys_ftruncate(fd, len);
501 if (result == 0)
502 goto done;
504 /* According to W. R. Stevens advanced UNIX prog. Pure 4.3 BSD cannot
505 extend a file with ftruncate. Provide alternate implementation
506 for this */
507 currpos = SMB_VFS_LSEEK(fsp, fd, 0, SEEK_CUR);
508 if (currpos == -1) {
509 goto done;
512 /* Do an fstat to see if the file is longer than the requested
513 size in which case the ftruncate above should have
514 succeeded or shorter, in which case seek to len - 1 and
515 write 1 byte of zero */
516 if (SMB_VFS_FSTAT(fsp, fd, &st) == -1) {
517 goto done;
520 #ifdef S_ISFIFO
521 if (S_ISFIFO(st.st_mode)) {
522 result = 0;
523 goto done;
525 #endif
527 if (st.st_size == len) {
528 result = 0;
529 goto done;
532 if (st.st_size > len) {
533 /* the sys_ftruncate should have worked */
534 goto done;
537 if (SMB_VFS_LSEEK(fsp, fd, len-1, SEEK_SET) != len -1)
538 goto done;
540 if (SMB_VFS_WRITE(fsp, fd, &c, 1)!=1)
541 goto done;
543 /* Seek to where we were */
544 if (SMB_VFS_LSEEK(fsp, fd, currpos, SEEK_SET) != currpos)
545 goto done;
546 result = 0;
548 done:
550 END_PROFILE(syscall_ftruncate);
551 return result;
554 BOOL vfswrap_lock(vfs_handle_struct *handle, files_struct *fsp, int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type)
556 BOOL result;
558 START_PROFILE(syscall_fcntl_lock);
560 result = fcntl_lock(fd, op, offset, count,type);
561 END_PROFILE(syscall_fcntl_lock);
562 return result;
565 int vfswrap_symlink(vfs_handle_struct *handle, connection_struct *conn, const char *oldpath, const char *newpath)
567 int result;
569 START_PROFILE(syscall_symlink);
570 result = sys_symlink(oldpath, newpath);
571 END_PROFILE(syscall_symlink);
572 return result;
575 int vfswrap_readlink(vfs_handle_struct *handle, connection_struct *conn, const char *path, char *buf, size_t bufsiz)
577 int result;
579 START_PROFILE(syscall_readlink);
580 result = sys_readlink(path, buf, bufsiz);
581 END_PROFILE(syscall_readlink);
582 return result;
585 int vfswrap_link(vfs_handle_struct *handle, connection_struct *conn, const char *oldpath, const char *newpath)
587 int result;
589 START_PROFILE(syscall_link);
590 result = sys_link(oldpath, newpath);
591 END_PROFILE(syscall_link);
592 return result;
595 int vfswrap_mknod(vfs_handle_struct *handle, connection_struct *conn, const char *pathname, mode_t mode, SMB_DEV_T dev)
597 int result;
599 START_PROFILE(syscall_mknod);
600 result = sys_mknod(pathname, mode, dev);
601 END_PROFILE(syscall_mknod);
602 return result;
605 char *vfswrap_realpath(vfs_handle_struct *handle, connection_struct *conn, const char *path, char *resolved_path)
607 char *result;
609 START_PROFILE(syscall_realpath);
610 result = sys_realpath(path, resolved_path);
611 END_PROFILE(syscall_realpath);
612 return result;
615 size_t vfswrap_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp, int fd, uint32 security_info, SEC_DESC **ppdesc)
617 size_t result;
619 START_PROFILE(fget_nt_acl);
620 result = get_nt_acl(fsp, security_info, ppdesc);
621 END_PROFILE(fget_nt_acl);
622 return result;
625 size_t vfswrap_get_nt_acl(vfs_handle_struct *handle, files_struct *fsp, const char *name, uint32 security_info, SEC_DESC **ppdesc)
627 size_t result;
629 START_PROFILE(get_nt_acl);
630 result = get_nt_acl(fsp, security_info, ppdesc);
631 END_PROFILE(get_nt_acl);
632 return result;
635 BOOL vfswrap_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, int fd, uint32 security_info_sent, SEC_DESC *psd)
637 BOOL result;
639 START_PROFILE(fset_nt_acl);
640 result = set_nt_acl(fsp, security_info_sent, psd);
641 END_PROFILE(fset_nt_acl);
642 return result;
645 BOOL vfswrap_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp, const char *name, uint32 security_info_sent, SEC_DESC *psd)
647 BOOL result;
649 START_PROFILE(set_nt_acl);
650 result = set_nt_acl(fsp, security_info_sent, psd);
651 END_PROFILE(set_nt_acl);
652 return result;
655 int vfswrap_chmod_acl(vfs_handle_struct *handle, connection_struct *conn, const char *name, mode_t mode)
657 #ifdef HAVE_NO_ACL
658 errno = ENOSYS;
659 return -1;
660 #else
661 int result;
663 START_PROFILE(chmod_acl);
664 result = chmod_acl(conn, name, mode);
665 END_PROFILE(chmod_acl);
666 return result;
667 #endif
670 int vfswrap_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp, int fd, mode_t mode)
672 #ifdef HAVE_NO_ACL
673 errno = ENOSYS;
674 return -1;
675 #else
676 int result;
678 START_PROFILE(fchmod_acl);
679 result = fchmod_acl(fsp, fd, mode);
680 END_PROFILE(fchmod_acl);
681 return result;
682 #endif
685 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)
687 return sys_acl_get_entry(theacl, entry_id, entry_p);
690 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)
692 return sys_acl_get_tag_type(entry_d, tag_type_p);
695 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)
697 return sys_acl_get_permset(entry_d, permset_p);
700 void * vfswrap_sys_acl_get_qualifier(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_ENTRY_T entry_d)
702 return sys_acl_get_qualifier(entry_d);
705 SMB_ACL_T vfswrap_sys_acl_get_file(vfs_handle_struct *handle, connection_struct *conn, const char *path_p, SMB_ACL_TYPE_T type)
707 return sys_acl_get_file(path_p, type);
710 SMB_ACL_T vfswrap_sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp, int fd)
712 return sys_acl_get_fd(fd);
715 int vfswrap_sys_acl_clear_perms(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_PERMSET_T permset)
717 return sys_acl_clear_perms(permset);
720 int vfswrap_sys_acl_add_perm(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm)
722 return sys_acl_add_perm(permset, perm);
725 char * vfswrap_sys_acl_to_text(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_T theacl, ssize_t *plen)
727 return sys_acl_to_text(theacl, plen);
730 SMB_ACL_T vfswrap_sys_acl_init(vfs_handle_struct *handle, connection_struct *conn, int count)
732 return sys_acl_init(count);
735 int vfswrap_sys_acl_create_entry(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_T *pacl, SMB_ACL_ENTRY_T *pentry)
737 return sys_acl_create_entry(pacl, pentry);
740 int vfswrap_sys_acl_set_tag_type(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_ENTRY_T entry, SMB_ACL_TAG_T tagtype)
742 return sys_acl_set_tag_type(entry, tagtype);
745 int vfswrap_sys_acl_set_qualifier(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_ENTRY_T entry, void *qual)
747 return sys_acl_set_qualifier(entry, qual);
750 int vfswrap_sys_acl_set_permset(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_ENTRY_T entry, SMB_ACL_PERMSET_T permset)
752 return sys_acl_set_permset(entry, permset);
755 int vfswrap_sys_acl_valid(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_T theacl )
757 return sys_acl_valid(theacl );
760 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)
762 return sys_acl_set_file(name, acltype, theacl);
765 int vfswrap_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_ACL_T theacl)
767 return sys_acl_set_fd(fd, theacl);
770 int vfswrap_sys_acl_delete_def_file(vfs_handle_struct *handle, connection_struct *conn, const char *path)
772 return sys_acl_delete_def_file(path);
775 int vfswrap_sys_acl_get_perm(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm)
777 return sys_acl_get_perm(permset, perm);
780 int vfswrap_sys_acl_free_text(vfs_handle_struct *handle, connection_struct *conn, char *text)
782 return sys_acl_free_text(text);
785 int vfswrap_sys_acl_free_acl(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_T posix_acl)
787 return sys_acl_free_acl(posix_acl);
790 int vfswrap_sys_acl_free_qualifier(vfs_handle_struct *handle, connection_struct *conn, void *qualifier, SMB_ACL_TAG_T tagtype)
792 return sys_acl_free_qualifier(qualifier, tagtype);
795 /****************************************************************
796 Extended attribute operations.
797 *****************************************************************/
799 ssize_t vfswrap_getxattr(struct vfs_handle_struct *handle,struct connection_struct *conn,const char *path, const char *name, void *value, size_t size)
801 return sys_getxattr(path, name, value, size);
804 ssize_t vfswrap_lgetxattr(struct vfs_handle_struct *handle,struct connection_struct *conn,const char *path, const char *name, void *value, size_t size)
806 return sys_lgetxattr(path, name, value, size);
809 ssize_t vfswrap_fgetxattr(struct vfs_handle_struct *handle, struct files_struct *fsp,int fd, const char *name, void *value, size_t size)
811 return sys_fgetxattr(fd, name, value, size);
814 ssize_t vfswrap_listxattr(struct vfs_handle_struct *handle, struct connection_struct *conn,const char *path, char *list, size_t size)
816 return sys_listxattr(path, list, size);
819 ssize_t vfswrap_llistxattr(struct vfs_handle_struct *handle, struct connection_struct *conn,const char *path, char *list, size_t size)
821 return sys_llistxattr(path, list, size);
824 ssize_t vfswrap_flistxattr(struct vfs_handle_struct *handle, struct files_struct *fsp,int fd, char *list, size_t size)
826 return sys_flistxattr(fd, list, size);
829 int vfswrap_removexattr(struct vfs_handle_struct *handle, struct connection_struct *conn,const char *path, const char *name)
831 return sys_removexattr(path, name);
834 int vfswrap_lremovexattr(struct vfs_handle_struct *handle, struct connection_struct *conn,const char *path, const char *name)
836 return sys_lremovexattr(path, name);
839 int vfswrap_fremovexattr(struct vfs_handle_struct *handle, struct files_struct *fsp,int fd, const char *name)
841 return sys_fremovexattr(fd, name);
844 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)
846 return sys_setxattr(path, name, value, size, flags);
849 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)
851 return sys_lsetxattr(path, name, value, size, flags);
854 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)
856 return sys_fsetxattr(fd, name, value, size, flags);