summaryrefslogtreecommitdiff
path: root/source3/smbd/vfs-wrap.c
diff options
context:
space:
mode:
authorAlexander Bokovoy <ab@samba.org>2003-05-12 16:03:16 +0000
committerAlexander Bokovoy <ab@samba.org>2003-05-12 16:03:16 +0000
commitc9bfb7660bf60d32c51bfe368ce874770adb6f10 (patch)
tree8236542fe05d4ce2e9ba4f615daab2ed7bdf4f2b /source3/smbd/vfs-wrap.c
parented1c7282e45b9b962bc2e77a544719bbc506f294 (diff)
downloadsamba-c9bfb7660bf60d32c51bfe368ce874770adb6f10.tar.gz
samba-c9bfb7660bf60d32c51bfe368ce874770adb6f10.tar.bz2
samba-c9bfb7660bf60d32c51bfe368ce874770adb6f10.zip
Eliminate NULL pointers from VFS interface. All hooks now really callable, producing either correct result or returning error if the feature isn't supported in the configuration
(This used to be commit af0a17349e6986eef2e2fd07b4b9f0bcd33bbe1f)
Diffstat (limited to 'source3/smbd/vfs-wrap.c')
-rw-r--r--source3/smbd/vfs-wrap.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/source3/smbd/vfs-wrap.c b/source3/smbd/vfs-wrap.c
index dd8aad1170..e170effd4e 100644
--- a/source3/smbd/vfs-wrap.c
+++ b/source3/smbd/vfs-wrap.c
@@ -93,10 +93,8 @@ int vfswrap_mkdir(vfs_handle_struct *handle, connection_struct *conn, const char
* mess up any inherited ACL bits that were set. JRA.
*/
int saved_errno = errno; /* We may get ENOSYS */
- if (conn->vfs.ops.chmod_acl != NULL) {
- if ((VFS_CHMOD_ACL(conn, path, mode) == -1) && (errno == ENOSYS))
- errno = saved_errno;
- }
+ if ((VFS_CHMOD_ACL(conn, path, mode) == -1) && (errno == ENOSYS))
+ errno = saved_errno;
}
END_PROFILE(syscall_mkdir);
@@ -281,7 +279,7 @@ int vfswrap_chmod(vfs_handle_struct *handle, connection_struct *conn, const char
*/
- if (conn->vfs.ops.chmod_acl != NULL) {
+ {
int saved_errno = errno; /* We might get ENOSYS */
if ((result = VFS_CHMOD_ACL(conn, path, mode)) == 0) {
END_PROFILE(syscall_chmod);
@@ -309,7 +307,7 @@ int vfswrap_fchmod(vfs_handle_struct *handle, files_struct *fsp, int fd, mode_t
* group owner bits directly. JRA.
*/
- if (vfs_ops->ops.fchmod_acl != NULL) {
+ {
int saved_errno = errno; /* We might get ENOSYS */
if ((result = VFS_FCHMOD_ACL(fsp, fd, mode)) == 0) {
END_PROFILE(syscall_chmod);
@@ -621,22 +619,32 @@ BOOL vfswrap_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp, const char
int vfswrap_chmod_acl(vfs_handle_struct *handle, connection_struct *conn, const char *name, mode_t mode)
{
+#ifdef HAVE_NO_ACL
+ errno = ENOSYS;
+ return -1;
+#else
int result;
START_PROFILE(chmod_acl);
result = chmod_acl(conn, name, mode);
END_PROFILE(chmod_acl);
return result;
+#endif
}
int vfswrap_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp, int fd, mode_t mode)
{
+#ifdef HAVE_NO_ACL
+ errno = ENOSYS;
+ return -1;
+#else
int result;
START_PROFILE(fchmod_acl);
result = fchmod_acl(fsp, fd, mode);
END_PROFILE(fchmod_acl);
return result;
+#endif
}
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)