Fix handling access control of component port 45/253045/1
authorHwankyu Jhun <h.jhun@samsung.com>
Thu, 4 Feb 2021 04:30:50 +0000 (13:30 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Thu, 4 Feb 2021 04:35:03 +0000 (13:35 +0900)
Before sending the result, the server should receive the request data.
Even though the result is "permission denied", the result can be "I/O
error" When the client is still sending.

Change-Id: I15897fd821129dc3de1539fe6d6860d754966e46
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
component_based/port/server.cc

index 13078bf1ef12a5b050c4dba96a3703fb501c61c4..c392db91da195e3b4f02991b008e55ff2dbe584b 100644 (file)
@@ -141,6 +141,9 @@ gboolean Server::GIOFunc(GIOChannel* source, GIOCondition cond, gpointer data) {
   int ret = handle->CheckPrivilege(client->GetFd());
   if (ret != 0) {
     _E("Request is denied");
+    std::vector<uint8_t> buf;
+    client->Recv(buf);
+
     std::vector<uint8_t> dummy;
     Response res(ret, dummy);
     tizen_base::Parcel res_parcel;