Commit 10a38ef0 authored by Alexandre Julliard's avatar Alexandre Julliard

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

parent ff9d90bb
......@@ -592,7 +592,14 @@ obj_handle_t open_object( struct process *process, obj_handle_t parent, unsigned
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 )))
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment