From: Seunghun Lee Date: Wed, 23 Oct 2019 10:33:23 +0000 (+0900) Subject: Revert "e_policy_wl: remove privilege checking of tws_shared_widget_launch interface" X-Git-Tag: submit/tizen/20191023.104123^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f6f8ef484337b8aabb462763d946491e89188887;p=platform%2Fupstream%2Fenlightenment.git Revert "e_policy_wl: remove privilege checking of tws_shared_widget_launch interface" This reverts commit 13b763b961af87a04ee5501e1b7ae0232fa7b82b. Change-Id: Ifa0bab5139f97b179667e150951075d273ba24c3 --- diff --git a/src/bin/e_policy_wl.c b/src/bin/e_policy_wl.c index 88d695646a..7b091ca998 100644 --- a/src/bin/e_policy_wl.c +++ b/src/bin/e_policy_wl.c @@ -5658,6 +5658,8 @@ _tzsh_iface_cb_shared_widget_launch_get(struct wl_client *client, struct wl_resource *res_tzsh_swl; E_Client *ec; E_Pixmap *cp; + pid_t pid; + uid_t uid; tzsh = wl_resource_get_user_data(res_tzsh); if (!tzsh) @@ -5669,6 +5671,16 @@ _tzsh_iface_cb_shared_widget_launch_get(struct wl_client *client, return; } + wl_client_get_credentials(client, &pid, &uid, NULL); + if (!e_security_privilege_check(pid, uid, E_PRIVILEGE_SOFTKEY)) + { + ERR("Could not get privilege of resource: %m"); + tizen_ws_shell_send_error(tzsh->res_tzsh, TIZEN_WS_SHELL_ERROR_PERMISSION_DENIED); + return; + } + else + tizen_ws_shell_send_error(tzsh->res_tzsh, TIZEN_WS_SHELL_ERROR_NONE); + cp = _e_policy_wl_e_pixmap_get_from_id(client, surf_id); if (!cp) {