sensord: fix a bug which did not check privilege 97/124597/1
authorkibak.yoon <kibak.yoon@samsung.com>
Wed, 12 Apr 2017 01:52:13 +0000 (10:52 +0900)
committerkibak.yoon <kibak.yoon@samsung.com>
Wed, 12 Apr 2017 01:52:13 +0000 (10:52 +0900)
- missing cynara check

Change-Id: I3bb6de4babadfd17f45b0b99f2b957942c05cb95
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
src/server/permission_checker.cpp

index 644ce61..e275c30 100644 (file)
@@ -89,6 +89,7 @@ bool permission_checker::has_permission_cynara(int sock_fd, std::string &perm)
 {
        retvm_if(cynara_env == NULL, false, "Cynara not initialized");
 
+       int ret;
        int pid = -1;
        char *client = NULL;
        char *session = NULL;
@@ -109,7 +110,13 @@ bool permission_checker::has_permission_cynara(int sock_fd, std::string &perm)
                return false;
        }
 
-       return true;
+       ret = cynara_check(cynara_env, client, session, user, perm.c_str());
+
+       free(client);
+       free(session);
+       free(user);
+
+       return (ret == CYNARA_API_ACCESS_ALLOWED);
 }
 
 bool permission_checker::has_permission(int sock_fd, std::string &perm)