add libprivilege-control dependency
authorYoung Ik Cho <youngik.cho@samsung.com>
Tue, 17 Sep 2013 06:28:08 +0000 (15:28 +0900)
committerYoung Ik Cho <youngik.cho@samsung.com>
Tue, 17 Sep 2013 06:28:56 +0000 (15:28 +0900)
Change-Id: Icc030fca95affca7b51ce50a0c97adcd6ddf2199
Signed-off-by: Young Ik Cho <youngik.cho@samsung.com>
src/CMakeLists.txt
src/app/FApp_AppEntry.cpp

index 2a36044..756f465 100644 (file)
@@ -41,6 +41,7 @@ pkg_check_modules(pkgs REQUIRED
        capi-system-system-settings
        capi-system-info
        security-server
+       libprivilege-control
 )
 
 FOREACH(flag ${pkgs_CFLAGS})
index c23835c..ce76bb0 100644 (file)
@@ -64,35 +64,7 @@ extern void AppInfo_Update(void);
 static void
 AdjustPrivilege(const char* pkgname)
 {
-       void* handle = dlopen("libprivilege-control.so.0", RTLD_LAZY | RTLD_LOCAL);
-       if (!handle)
-       {
-               fprintf(stderr, "Cannot open libprivilege-control.so.0\n");
-               return;
-       }
-
-       char* msg = 0;
-       dlerror();
-
-       int (* ppriv_func)(const char*) = NULL;
-
-       ppriv_func = reinterpret_cast <int (*)(const char*)>(dlsym(handle, "set_privilege"));
-       msg = dlerror();
-       if (msg != NULL)
-       {
-               fprintf(stderr, "Dlsym error: %s\n", msg);
-
-               dlclose(handle);
-               return;
-       }
-
-       int ret = (*ppriv_func)(pkgname);
-       if (ret < 0)
-       {
-               fprintf(stderr, "set_privilege() returned %d\n", ret);
-       }
-
-       dlclose(handle);
+       set_privilege(pkgname);
 }
 
 extern "C" int capset(cap_user_header_t hdrp, const cap_user_data_t datap);