server: Require a directory as root to open an object with a name.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2016-02-12 21:06:58 +09:00
parent ff9d90bbb0
commit 10a38ef056
1 changed files with 8 additions and 1 deletions

View File

@ -592,7 +592,14 @@ obj_handle_t open_object( struct process *process, obj_handle_t parent, unsigned
return 0; return 0;
} }
if (parent && !(root = get_handle_obj( process, parent, 0, NULL ))) return 0; if (parent)
{
if (name->len)
root = get_directory_obj( process, parent );
else /* opening the object itself can work for non-directories too */
root = get_handle_obj( process, parent, 0, NULL );
if (!root) return 0;
}
if ((obj = open_named_object( root, ops, name, attributes ))) if ((obj = open_named_object( root, ops, name, attributes )))
{ {