From: Hwankyu Jhun Date: Fri, 7 Aug 2020 05:49:08 +0000 (+0900) Subject: Fix client pid check X-Git-Tag: submit/tizen/20200807.065214~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9d0812ce40cc6509dd24e650c9947abcec8172bb;p=platform%2Fcore%2Fappfw%2Flaunchpad.git Fix client pid check If the loader context is a hydra loader, launchpad doesn't check the client process ID. The child process of the hydra loader tries to connect to the launchpad-process-pool. If launchpad rejects the request, the child process of the hydra loader will be terminated. Change-Id: If4898ba64acb75f647086e266289a669f83673d5 Signed-off-by: Hwankyu Jhun --- diff --git a/src/launchpad/src/launchpad.c b/src/launchpad/src/launchpad.c index 6e9864d0..804aa23c 100644 --- a/src/launchpad/src/launchpad.c +++ b/src/launchpad/src/launchpad.c @@ -629,7 +629,7 @@ static int __accept_candidate_process(int server_fd, int *out_client_fd, goto error; } - if (cred.pid != cpc_pid) { + if (cpc_pid != -1 && cred.pid != cpc_pid) { _E("Invalid accept. pid(%d)", cred.pid); goto error; } @@ -1449,7 +1449,7 @@ static bool __handle_loader_event(int fd, io_condition_e cond, void *data) if (!cpc->prepared) { ret = __accept_candidate_process(fd, &client_fd, &client_pid, - cpc->pid); + cpc->is_hydra ? -1 : cpc->pid); if (ret >= 0) { /* for hydra need to set pid to pid of non-hydra candidate, */ /* which is connecting now */