Revert "e_policy_wl: remove privilege checking of tws_shared_widget_launch interface" 31/216331/1 accepted/tizen_5.5_unified_mobile_hotfix tizen_5.5_mobile_hotfix accepted/tizen/5.5/unified/20191031.010251 accepted/tizen/5.5/unified/mobile/hotfix/20201027.063438 accepted/tizen/unified/20191023.142633 submit/tizen/20191023.104123 submit/tizen_5.5/20191031.000006 submit/tizen_5.5_mobile_hotfix/20201026.185106 tizen_5.5.m2_release
authorSeunghun Lee <shiin.lee@samsung.com>
Wed, 23 Oct 2019 10:33:23 +0000 (19:33 +0900)
committerSeunghun Lee <shiin.lee@samsung.com>
Wed, 23 Oct 2019 10:34:37 +0000 (19:34 +0900)
This reverts commit 13b763b961af87a04ee5501e1b7ae0232fa7b82b.

Change-Id: Ifa0bab5139f97b179667e150951075d273ba24c3

src/bin/e_policy_wl.c

index 88d695646a34cd1080074b1a615bc1b1f86a4164..7b091ca998e8956964e54d02d4ef6944d5b12114 100644 (file)
@@ -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)
      {