Remove unused dependency and deprecated APIs 88/45988/3
authorYunjin Lee <yunjin-.lee@samsung.com>
Thu, 13 Aug 2015 03:11:56 +0000 (12:11 +0900)
committerYunjin Lee <yunjin-.lee@samsung.com>
Thu, 13 Aug 2015 05:07:16 +0000 (14:07 +0900)
Change-Id: Ib950fc07dcff4463f97d739eb6ac00c3a2d18269
Signed-off-by: Yunjin Lee <yunjin-.lee@samsung.com>
capi/CMakeLists.txt
capi/include/privilege_checker.h [deleted file]
capi/include/privilege_db_manager.h
capi/include/privilege_info.h
capi/include/privilege_info_types.h
capi/include/privilege_manager.h
capi/src/privilege_checker.c [deleted file]
capi/src/privilege_manager.c
packaging/privilege-checker.manifest
packaging/privilege-checker.spec

index 8478a81..1265af8 100644 (file)
@@ -12,10 +12,10 @@ INCLUDE_DIRECTORIES(
     "${INC_DIR}"
     )
 
-SET(pc_requires "capi-base-common")
+SET(pc_requires "")
 
 INCLUDE(FindPkgConfig)
-pkg_check_modules(${fw_name} REQUIRED capi-base-common dlog pkgmgr-info capi-appfw-package-manager glib-2.0)
+pkg_check_modules(${fw_name} REQUIRED dlog pkgmgr-info glib-2.0)
 FOREACH(flag ${${fw_name}_CFLAGS})
     SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
 ENDFOREACH(flag)
@@ -30,14 +30,12 @@ ENDIF("${ARCH}" STREQUAL "arm")
 ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
 ADD_DEFINITIONS("-DSLP_DEBUG")
 MESSAGE("PROFILE_TYPE = ${PROFILE_TYPE}")
-IF("${PROFILE_TYPE}" STREQUAL "TV")
-    ADD_DEFINITIONS("-DPROFILE_TYPE_TV")
-ELSEIF("${PROFILE_TYPE}" STREQUAL "WEARABLE")
+IF("${PROFILE_TYPE}" STREQUAL "WEARABLE")
     ADD_DEFINITIONS("-DPROFILE_TYPE_WEARABLE")
 ELSEIF("${PROFILE_TYPE}" STREQUAL "MOBILE")
     ADD_DEFINITIONS("-DPROFILE_TYPE_MOBILE")
-ELSE()
-    ADD_DEFINITIONS("-DPROFILE_TYPE_COMMON")
+ELSEIF("${PROFILE_TYPE}" STREQUAL "TV")
+    ADD_DEFINITIONS("-DPROFILE_TYPE_TV")
 ENDIF()
 
 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${LIBDIR}")
diff --git a/capi/include/privilege_checker.h b/capi/include/privilege_checker.h
deleted file mode 100755 (executable)
index 2bf3084..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __TIZEN_SECURITY_PRIVILEGE_CHECKER_H
-#define __TIZEN_SECURITY_PRIVILEGE_CHECKER_H
-
-#include <tizen.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @brief Enumerations of error code for Privilege Information.
- */
-typedef enum
-{
-    PRIV_CHECKER_ERR_NONE               = TIZEN_ERROR_NONE,
-    PRIV_CHECKER_ERR_INVALID_PARAMETER  = TIZEN_ERROR_INVALID_PARAMETER,
-    PRIV_CHECKER_ERR_OUT_OF_MEMORY      = TIZEN_ERROR_OUT_OF_MEMORY,
-    PRIV_CHECKER_ERR_INTERNAL_ERROR     = TIZEN_ERROR_UNKNOWN,
-    PRIV_CHECKER_ERR_NO_DATA            = TIZEN_ERROR_NO_DATA,
-    PRIV_CHECKER_ERR_INVALID_PRIVILEGE  = TIZEN_ERROR_PERMISSION_DENIED,
-} privilege_checker_error_e;
-
-EXPORT_API int privilege_checker_check_package_privilege(const char* package_id, const char *privilege);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // __TIZEN_SECURITY_PRIVILEGE_INFO_H
index be87159..d60ad1d 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2013-2015 Samsung Electronics Co., Ltd All Rights Reserved
  *
  * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
