Compare process IDs
authorHwankyu Jhun <h.jhun@samsung.com>
Sun, 5 Jan 2025 22:39:13 +0000 (07:39 +0900)
committerChanggyu Choi <changyu.choi@samsung.com>
Mon, 6 Jan 2025 00:50:27 +0000 (09:50 +0900)
The launchpad should check whether the caller is the executed process or
not. If it's not, we should reject the connection request.

Change-Id: I5d87310a3986bccedba2fe0c98383056d7ed5804
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/launchpad-process-pool/loader_context.cc

index d94f17cfe6709c1bcadbe327308a9ab45cb1e951..51ab043ffe50e6f9697ac459594a39db3afa92b6 100644 (file)
@@ -572,9 +572,9 @@ void LoaderContext::HandleLoaderEvent() {
       }
 
       auto peer_cred = PeerCredentials::Get(client_socket_->GetFd());
-      if (peer_cred->GetPid() != pid) {
-        _E("The peer information does not match. %d : %d", peer_cred->GetPid(),
-           pid);
+      if (peer_cred->GetPid() != pid || peer_cred->GetPid() != pid_) {
+        _E("The peer information does not match. %d : %d : %d",
+           peer_cred->GetPid(), pid, pid_);
         client_socket_.reset();
         return;
       }