[PATCH] ivi-controller: Send process ID that created surface to client

Ucan, Emre (ADITG/SW1) eucan at de.adit-jv.com
Fri Mar 11 02:27:58 EST 2016


Hello Natsume-san,

It looks good.

Best regards

Emre Ucan
Software Group I (ADITG/SW1)

Tel. +49 5121 49 6937

> -----Original Message-----
> From: genivi-ivi-layer-management-bounces at lists.genivi.org [mailto:genivi-
> ivi-layer-management-bounces at lists.genivi.org] On Behalf Of Natsume,
> Wataru (ADITJ/SWG)
> Sent: Freitag, 11. März 2016 01:57
> To: genivi-ivi-layer-management at lists.genivi.org
> Cc: securitycheck at denso.co.jp
> Subject: [PATCH] ivi-controller: Send process ID that created surface to client
> 
> createPid should be a pid of process that creates surface.
> 
> Signed-off-by: Wataru Natsume <wnatsume at jp.adit-jv.com>
> ---
>  weston-ivi-shell/src/ivi-controller-impl.c | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/weston-ivi-shell/src/ivi-controller-impl.c b/weston-ivi-shell/src/ivi-
> controller-impl.c
> index 235aacd..7fe0f2d 100644
> --- a/weston-ivi-shell/src/ivi-controller-impl.c
> +++ b/weston-ivi-shell/src/ivi-controller-impl.c
> @@ -614,10 +614,18 @@ controller_surface_send_stats(struct wl_client
> *client,
>                                struct wl_resource *resource)  {
>      struct ivisurface *ivisurf = wl_resource_get_user_data(resource);
> +    struct weston_surface *surface;
> +    struct wl_client* target_client;
>      pid_t pid;
>      uid_t uid;
>      gid_t gid;
> -    wl_client_get_credentials(client, &pid, &uid, &gid);
> +
> +    /* Get pid that creates surface */
> +    surface = ivi_extension_surface_get_weston_surface(ivisurf->shell,
> +                                                       ivisurf->layout_surface);
> +    target_client = wl_resource_get_client(surface->resource);
> +
> +    wl_client_get_credentials(target_client, &pid, &uid, &gid);
> 
>      ivi_controller_surface_send_stats(resource, 0, 0,
>                                        ivisurf->update_count, pid, "");
> --
> 1.9.1




More information about the genivi-ivi-layer-management mailing list