Fix vfs to work with P_LIST-ed lp_vfsobj() -- the traversal is reversed. Based on...
authorAlexander Bokovoy <ab@samba.org>
Mon, 31 Mar 2003 16:27:11 +0000 (16:27 +0000)
committerAlexander Bokovoy <ab@samba.org>
Mon, 31 Mar 2003 16:27:11 +0000 (16:27 +0000)
source/smbd/vfs.c

index 465d14abba413ae6c503dbb3bec802d68bde0067..adbde4994db4331d1e20e49bc82b046b7c438838 100644 (file)
@@ -314,8 +314,8 @@ BOOL smbd_vfs_init(connection_struct *conn)
 {
        const char **vfs_objects;
        char *vfs_module, *vfs_path;
-       unsigned int i;
-       unsigned int j = 0;
+       unsigned int i = 0;
+       int j = 0;
        struct smb_vfs_handle_struct *handle;
        
        /* Normal share - initialise with disk access functions */
@@ -334,7 +334,9 @@ BOOL smbd_vfs_init(connection_struct *conn)
 
        vfs_path = lp_vfs_path(SNUM(conn));
        
-       for (j=0; vfs_objects[j]; j++) {
+       for (i=0; vfs_objects[i]; i++); /* count passed modules */
+        
+       for (j=i-1; j >= 0; j--) {
                conn->vfs_private = NULL;
                handle = (struct smb_vfs_handle_struct *) smb_xmalloc(sizeof(smb_vfs_handle_struct));
                /* Loadable object file */