@@ -17,7 +17,6 @@
 #ifndef __PRIVILEGE_DB_MANAGER_H
 #define __PRIVILEGE_DB_MANAGER_H
 
-#include <tizen.h>
 #include <glib.h>
 
 typedef struct
@@ -38,11 +37,11 @@ typedef struct
 
 typedef enum
 {
-    PRIVILEGE_DB_MANAGER_ERR_NONE                  = TIZEN_ERROR_NONE,
-    PRIVILEGE_DB_NO_EXIST_RESULT                   = TIZEN_ERROR_NO_DATA,
-    PRIVILEGE_DB_MANAGER_ERR_CONNECTION_FAIL       = TIZEN_ERROR_UNKNOWN,
-    PRIVILEGE_DB_MANAGER_ERR_INVALID_QUERY         = TIZEN_ERROR_INVALID_PARAMETER,
-    PRIVILEGE_DB_MANAGER_ERR_OUT_OF_MEMORY         = TIZEN_ERROR_OUT_OF_MEMORY,
+    PRIVILEGE_DB_MANAGER_ERR_NONE                  = 0,
+    PRIVILEGE_DB_NO_EXIST_RESULT                   = 1,
+    PRIVILEGE_DB_MANAGER_ERR_CONNECTION_FAIL       = 2,
+    PRIVILEGE_DB_MANAGER_ERR_INVALID_QUERY         = 3,
+    PRIVILEGE_DB_MANAGER_ERR_OUT_OF_MEMORY         = 4,
 } privilege_db_manager_error_e;
 
 typedef enum
index 2feb9bf..55b245e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2013-2015 Samsung Electronics Co., Ltd All Rights Reserved
  *
  * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
@@ -17,7 +17,9 @@
 #ifndef __TIZEN_SECURITY_PRIVILEGE_INFO_H
 #define __TIZEN_SECURITY_PRIVILEGE_INFO_H
 
