From: Gwangho Hwang Date: Wed, 26 Jun 2013 07:51:43 +0000 (+0900) Subject: use smack functions instead of smackload system cmd X-Git-Tag: 2.2_release~8 X-Git-Url: http://review.tizen.org/git/?p=framework%2Fappfw%2Fdebug-launchpad.git;a=commitdiff_plain;h=7b35d58760089c448c8df6f18b40b3b388035953 use smack functions instead of smackload system cmd Change-Id: If699913a4fbda56d9bcc2b6e921a4de4cfd767c8 Signed-off-by: Gwangho Hwang --- diff --git a/packaging/debug-launchpad.spec b/packaging/debug-launchpad.spec index 3bed74f..5e90ea0 100644 --- a/packaging/debug-launchpad.spec +++ b/packaging/debug-launchpad.spec @@ -1,6 +1,6 @@ Name: debug-launchpad Summary: Debug Launchpad -Version: 0.0.1 +Version: 0.0.2 Release: 1 Group: System/Libraries License: Apache License, Version 2.0 diff --git a/src/launchpad.c b/src/launchpad.c index fdc7627..aaa7c96 100755 --- a/src/launchpad.c +++ b/src/launchpad.c @@ -57,6 +57,7 @@ #include "gl.h" #include +#include #define _static_ static inline #define POLLFD_MAX 1 @@ -78,7 +79,7 @@ #define PATH_GDBSERVER "/home/developer/sdk_tools/gdbserver/gdbserver" #define PATH_DA_SO "/usr/lib/da_probe_osp.so" - +#define PATH_NATIVE_APP "/opt/apps/" static char *launchpad_cmdline; static int initialized = 0; @@ -725,6 +726,62 @@ static app_info_from_db *_get_app_info_from_bundle_by_pkgname( return menu_info; } +/** + * free after use it + */ +int get_native_appid(const char* app_path, char** appid) { + int rc = smack_lgetlabel(app_path, appid, SMACK_LABEL_ACCESS); + + if (rc != 0 || *appid == NULL) { + _E("smack_lgetlabel fail"); + return -1; + } + + if (strlen(*appid)!=APPID_LEN) { + _E("wrong native appid : %s", *appid); + return -1; + } + + if (strlen(app_path)