Fix privilege feature
authorJoohyun Kim <joohyune.kim@samsung.com>
Thu, 1 Aug 2013 23:41:13 +0000 (08:41 +0900)
committerJoohyun Kim <joohyune.kim@samsung.com>
Thu, 1 Aug 2013 23:41:13 +0000 (08:41 +0900)
Change-Id: I2ab0a7b8af302e1f5602f9122dfb2b28e38e11fe
Signed-off-by: Joohyun Kim <joohyune.kim@samsung.com>
src/system/FSys_SettingService.cpp

index 7312d43..3e4581e 100644 (file)
@@ -206,6 +206,9 @@ _SettingService::OnRequestOccured(const ArrayList& request, ArrayList* response)
        {
                int value = 0;
 
+               r = _AccessController::CheckSystemPrivilege(__currentPkgId, _PRV_SETTING);
+               SysTryCatch(NID_SYS, r == E_SUCCESS, r = E_PRIVILEGE_DENIED, r, "The application[%ls] does not have the privilege to call this method.", __currentPkgId.GetPointer());
+
                pKey = (String*)request.GetAt(SETTING_SERVICE_IPC_MSG_KEY);
                SysTryCatch(NID_SYS, pKey != null, r = E_SYSTEM, r, "There is no key information.");
                pValue = (String*)request.GetAt(SETTING_SERVICE_IPC_MSG_VALUE);
@@ -216,6 +219,9 @@ _SettingService::OnRequestOccured(const ArrayList& request, ArrayList* response)
        {
                bool value = false;
 
+               r = _AccessController::CheckSystemPrivilege(__currentPkgId, _PRV_SETTING);
+               SysTryCatch(NID_SYS, r == E_SUCCESS, r = E_PRIVILEGE_DENIED, r, "The application[%ls] does not have the privilege to call this method.", __currentPkgId.GetPointer());
+
                pKey = (String*)request.GetAt(SETTING_SERVICE_IPC_MSG_KEY);
                SysTryCatch(NID_SYS, pKey != null, r = E_SYSTEM, r, "There is no key information.");
                pValue = (String*)request.GetAt(SETTING_SERVICE_IPC_MSG_VALUE);
@@ -224,6 +230,10 @@ _SettingService::OnRequestOccured(const ArrayList& request, ArrayList* response)
        }
        else if(*pCommand == SETTING_SERVICE_COMMAND_SET_STRING)
        {
+
+               r = _AccessController::CheckSystemPrivilege(__currentPkgId, _PRV_SETTING);
+               SysTryCatch(NID_SYS, r == E_SUCCESS, r = E_PRIVILEGE_DENIED, r, "The application[%ls] does not have the privilege to call this method.", __currentPkgId.GetPointer());
+
                pKey = (String*)request.GetAt(SETTING_SERVICE_IPC_MSG_KEY);
                SysTryCatch(NID_SYS, pKey != null, r = E_SYSTEM, r, "There is no key information.");
                pValue = (String*)request.GetAt(SETTING_SERVICE_IPC_MSG_VALUE);
@@ -256,6 +266,9 @@ _SettingService::OnRequestOccured(const ArrayList& request, ArrayList* response)
        {
                bool value = false;
 
+               r = _AccessController::CheckSystemPrivilege(__currentPkgId, _PRV_SETTING);
+               SysTryCatch(NID_SYS, r == E_SUCCESS, r = E_PRIVILEGE_DENIED, r, "The application[%ls] does not have the privilege to call this method.", __currentPkgId.GetPointer());
+
                pKey = (String*)request.GetAt(SETTING_SERVICE_IPC_MSG_KEY);
                SysTryCatch(NID_SYS, pKey != null, r = E_SYSTEM, r, "There is no key information.");
                pValue = (String*)request.GetAt(SETTING_SERVICE_IPC_MSG_VALUE);