Fix bug 7075 - bug in vfs_scannedonly rmdir implementation.
authorJeremy Allison <jra@samba.org>
Fri, 5 Feb 2010 00:23:32 +0000 (16:23 -0800)
committerJeremy Allison <jra@samba.org>
Fri, 5 Feb 2010 00:23:32 +0000 (16:23 -0800)
Check for NULL on opendir, correctly call next rmdir.

Jeremy.

source3/modules/vfs_scannedonly.c

index 42e9aeccdac907a1fc9a080aec6c0d1f96ff473a..12077f374da0dc49d83a7b27654c67dea73eb205 100644 (file)
@@ -828,6 +828,9 @@ static int scannedonly_rmdir(vfs_handle_struct * handle, const char *path)
 
        path_w_slash = name_w_ending_slash(ctx,path);
        dirp = SMB_VFS_NEXT_OPENDIR(handle, path, NULL, 0);
+       if (!dirp) {
+               return -1;
+       }
        while ((dire = SMB_VFS_NEXT_READDIR(handle, dirp, NULL)) != NULL) {
                if (ISDOT(dire->d_name) || ISDOTDOT(dire->d_name)) {
                        continue;
@@ -884,7 +887,8 @@ static int scannedonly_rmdir(vfs_handle_struct * handle, const char *path)
                        TALLOC_FREE(smb_fname);
                }
        }
-       return SMB_VFS_NEXT_CLOSEDIR(handle, dirp);
+       SMB_VFS_NEXT_CLOSEDIR(handle, dirp);
+       return SMB_VFS_NEXT_RMDIR(handle, path);
 }
 
 static void free_scannedonly_data(void **data)