s4:ntvfs Don't attempt to follow NULL in unixuid_setup_security()
authorAndrew Bartlett <abartlet@samba.org>
Tue, 22 Sep 2009 21:14:19 +0000 (14:14 -0700)
committerMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
Fri, 2 Oct 2009 10:44:58 +0000 (12:44 +0200)
This segfault occoured in cases where we rejected (or never attempted)
the tree connect, so had an invalid private pointer for the logoff
codepath.

Andrew Bartlett

source4/ntvfs/unixuid/vfs_unixuid.c

index 97c306f7c3542e291a0814cb0d80d6fa4ce145c4..70ad6ee253411b15d4f8a91ca337982232ddd022 100644 (file)
@@ -235,7 +235,10 @@ static NTSTATUS unixuid_setup_security(struct ntvfs_module_context *ntvfs,
        struct unix_sec_ctx *newsec;
        NTSTATUS status;
 
-       if (req->session_info == NULL) {
+       /* If we are asked to set up, but have not had a successful
+        * session setup or tree connect, then these may not be filled
+        * in.  ACCESS_DENIED is the right error code here */
+       if (req->session_info == NULL || priv == NULL) {
                return NT_STATUS_ACCESS_DENIED;
        }