Eliminate NULL pointers from VFS interface. All hooks now really callable, producing...
authorAlexander Bokovoy <ab@samba.org>
Mon, 12 May 2003 16:03:16 +0000 (16:03 +0000)
committerAlexander Bokovoy <ab@samba.org>
Mon, 12 May 2003 16:03:16 +0000 (16:03 +0000)
(This used to be commit af0a17349e6986eef2e2fd07b4b9f0bcd33bbe1f)

source3/smbd/open.c
source3/smbd/vfs-wrap.c
source3/smbd/vfs.c

index 412a0dfc504151ab8a2acc3c6ee5f5288a2259d3..959439a1b2318bf9d801cfa695da5a47b06ccb54 100644 (file)
@@ -1146,7 +1146,7 @@ flags=0x%X flags2=0x%X mode=0%o returned %d\n",
         * selected.
         */
 
-       if (!file_existed && !def_acl && (conn->vfs.ops.fchmod_acl != NULL)) {
+       if (!file_existed && !def_acl) {
 
                int saved_errno = errno; /* We might get ENOSYS in the next call.. */
 
@@ -1159,7 +1159,7 @@ flags=0x%X flags2=0x%X mode=0%o returned %d\n",
 
                /* Attributes need changing. File already existed. */
 
-               if (conn->vfs.ops.fchmod_acl != NULL) {
+               {
                        int saved_errno = errno; /* We might get ENOSYS in the next call.. */
                        ret = VFS_FCHMOD_ACL(fsp, fsp->fd, new_mode);
 
index dd8aad117065279a6bbc4d232db0f82ef7a0f9e2..e170effd4e855f0301817e0df7caae60cda4e703 100644 (file)
@@ -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)
index 92342a673bdd1705198fc479d49d8fd31d83bb0c..9f37622c8c145418f3805cca337102ffc0bf49ed 100644 (file)
@@ -100,13 +100,9 @@ static struct vfs_ops default_vfs = {
                vfswrap_set_nt_acl,
        
                /* POSIX ACL operations. */
-#if defined(HAVE_NO_ACLS)
-               NULL,
-               NULL,
-#else
                vfswrap_chmod_acl,
                vfswrap_fchmod_acl,
-#endif
+
                vfswrap_sys_acl_get_entry,
                vfswrap_sys_acl_get_tag_type,
                vfswrap_sys_acl_get_permset,