From: Seunghun Lee Date: Thu, 2 Jun 2022 04:14:29 +0000 (+0900) Subject: security: Remove meaningless double check X-Git-Tag: submit/tizen/20220720.024540~48 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=73292cd943a431496e4b05f618d7e8529c089ae5;p=platform%2Fcore%2Fuifw%2Flibds-tizen.git security: Remove meaningless double check In the function tizen_security_check_privilege(), it double-checks a g_cynara to see if it exists and then return different value if it doesn't exist which is contradictory. Let's just return false if initializing the cynara has been failed or not been initialized. Change-Id: I24755e5b86c5e1f4bf5cf6333a4d4686a880e942 --- diff --git a/src/libds-tizen/util/security.c b/src/libds-tizen/util/security.c index ad19027..8544951 100644 --- a/src/libds-tizen/util/security.c +++ b/src/libds-tizen/util/security.c @@ -55,11 +55,6 @@ tizen_security_check_privilege(pid_t pid, uid_t uid, const char *privilege) int len = -1; int ret = -1; - /* If cynara_initialize() has been (retried) and failed, we suppose that cynara is not available. */ - /* Then we return true as if there is no security check available. */ - if (!g_cynara) - return true; - if (!g_cynara) { ds_err("security has not been initialized.\n"); return false;