From: Junghyun Yeon Date: Thu, 4 Mar 2021 06:43:16 +0000 (+0900) Subject: Replace implementation of comparing pkg certinfo X-Git-Tag: submit/tizen/20210317.082331~77 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=11b2834f9b0fdb7225ca3ad35287c3acb19e2747;p=platform%2Fcore%2Fappfw%2Fpkgmgr-info.git Replace implementation of comparing pkg certinfo Signed-off-by: Junghyun Yeon --- diff --git a/src/pkgmgrinfo_certinfo.c b/src/pkgmgrinfo_certinfo.c index 44fc7a8..4fa5336 100644 --- a/src/pkgmgrinfo_certinfo.c +++ b/src/pkgmgrinfo_certinfo.c @@ -30,41 +30,14 @@ API int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle) { API int pkgmgrinfo_pkginfo_compare_usr_pkg_cert_info( const char *lhs_package_id, const char *rhs_package_id, uid_t uid, pkgmgrinfo_cert_compare_result_type_e *compare_result) { - // TODO: need to use pkginfo-client APIs - return 0; -#if 0 - sqlite3 *db; - char *dbpath; - if (lhs_package_id == NULL || rhs_package_id == NULL || compare_result == NULL) { _LOGE("invalid parameter"); return PMINFO_R_EINVAL; } - /* open unified global cert db */ - dbpath = getUserPkgCertDBPath(); - if (dbpath == NULL) return PMINFO_R_ERROR; - - ret = __open_db(dbpath, &db, SQLITE_OPEN_READONLY); - if (ret != SQLITE_OK) { - _LOGE("failed to open db: %d", ret); - free(dbpath); - return PMINFO_R_ERROR; - } - free(dbpath); - - if (_pkginfo_compare_certinfo(db, lhs_package_id, rhs_package_id, - compare_result)) { - _LOGE("failed to compare certinfo"); - sqlite3_close_v2(db); - return PMINFO_R_ERROR; - } - - sqlite3_close_v2(db); - - return PMINFO_R_OK; -#endif + return _certinfo_compare_certinfo(lhs_package_id, rhs_package_id, + compare_result); } API int pkgmgrinfo_pkginfo_compare_pkg_cert_info(