s4-ntvfs: check if pvfs is NULL in pvfs_logoff
authorbrendan powers <brendan0powers@gmail.com>
Thu, 17 Dec 2009 00:01:32 +0000 (19:01 -0500)
committerAndrew Tridgell <tridge@samba.org>
Thu, 17 Dec 2009 00:48:39 +0000 (11:48 +1100)
pvfs can be NULL if the directory a share points to does not exist. In
this case, there would be no open files, so it is safe to just return
from the function.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
source4/ntvfs/posix/pvfs_open.c

index 621db3cf1da9a56bdbb7c23762c50a00facf5c35..aa66ad782d12906853e331efcb2308dede3dccf5 100644 (file)
@@ -1713,6 +1713,11 @@ NTSTATUS pvfs_logoff(struct ntvfs_module_context *ntvfs,
                                  struct pvfs_state);
        struct pvfs_file *f, *next;
 
+       /* If pvfs is NULL, we never logged on, and no files are open. */
+       if(pvfs == NULL) {
+               return NT_STATUS_OK;
+       }
+
        for (f=pvfs->files.list;f;f=next) {
                next = f->next;
                if (f->ntvfs->session_info == req->session_info) {