-#include <tizen.h>
+#ifndef EXPORT_API
+#define EXPORT_API __attribute__((__visibility__("default")))
+#endif
 #ifdef __cplusplus
 extern "C" {
 #endif
index 7fb2a6a..d9cddd1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2013-2015 Samsung Electronics Co., Ltd All Rights Reserved
  *
  * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
@@ -17,8 +17,6 @@
 #ifndef __TIZEN_SECURITY_PRIVILEGE_INFO_TYPES_H
 #define __TIZEN_SECURITY_PRIVIELGE_INFO_TYPES_H
 
-#include <tizen.h>
-
 #ifdef __cplusplus
 extern "C" {
 #endif
index 4bcb9c0..5c10f8c 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2013-2015 Samsung Electronics Co., Ltd All Rights Reserved
  *
  * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
 #ifndef __TIZEN_SECURITY_PRIVILEGE_MANAGER_H
 #define __TIZEN_SECURITY_PRIVILEGE_MANAGER_H
 
-#include <tizen.h>
+#ifndef EXPORT_API
+#define EXPORT_API __attribute__((__visibility__("default")))
+#endif
+
 #include <glib.h>
 #include "privilege_info.h"
 
@@ -41,23 +44,21 @@ typedef enum
 
 
 /**
- * @brief verify privilege name and level in the privilege list.
+ * @brief verify privilege in the privilege list by checking its name and level at given api version.
  * @remarks @a privilege_list must be released with free() by you.
- * @remarks @a error_privilege_name must be released with free() by you.
+ * @remarks @a error_message must be released with free() by you.
+ * @param [in] api_version The api version of the application
  * @param [in] privilege_manager_package_type_e The privilege_manager_package_type_e
  * @param [in] privilege_list The privilege_list
  * @param [in] privilege_manager_visibility_e The privilege_manager_visibility_e
- * @param [out] error_privilege_name The error_privilege_name's value is assigned when PRVMGR_ERR_MISMACHED_PRIVILEGE_LEVEL and PRVMGR_ERR_NO_EXIST_PRIVILEGE are returned, otherwise null is assigned.
+ * @param [out] error_message The error_message's value is assigned when the return value isn't PRVMGR_ERR_NONE, otherwise null is assigned.
  * @return 0 on success, otherwise a negative error value.
  * @retval #PRVMGR_ERR_NONE Successful
- * @retval #PRVMGR_ERR_MISMACHED_PRIVILEGE_LEVEL privilege level is higher than visibility. Error_privilege_name'value is assigned.
- * @retval #PRVMGR_ERR_NO_EXIST_PRIVILEGE privilege don't exist. Error_privilege_name'value is assigned.
  * @retval #PRVMGR_ERR_OUT_OF_MEMORY Out of memory
+ * @retvak #PRVMGR_ERR_INVALID_PRIVILEGE The privilege_list contains invalid privilege(s).
  * @retval #PRVMGR_ERR_INVALID_PARAMETER Invalid parameter
  * @retval #PRVMGR_ERR_INTERNAL_ERROR Internal error
  */
-EXPORT_API int privilege_manager_verify_privilege_list(privilege_manager_package_type_e package_type, GList* privilege_list, privilege_manager_visibility_e visibility, char **error_privilege_name);
-
 EXPORT_API int privilege_manager_verify_privilege(const char* api_version, privilege_manager_package_type_e package_type, GList* privilege_list, privilege_manager_visibility_e visibility, char **error_message);
 
 #ifdef __cplusplus
diff --git a/capi/src/privilege_checker.c b/capi/src/privilege_checker.c
deleted file mode 100755 (executable)
index fc875f8..0000000
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
- * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <unistd.h>
-#include <stdlib.h>
-#include <dlog.h>
-#include <privilege_checker.h>
-#include <pkgmgr-info.h>
-#include <package_manager.h>
-
-#define COLOR_RED           "\033[0;40;31m"
-#define COLOR_LIGHTBLUE     "\033[1;40;34m"
-#define COLOR_YELLOW        "\033[1;40;33m"
-#define COLOR_END           "\033[0;m"
-#define COLOR_GRAY          "\033[1;40;30m"
-#define COLOR_MAGENTA       "\033[1;35m"
-
-#define LOG_PREFIX
-#define FUNC_BEGIN() \
-    do {\
-        LOGD(COLOR_LIGHTBLUE""LOG_PREFIX" BEGIN >>>>"COLOR_END);\
-    } while (0);
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#define LOG_TAG "PRIVILEGE_CHECKER"
-#endif
-
-#define TryReturn(condition, returnValue, ...)  \
-    if (!(condition)) { \
-        LOGE(__VA_ARGS__); \
-        return returnValue; \
-    } \
-    else {;}
-
-#define CACHED_PRIVILEGE_MAX    256
-#define SUB_HASH(str, len, value) ( (str[len-1] << 24) | (str[len-2] << 16) | value )
-
-typedef struct _cached_privilege_s{
-    char* privilege_name;
-    int hash_value;
-} cached_privilege_s;
-
-static cached_privilege_s g_cached_privileges[CACHED_PRIVILEGE_MAX];
-static int g_cached_privileges_size = 0;
-static int g_isMached = false;
-
-int __privilege_checker_hash(const char* privilege_name)
-{
-    TryReturn(privilege_name != NULL, -1, "[PRIV_CHECKER_ERR_INVALID_PARAMETER] privilege_name is NULL!");
-    int len = strlen(privilege_name);
-    TryReturn(len >= 2, -1, "[PRIV_CHECKER_ERR_INVALID_PARAMETER] privilege_name's size must be more than 2!");
-    int hash_value = 0;
-    int i=0;
-
-    for(i=0; i<len; i++)
-    {
-        hash_value += privilege_name[i];
-    }
-
-    hash_value = SUB_HASH(privilege_name, len, hash_value);
-
-    return hash_value;
-}
-
-void __privilege_checker_print_cache_table()
-{
-    int i=0;
-    for(i=0; i<g_cached_privileges_size; i++){
-        LOGD("privilege : %s, hash_value : %d", g_cached_privileges[i].privilege_name, g_cached_privileges[i].hash_value);
-    }
-}
-
-int __privilege_checker_privilege_list_by_pkgid_cb(const char* package_manager_privilege, void* user_data)
-{
-    LOGD("Enter privile_name : %s", package_manager_privilege);
-    TryReturn(package_manager_privilege != NULL, PRIV_CHECKER_ERR_INVALID_PARAMETER, "[PRIV_CHECKER_ERR_INVALID_PARAMETER] Callback privilege_id is NULL!");
-    TryReturn(user_data != NULL, PRIV_CHECKER_ERR_INVALID_PARAMETER, "[PRIV_CHECKER_ERR_INVALID_PARAMETER] priv_info is NULL!");
-
-    char *privilege_name = (char*)user_data;
-    int len = strlen(package_manager_privilege);
-
-    if(g_isMached == false && strncmp(package_manager_privilege, privilege_name, len) == 0)
-    {
-        LOGD("Found matched privilege");
-        g_isMached = true;
-    }
-
-    LOGD("Add privilege and hash value to cache table");
-    g_cached_privileges[g_cached_privileges_size].privilege_name = strdup(package_manager_privilege);
-    TryReturn(g_cached_privileges[g_cached_privileges_size].privilege_name != NULL, PRIV_CHECKER_ERR_OUT_OF_MEMORY, "[PRIV_CHECKER_ERR_OUT_OF_MEMORY] privilege_name's strdup is failed.");
-    g_cached_privileges[g_cached_privileges_size].hash_value = __privilege_checker_hash(package_manager_privilege);
-    ++g_cached_privileges_size;
-
-    return 0;
-}
-
-int privilege_checker_check_package_privilege(const char* package_id, const char* privilege_name)
-{
-    FUNC_BEGIN();
-
-    TryReturn(privilege_name != NULL, PRIV_CHECKER_ERR_INVALID_PARAMETER, "[PRIV_CHECKER_ERR_INVALID_PARAMETER] privilege_id is NULL");
-    TryReturn(package_id != NULL, PRIV_CHECKER_ERR_INVALID_PARAMETER, "[PRIV_CHECKER_ERR_INVALID_PARAMETER] package_id is NULL");
-
-    LOGD("package_id = %s", package_id);
-    LOGD("privilege_name = %s", privilege_name);
-
-    int len = strlen(privilege_name);
-    int hash_value = __privilege_checker_hash(privilege_name);
-    int matched_index = 0;
-    int matched_cnt = 0;
-    int i = 0;
-    char* user_data = NULL;
-
-    //find privilege in cache
-    for(i=0; i<g_cached_privileges_size; i++)
-    {
-        if(hash_value == g_cached_privileges[i].hash_value)
-        {
-            matched_index = i;
-            ++matched_cnt;
-        }
-    }
-
-    if(matched_cnt == 1){
-        LOGD("Found cached hash privilege");
-        return PRIV_CHECKER_ERR_NONE;
-
-    }else if(matched_cnt > 1){
-        LOGD("There are %d matched hash value", matched_cnt);
-        LOGD("Check privilege string");
-
-        LOGD("Privilege Name : %s", privilege_name);
-        LOGD("Cached Privilege Name : %s", g_cached_privileges[matched_index].privilege_name);
-
-        //check string privilege with last hash-matched one.
-        if(strncmp(privilege_name, g_cached_privileges[matched_index].privilege_name, len) == 0)
-        {
-            LOGD("Found cached string privilege");
-            return PRIV_CHECKER_ERR_NONE;
-        }
-
-        //check string privilege with rest of them.
-        for(i=0; i<matched_index; i++)
-        {
-            if(strncmp(privilege_name, g_cached_privileges[g_cached_privileges_size].privilege_name, len) == 0)
-            {
-                LOGD("Found cached string privilege");
-                return PRIV_CHECKER_ERR_NONE;
-            }
-        }
-    }
-    LOGD("Not Found cached privilege");
-
-    //if there is no cached privilege, cache table size must be 0.
-    TryReturn(g_cached_privileges_size == 0, PRIV_CHECKER_ERR_INVALID_PRIVILEGE, "[PRIV_CHECKER_ERR_INVALID_PRIVILEGE] %s privilege denied", privilege_name);
-
-    LOGD("Check privilege from PackageManager");
-    g_isMached = false;
-    pkgmgrinfo_pkginfo_h handle;
-    int res = pkgmgrinfo_pkginfo_get_pkginfo(package_id, &handle);
-    TryReturn(res == PMINFO_R_OK, PRIV_CHECKER_ERR_INTERNAL_ERROR, "[PRIV_CHECKER_ERR_INTERNAL_ERROR] pkgmgrinfo_pkginfo_get_pkginfo is failed.");
-
-    user_data = strdup(privilege_name);
-    if(res != PMINFO_R_OK)
-    {
-        free(user_data);
-        LOGE("[PRIV_CHECKER_ERR_OUT_OF_MEMORY] user_data's strdup is failed.");
-        return PRIV_CHECKER_ERR_OUT_OF_MEMORY;
-    }
-    res = pkgmgrinfo_pkginfo_foreach_privilege(handle, __privilege_checker_privilege_list_by_pkgid_cb, user_data);
-    pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
-    if(user_data != NULL)
-        free(user_data);
-
-    TryReturn(res == PMINFO_R_OK, PRIV_CHECKER_ERR_INTERNAL_ERROR, "[PRIV_CHECKER_ERR_INTERNAL_ERROR] pkgmgrinfo_pkginfo_foreach_privilege is failed.");
-
-    LOGD("Print cache table");
-    __privilege_checker_print_cache_table();
-
-    TryReturn(g_isMached == true, PRIV_CHECKER_ERR_INVALID_PRIVILEGE, "[PRIV_CHECKER_ERR_INVALID_PRIVILEGE] %s privilege denied", privilege_name);
-
-    return PRIV_CHECKER_ERR_NONE;
-}
-
index fb965fb..c68d7ba 100755 (executable)
         return returnValue; \
     } \
     else {;}
-/*
-#ifdef CURRENT_TIZEN_VERSION
-    static char* privilege_manager_current_tizen_version = (char*)CURRENT_TIZEN_VERSION;
-#else
-    static char* privilege_manager_current_tizen_version = "2.4"
-#endif
-*/
-
-
-static void __free_privilege_list(GList* privilege_list)
-{
-    GList* l = NULL;
-    for (l = privilege_list; l != NULL; l = l->next)
-    {
-        privilege_info_db_row_s* privilege_info_db_row = (privilege_info_db_row_s*)l->data;
-        if(privilege_info_db_row->privilege_name != NULL)
-            free(privilege_info_db_row->privilege_name);
-    }
-}
-
 
 static int __privilege_manager_check_privilege_list(const char* api_version, const char* privilege, GList* vaild_privilege_list, int* privilege_level, char** changed_to, char** valid_api_version)
 {
@@ -325,97 +305,3 @@ FINISH:
 }
 
 
-static int __privilege_manager_core_privilege_level(const char* privilege, int* privilege_level)
-{
-    TryReturn(privilege != NULL, PRVMGR_ERR_INVALID_PARAMETER, "[PRVMGR_ERR_INVALID_PARAMETER] privilege is NULL");
-
-    int ret;
-    GList* privilege_list;
-    ret = privilege_db_manager_get_privilege_list("2.4",PRIVILEGE_DB_MANAGER_PACKAGE_TYPE_CORE, &privilege_list);
-    if(ret != PRIVILEGE_DB_MANAGER_ERR_NONE){
-        LOGE("[FAIL TO CALL FUNCTION] privilege_db_manager_get_privilege_list()");
-        return PRVMGR_ERR_INTERNAL_ERROR;
-    }
-
-    GList* l = NULL;
-    for (l = privilege_list; l != NULL; l = l->next)
-    {
-        privilege_info_db_row_s* privilege_info_db_row = (privilege_info_db_row_s*)l->data;
-        if (strcmp(privilege_info_db_row->privilege_name, privilege) == 0)
-        {
-            *privilege_level = privilege_info_db_row->privilege_level_id;
-            __free_privilege_list(privilege_list);
-            return PRVMGR_ERR_NONE;
-        }
-    }
-    __free_privilege_list(privilege_list);
-
-    return  PRVMGR_ERR_NO_EXIST_PRIVILEGE;
-}
-
-int privilege_manager_verify_privilege_list(privilege_manager_package_type_e package_type, GList* privilege_list, privilege_manager_visibility_e visibility, char** error_privilege_name)
-{
-    LOGD("privilege_info_compare_privilege_level called");
-    GList *l;
-    int ret;
-    int i = 0;
-    *error_privilege_name = NULL;
-
-    TryReturn(privilege_list != NULL, PRVMGR_ERR_INVALID_PARAMETER, "[PRVMGR_ERR_INVALID_PARAMETER] privilege_list is NULL");
-
-    for (l = privilege_list; l != NULL; l = l->next)
-    {
-        int privilege_level_id;
-        char* privilege_name = (char*)l->data;
-
-        TryReturn(privilege_name != NULL, PRVMGR_ERR_INVALID_PARAMETER, "[PRVMGR_ERR_INVALID_PARAMETER] privilege_list[%d] is NULL", i);
-        i++;
-
-        LOGD("Checking privilege : %s", privilege_name);
-
-        ret = __privilege_manager_core_privilege_level(privilege_name, &privilege_level_id);
-        if(ret == PRVMGR_ERR_NO_EXIST_PRIVILEGE)
-        {
-            LOGE("[PRVMGR_ERR_NO_EXIST_PRIVILEGE] There are no privilege %s in DB", privilege_name);
-            *error_privilege_name = (char*)calloc(strlen(privilege_name) + 1, sizeof(char));
-            TryReturn(*error_privilege_name != NULL, PRVMGR_ERR_OUT_OF_MEMORY, "[PRVMGR_ERR_OUT_OF_MEMORY] Memory allocation failed.");
-            memcpy(*error_privilege_name, privilege_name, strlen(privilege_name));
-
-            return  PRVMGR_ERR_NO_EXIST_PRIVILEGE;
-        }
-        else if(ret == PRVMGR_ERR_NONE)
-        {
-            if(visibility == PRVMGR_PACKAGE_VISIBILITY_PARTNER){
-                if(privilege_level_id == PRIVILEGE_DB_MANAGER_PRIVILEGE_LEVEL_PLATFORM)
-                {
-                    LOGE("[PRVMGR_ERR_MISMACHED_PRIVILEGE_LEVEL] Visibility and Privilege level are mismatched");
-                    LOGE("[PRVMGR_ERR_MISMACHED_PRIVILEGE_LEVEL] Visibility : partner, Privilege Level : %d", privilege_level_id);
-                    *error_privilege_name = (char*)calloc(strlen(privilege_name) + 1, sizeof(char));
-                    TryReturn(*error_privilege_name != NULL, PRVMGR_ERR_OUT_OF_MEMORY, "[PRVMGR_ERR_OUT_OF_MEMORY] Memory allocation failed.");
-                    memcpy(*error_privilege_name, privilege_name, strlen(privilege_name));
-
-                    return PRVMGR_ERR_MISMACHED_PRIVILEGE_LEVEL;
-                }
-            }
-            else if(visibility == PRVMGR_PACKAGE_VISIBILITY_PUBLIC){
-                if(privilege_level_id == PRIVILEGE_DB_MANAGER_PRIVILEGE_LEVEL_PARTNER || privilege_level_id == PRIVILEGE_DB_MANAGER_PRIVILEGE_LEVEL_PLATFORM)
-                {
-                    LOGE("[PRVMGR_ERR_MISMACHED_PRIVILEGE_LEVEL] Visibility and Privilege level are mismatched");
-                    LOGE("[PRVMGR_ERR_MISMACHED_PRIVILEGE_LEVEL] Visibility : public, Privilege Level : %d", privilege_level_id);
-                    *error_privilege_name = (char*)calloc(strlen(privilege_name) + 1, sizeof(char));
-                    TryReturn(*error_privilege_name != NULL, PRVMGR_ERR_OUT_OF_MEMORY, "[PRVMGR_ERR_OUT_OF_MEMORY] Memory allocation failed.");
-                    memcpy(*error_privilege_name, privilege_name, strlen(privilege_name));
-
-                    return PRVMGR_ERR_MISMACHED_PRIVILEGE_LEVEL;
-                }
-            }
-        }
-        else
-        {
-            return ret;
-        }
-    }
-
-    return PRVMGR_ERR_NONE;
-}
-
index 9647171..c00c25b 100644 (file)
@@ -1,7 +1,4 @@
 <manifest>
-        <define>
-                <domain name="privilege-checker" />
-        </define>
         <request>
                 <domain name="_" />
         </request>
index a8ad6d2..87dd6af 100644 (file)
@@ -8,7 +8,6 @@ Source0: %{name}-%{version}.tar.gz
 BuildRequires: cmake
 BuildRequires: pkgconfig(dlog)
 BuildRequires: pkgconfig(sqlite3)
-BuildRequires: pkgconfig(capi-base-common)
 BuildRequires:  pkgconfig(glib-2.0)
 
 %description
@@ -28,14 +27,12 @@ Group:      TO_BE/FILLED_IN
 License:    TO BE FILLED IN
 BuildRequires:  cmake
 BuildRequires:  pkgconfig(dlog)
-BuildRequires:  pkgconfig(capi-base-common)
 BuildRequires:  gettext-tools
 BuildRequires:  pkgconfig(pkgmgr-info)
-BuildRequires:  pkgconfig(capi-appfw-package-manager)
 BuildRequires:  pkgconfig(glib-2.0)
 
 %description -n capi-security-privilege-manager
-The Privilege Manager API provides functions to get information about privilege information of installed packages.
+The Privilege Manager API provides functions to verify privilege information of packages to be installed.
 
 %package  -n capi-security-privilege-manager-devel
 Summary:  Privilege Manager API (Development)
@@ -43,7 +40,7 @@ Group:    TO_BE/FILLED_IN
 Requires: capi-security-privilege-manager
 
 %description -n capi-security-privilege-manager-devel
-The Privilege Manager API provides functions to get information about privilege information of installed packages.(DEV)
+The Privilege Manager API provides functions to verify privilege information of packages to be installed.(DEV)
 
 #%package  -n tc-privilege-checker
 #Summary:  tc-privilege-checker
@@ -63,8 +60,6 @@ The Privilege Manager API provides functions to get information about privilege
     __PROFILE_TYPE="WEARABLE"
 %else if "%{?profile}" == "mobile"
     __PROFILE_TYPE="MOBILE"
-%else
-    __PROFILE_TYPE="COMMON"
 %endif
 
 export CFLAGS="$CFLAGS -DTIZEN_ENGINEER_MODE"
@@ -123,7 +118,6 @@ sqlite3 /%{buildroot}%{_datadir}/privilege-manager/.wrt_privilege_info.db "selec
 #%files -n tc-privilege-checker
 #%{_bindir}/tc-privilege-db-manager
 #%{_bindir}/tc-privilege-manager
-#%{_bindir}/tc-privilege-checker
 #%{_bindir}/tc-privilege-hash
 #%{_bindir}/tc-privilege-info