* Structures and classes are not (yet) supported.
*/
-#include <string>
-#include <PrivacyGuardTypes.h>
-#include <Utils.h>
+#include "PrivacyGuardTypes.h"
+#include "Utils.h"
class EXTERN_API SocketClient
{
int
PrivacyGuardClient::PgAddMonitorPolicy(const int userId, const std::string pkgId, const std::list < std::string >& list, int monitorPolicy)
{
- LOGD("[STHAN] PgAddMonitorPolicy - START");
-
std::list < std::string > privacyList;
int res = PrivacyIdInfo::getPrivacyIdListFromPrivilegeList(list, privacyList);
- if (res != PRIV_GUARD_ERROR_SUCCESS )
+ if (res != PRIV_GUARD_ERROR_SUCCESS ) {
+ PG_LOGD("PrivacyIdInfo::getPrivacyIdListFromPrivilegeList() is failed. [%d]", res);
return res;
+ }
- if (privacyList.size() == 0)
+ if (privacyList.size() == 0) {
+ PG_LOGD("PrivacyGuardClient::PgAddMonitorPolicy: privacyList.size() is 0.");
return PRIV_GUARD_ERROR_SUCCESS;
-
- int result = PRIV_GUARD_ERROR_SUCCESS;
+ }
res = m_pSocketClient->connect();
TryReturn(res == PRIV_GUARD_ERROR_SUCCESS, res, , "connect : %d", res);
+ int result = PRIV_GUARD_ERROR_SUCCESS;
+
res = m_pSocketClient->call("PgAddMonitorPolicy", userId, pkgId, privacyList, monitorPolicy, &result);
TryReturn(res == PRIV_GUARD_ERROR_SUCCESS, res, m_pSocketClient->disconnect(), "call : %d", res);
%license LICENSE.APLv2
%manifest privacy-guard-client.manifest
%{_libdir}/libprivacy-guard-client.so*
+%{_sysconfdir}/package-manager/parserlib/libprivileges.so
%files -n privacy-guard-client-devel
%defattr(-,root,root,-)
/usr/include/libxml2
/usr/include/package_manager
/usr/include/dlog
+ /usr/include/db-util
"${CMAKE_SOURCE_DIR}/client/inc/"
"${CMAKE_SOURCE_DIR}/common/inc/"
"${CMAKE_SOURCE_DIR}/include/"
## SET LINKER FLAGS
SET(CMAKE_SHARED_LINKER_FLAGS -Wl,--no-undefined)
## SET PRIVACY_POPUP FLAG
-OPTION (PRIVACY_POPUP "PRIVACY_POPUP" ON)
-IF(PRIVACY_POPUP)
- MESSAGE("PRIVACY_POPUP IS ENABLED")
- ADD_DEFINITIONS("-D__PRIVACY_POPUP")
-ENDIF(PRIVACY_POPUP)
+#OPTION (PRIVACY_POPUP "PRIVACY_POPUP" ON)
+#IF(PRIVACY_POPUP)
+# MESSAGE("PRIVACY_POPUP IS ENABLED")
+# ADD_DEFINITIONS("-D__PRIVACY_POPUP")
+#ENDIF(PRIVACY_POPUP)
TARGET_LINK_LIBRARIES(${this_target} ${pkg_LDFLAGS} ${pkg_LIBRARIES})
)
#INSTALL(TARGETS ${this_target} DESTINATION "../etc/package-manager/parserlib")
+#INSTALL(TARGETS ${this_target} DESTINATION "/etc/package-manager/parserlib")
+#INSTALL(TARGETS ${this_target} DESTINATION ${_sysconfdir}/package-manager/parserlib)
+#INSTALL(TARGETS ${this_target} DESTINATION "etc/package-manager/parserlib")
+INSTALL(TARGETS ${this_target} DESTINATION ${SYSCONF_INSTALL_DIR}/package-manager/parserlib/)
#include <string>
#include "privacy_guard_client_internal.h"
#include "PrivacyGuardClient.h"
+#include "Utils.h"
static const xmlChar _NODE_PRIVILEGES[] = "privileges";
static const xmlChar _NODE_PRIVILEGE[] = "privilege";
extern "C"
__attribute__ ((visibility("default")))
int PKGMGR_PARSER_PLUGIN_INSTALL(xmlDocPtr docPtr, const char* packageId)
-{
- LOGD("[STHAN] PKGMGR_PARSER_PLUGIN_INSTALL - START");
+{
+ PG_LOGD("PKGMGR_PARSER_PLUGIN_INSTALL() called.");
int ret = 0;
if (pPrivilege == NULL)
{
- LOGE("Failed to get value");
+ PG_LOGE("Failed to get value");
return -EINVAL;
}
else
while (*ppPrivilegeList[0] != '\0')
{
- LOGD("privacyList : %s", *ppPrivilegeList);
+ PG_LOGD("privacyList : %s", *ppPrivilegeList);
privilege_List.push_back(std::string(*ppPrivilegeList++));
}
ret = pInst->PgAddMonitorPolicy(user_id, std::string(packageId), privilege_List, monitor_policy);
destroy_char_list(ppPrivilegeList, privilegeList.size() + 1);
if (ret != PRIV_GUARD_ERROR_SUCCESS)
{
- LOGD("Failed to install monitor policy: %d", ret);
+ PG_LOGD("Failed to install monitor policy: %d", ret);
return -EINVAL;
}
__attribute__ ((visibility("default")))
int PKGMGR_PARSER_PLUGIN_UNINSTALL(xmlDocPtr docPtr, const char* packageId)
{
- LOGD("[STHAN] PKGMGR_PARSER_PLUGIN_UNINSTALL - START");
+ PG_LOGD("PKGMGR_PARSER_PLUGIN_UNINSTALL() called.");
if (packageId == NULL)
return PRIV_GUARD_ERROR_INVALID_PARAMETER;
int res = pInst->PgDeleteLogsByPackageId(std::string(packageId));
if (res != PRIV_GUARD_ERROR_SUCCESS)
{
- LOGD("Failed to delete logs");
+ PG_LOGD("Failed to delete logs");
return 0;
}
res = pInst->PgDeleteMonitorPolicyByPackageId(std::string(packageId));
if (res != PRIV_GUARD_ERROR_SUCCESS)
{
- LOGD("Failed to delete monitor policy");
+ PG_LOGD("Failed to delete monitor policy");
}
return 0;
__attribute__ ((visibility("default")))
int PKGMGR_PARSER_PLUGIN_UPGRADE(xmlDocPtr docPtr, const char* packageId)
{
- LOGD("[STHAN] PKGMGR_PARSER_PLUGIN_UPGRADE - START");
+ PG_LOGD("PKGMGR_PARSER_PLUGIN_UPGRADE() called.");
int res = 0;
- LOGD("Update privacy Info");
+ PG_LOGD("Update privacy Info");
res = PKGMGR_PARSER_PLUGIN_UNINSTALL(docPtr, packageId);
if (res != 0)
{
- LOGD("Privacy info can be already uninstalled");
+ PG_LOGD("Privacy info can be already uninstalled");
}
res = PKGMGR_PARSER_PLUGIN_INSTALL(docPtr, packageId);
if (res != 0)
{
- LOGD("Failed to install privacy Info: %d", res);
+ PG_LOGD("Failed to install privacy Info: %d", res);
}
return res;
}
SQL=".read ${TZ_SYS_BIN}/"$name"_db.sql"
sqlite3 ${TZ_SYS_DB}/.$name.db "$SQL"
touch ${TZ_SYS_DB}/.$name.db-journal
- chown root:root ${TZ_SYS_DB}/.$name.db
- chown root:root ${TZ_SYS_DB}/.$name.db-journal
+ chown system:system ${TZ_SYS_DB}/.$name.db
+ chown system:system ${TZ_SYS_DB}/.$name.db-journal
chmod 666 ${TZ_SYS_DB}/.$name.db
chmod 666 ${TZ_SYS_DB}/.$name.db-journal
done
int
PrivacyGuardDb::PgAddMonitorPolicy(const int userId, const std::string packageId, const std::list < std::string > privacyList, bool monitorPolicy)
{
- LOGD("[STHAN] PgAddMonitorPolicy - START");
+ PG_LOGD("PrivacyGuardDb::PgAddMonitorPolicy");
int res = -1;
void
PrivacyInfoService::PgAddMonitorPolicy(SocketConnection* pConnector)
{
- LOGD("[STHAN] PgAddMonitorPolicy - START");
-
int userId = 0;
std::string pkgId;
std::list < std::string > list;