security: Remove meaningless double check 85/278085/1
authorSeunghun Lee <shiin.lee@samsung.com>
Thu, 2 Jun 2022 04:14:29 +0000 (13:14 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Mon, 18 Jul 2022 05:08:40 +0000 (14:08 +0900)
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: If141f0e9bcc75ee0804cfa65bb136121d4d23fcc

src/libds-tizen/util/security.c

index ad19027..8544951 100644 (file)
@@ -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;