From: 최종헌/Common Platform Lab(SR)/삼성전자 Date: Mon, 28 Nov 2022 01:54:39 +0000 (+0900) Subject: Fixed bug checking internet privilege for each app (#447) X-Git-Tag: accepted/tizen/unified/20221205.101746~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d152eafc15a49f31af42aa976e251e823767c069;p=platform%2Fcore%2Fdotnet%2Flauncher.git Fixed bug checking internet privilege for each app (#447) Change-Id: Id7491a7e5156a30583caa48db273ecdedf9f56af --- diff --git a/NativeLauncher/tool/privilege_common.cc b/NativeLauncher/tool/privilege_common.cc index 04314bf..737a971 100644 --- a/NativeLauncher/tool/privilege_common.cc +++ b/NativeLauncher/tool/privilege_common.cc @@ -20,12 +20,12 @@ #include "launcher_env.h" static const char* INTERNET_PRIVILEGE = "http://tizen.org/privilege/internet"; -bool isInternetPrivilegeExisted = false; static int checkInternetPrivilegeCb(const char *privilegeName, void *user_data) { + bool* ret = (bool*)user_data; if (!strcmp(privilegeName, INTERNET_PRIVILEGE)) { - isInternetPrivilegeExisted = true; + *ret = true; return -1; } return 0; @@ -33,13 +33,14 @@ static int checkInternetPrivilegeCb(const char *privilegeName, void *user_data) void checkInternetPrivilegeAndDisableIPv6(const char* pkgId, const std::string& rootPath) { + bool isInternetPrivilegeExisted = false; pkgmgrinfo_pkginfo_h pkg_handle; int ret = pkgmgrGetPkgInfo(pkgId, &pkg_handle); if (ret != 0) { return; } - ret = pkgmgrinfo_pkginfo_foreach_privilege(pkg_handle, checkInternetPrivilegeCb, NULL); + ret = pkgmgrinfo_pkginfo_foreach_privilege(pkg_handle, checkInternetPrivilegeCb, &isInternetPrivilegeExisted); if (ret != PMINFO_R_OK) { _SERR("Failed to pkgmgrinfo_pkginfo_foreach_privilege"); pkgmgrinfo_pkginfo_destroy_pkginfo(pkg_handle);