summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHwankyu Jhun <h.jhun@samsung.com>2016-12-09 19:24:52 +0900
committerHwankyu Jhun <h.jhun@samsung.com>2016-12-13 17:01:15 +0900
commita461cdd034666f38f0ec45354a042c2f37a0476e (patch)
tree3e8733a3b309a9ccec1579c28dddab559f2bc005
parent43afa09019150cd367b6038b76107ef57c66e45b (diff)
downloadsyspopup-a461cdd034666f38f0ec45354a042c2f37a0476e.tar.gz
syspopup-a461cdd034666f38f0ec45354a042c2f37a0476e.tar.bz2
syspopup-a461cdd034666f38f0ec45354a042c2f37a0476e.zip
- Remove using sd-login API - Use aul_launch_app_async_for_uid instead of aul_launch_app_for_uid - Requires https://review.tizen.org/gerrit/#/c/102397/ https://review.tizen.org/gerrit/#/c/102399/ Change-Id: Icf6805b6502097ca32c371fff3c90b6662e15d9f Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
-rw-r--r--packaging/syspopup.spec1
-rw-r--r--syspopup-caller/CMakeLists.txt2
-rwxr-xr-xsyspopup-caller/syspopup_caller.c64
3 files changed, 15 insertions, 52 deletions
diff --git a/packaging/syspopup.spec b/packaging/syspopup.spec
index 9691792..bb52152 100644
--- a/packaging/syspopup.spec
+++ b/packaging/syspopup.spec
@@ -32,7 +32,6 @@ BuildRequires: pkgconfig(ecore-x)
BuildRequires: pkgconfig(evas)
BuildRequires: pkgconfig(elementary)
BuildRequires: pkgconfig(libtzplatform-config)
-BuildRequires: pkgconfig(libsystemd-daemon)
BuildRequires: pkgconfig(aul)
%define upgrade_script_path /usr/share/upgrade/scripts
diff --git a/syspopup-caller/CMakeLists.txt b/syspopup-caller/CMakeLists.txt
index 3ee1a45..aee2857 100644
--- a/syspopup-caller/CMakeLists.txt
+++ b/syspopup-caller/CMakeLists.txt
@@ -22,7 +22,7 @@ INCLUDE(FindPkgConfig)
SET(pc_requires "bundle")
-pkg_check_modules(spcpkgs REQUIRED dlog bundle sqlite3 glib-2.0 gio-2.0 libtzplatform-config libsystemd-daemon aul)
+pkg_check_modules(spcpkgs REQUIRED dlog bundle sqlite3 glib-2.0 gio-2.0 libtzplatform-config aul)
FOREACH(flag ${spcpkgs_CFLAGS})
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
diff --git a/syspopup-caller/syspopup_caller.c b/syspopup-caller/syspopup_caller.c
index 2d513a3..663172f 100755
--- a/syspopup-caller/syspopup_caller.c
+++ b/syspopup-caller/syspopup_caller.c
@@ -27,7 +27,6 @@
#include <glib.h>
#include <gio/gio.h>
#include <bundle.h>
-#include <systemd/sd-login.h>
#include <aul.h>
#include "syspopup_core.h"
@@ -42,11 +41,6 @@ API int syspopup_launch_for_uid(char *popup_name, bundle *b, uid_t uid)
syspopup_info_t *info;
int ret = -1;
int is_bundle = 0;
- int uid_max;
- int i;
- char *state = NULL;
- uid_t *uids = NULL;
- uid_t cuid = getuid();
if (popup_name == NULL) {
_E("popup_name is NULL");
@@ -63,67 +57,37 @@ API int syspopup_launch_for_uid(char *popup_name, bundle *b, uid_t uid)
if (b == NULL) {
b = bundle_create();
+ if (b == NULL) {
+ _E("out of memory");
+ _syspopup_info_free(info);
+ return -1;
+ }
is_bundle = 1;
}
if (_syspopup_set_name_to_bundle(b, popup_name) < 0) {
_E("bundle set error\n");
_syspopup_info_free(info);
- if (is_bundle == 1)
+ if (is_bundle)
bundle_free(b);
-
return -1;
}
- if (cuid >= REGULAR_UID_MIN) {
- if (cuid != uid) {
- _E("Cannot launch syspopup %s in other users",
- popup_name);
- ret = -1;
- goto end;
- }
-
- ret = aul_launch_app_for_uid(info->pkgname, b, uid);
- if (ret < 0)
- _E("syspopup launch error - %d", ret);
- } else {
- if (uid >= REGULAR_UID_MIN) {
- ret = aul_launch_app_for_uid(info->pkgname, b, uid);
- if (ret < 0)
- _E("syspopup launch error - %d", ret);
- } else {
- uid_max = sd_get_uids(&uids);
- if (uid_max <= 0) {
- _E("Failed to get uid list");
- ret = -1;
- goto end;
- }
-
- for (i = 0; i < uid_max; i++) {
- if (sd_uid_get_state(uids[i], &state) < 0)
- continue;
-
- if (state && (!strcmp(state, "online") ||
- !strcmp(state, "opening"))) {
- ret = aul_launch_app_for_uid(
- info->pkgname,
- b, uids[i]);
- if (ret < 0) {
- _E("syspopup launch error - %d",
- ret);
- }
- }
- }
- }
+ ret = aul_launch_app_async_for_uid(info->pkgname, b, uid);
+ if (ret < 0) {
+ _E("syspopup launch error - %d", ret);
+ _syspopup_info_free(info);
+ if (is_bundle)
+ bundle_free(b);
+ return -1;
}
-end:
if (is_bundle)
bundle_free(b);
_syspopup_info_free(info);
- return ret > 0 ? 0 : -1;
+ return 0;
}
API int syspopup_launch(char *popup_name, bundle *b)