s4:ntvfs Don't attempt to follow NULL in unixuid_setup_security()
[ira/wip.git] / 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;
        }