From 69f061998f939a18243b67ba1b596cf77a7e1acd Mon Sep 17 00:00:00 2001 From: Jiwoong Im Date: Fri, 14 Oct 2016 15:38:13 +0900 Subject: [PATCH] update label of buxton client in prepare exec step - launchpad should request to update buxton client label after change smack label Change-Id: I139d7cfdb0f77d852e16c4f4b5fd6888dd5c3390 Signed-off-by: Jiwoong Im --- CMakeLists.txt | 1 + packaging/launchpad.spec | 1 + src/launchpad_lib.c | 21 +++++++++++++++++++++ 3 files changed, 23 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 561895b..2989bb8 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,6 +28,7 @@ PKG_CHECK_MODULES(${this_target_loader} REQUIRED bundle aul vconf + buxton2 ) FOREACH(flag ${${this_target_loader}_CFLAGS}) diff --git a/packaging/launchpad.spec b/packaging/launchpad.spec index 06b6eb3..7c50db3 100644 --- a/packaging/launchpad.spec +++ b/packaging/launchpad.spec @@ -17,6 +17,7 @@ BuildRequires: pkgconfig(dlog) BuildRequires: pkgconfig(libsystemd-daemon) BuildRequires: pkgconfig(elementary) BuildRequires: pkgconfig(vconf) +BuildRequires: pkgconfig(buxton2) BuildRequires: pkgconfig(security-manager) BuildRequires: pkgconfig(aul) BuildRequires: pkgconfig(ttrace) diff --git a/src/launchpad_lib.c b/src/launchpad_lib.c index 42c8b28..633ec5b 100644 --- a/src/launchpad_lib.c +++ b/src/launchpad_lib.c @@ -29,6 +29,7 @@ #include #include #include +#include #include "launchpad_common.h" #include "launchpad.h" @@ -56,12 +57,20 @@ static void __at_exit_to_release_bundle(void) bundle_free(__bundle); } +static void __buxton_cb(int status, const struct buxton_layer *layer, + const char *key, const struct buxton_value *val, + void *user_data) +{ + _D("buxton_update_client_label result : %d", status); +} + static int __prepare_exec(const char *appid, const char *app_path, const char *pkg_type, int type) { const char *file_name = NULL; char process_name[AUL_PR_NAME] = { 0, }; int ret; + struct buxton_client *bxt_cli; __preexec_run(pkg_type, appid, app_path); @@ -75,6 +84,18 @@ static int __prepare_exec(const char *appid, const char *app_path, return -1; } + ret = buxton_open(&bxt_cli, NULL, NULL); + if (ret != 0) { + _E("buxton_open() failed"); + return -1; + } + ret = buxton_update_client_label(bxt_cli, __buxton_cb, NULL); + if (ret != 0) { + _E("buxton_update_client_label() failed"); + return -1; + } + buxton_close(bxt_cli); + /* * SET DUMPABLE - for coredump * This dumpable flag should be set after -- 2.7.4