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

Alexandre Julliard julliard at wine.codeweavers.com
Fri Feb 12 09:47:45 CST 2016


Module: wine
Branch: master
Commit: 10a38ef0567c34a7f56ee88f6f972507f6eecf2c
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=10a38ef0567c34a7f56ee88f6f972507f6eecf2c

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Fri Feb 12 21:06:58 2016 +0900

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

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 server/handle.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/server/handle.c b/server/handle.c
index 3b0d033..37fba69 100644
--- a/server/handle.c
+++ b/server/handle.c
@@ -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 )))
     {




More information about the wine-cvs mailing list