[v3 2/3] server: Named pipe client needs to use the server SD

Jonathan Doron jond at wizery.com
Tue Sep 12 07:33:38 CDT 2017


Signed-off-by: Jonathan Doron <jond at wizery.com>
---
 server/named_pipe.c | 24 ++++++++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)

diff --git a/server/named_pipe.c b/server/named_pipe.c
index 80363cb..cc3c0ff 100644
--- a/server/named_pipe.c
+++ b/server/named_pipe.c
@@ -205,6 +205,9 @@ static const struct fd_ops pipe_server_fd_ops =
 static void pipe_client_dump( struct object *obj, int verbose );
 static int pipe_client_signaled( struct object *obj, struct wait_queue_entry *entry );
 static struct fd *pipe_client_get_fd( struct object *obj );
+static struct security_descriptor *pipe_client_get_sd( struct object *obj );
+static int pipe_client_set_sd( struct object *obj, const struct security_descriptor *sd,
+                               unsigned int set_info );
 static void pipe_client_destroy( struct object *obj );
 static int pipe_client_flush( struct fd *fd, struct async *async );
 static int pipe_client_ioctl( struct fd *fd, ioctl_code_t code, struct async *async );
@@ -221,8 +224,8 @@ static const struct object_ops pipe_client_ops =
     no_signal,                    /* signal */
     pipe_client_get_fd,           /* get_fd */
     default_fd_map_access,        /* map_access */
-    default_get_sd,               /* get_sd */
-    default_set_sd,               /* set_sd */
+    pipe_client_get_sd,           /* get_sd */
+    pipe_client_set_sd,           /* set_sd */
     no_lookup_name,               /* lookup_name */
     no_link_name,                 /* link_name */
     NULL,                         /* unlink_name */
@@ -349,6 +352,23 @@ static struct fd *pipe_client_get_fd( struct object *obj )
     return NULL;
 }
 
+static struct security_descriptor *pipe_client_get_sd( struct object *obj )
+{
+    struct pipe_client *client = (struct pipe_client *) obj;
+    if (client->server)
+        return default_get_sd((struct object *)client->server);
+    return default_get_sd(obj);
+}
+
+static int pipe_client_set_sd( struct object *obj, const struct security_descriptor *sd,
+                               unsigned int set_info )
+{
+    struct pipe_client *client = (struct pipe_client *) obj;
+    if (client->server)
+        return default_set_sd((struct object *)client->server, sd, set_info);
+    return default_set_sd(obj, sd, set_info);
+}
+
 static void set_server_state( struct pipe_server *server, enum pipe_state state )
 {
     server->state = state;
-- 
2.9.4




More information about the wine-patches mailing list