The web engine is running as a child process of the web app.
If the web engine calls AUL APIs, the request is delivered to AMD.
Because, the process ID is not equal to the web app.
After this patch is applied, AUL API checks whether the process group ID
is equal to the process ID or not. Before executing an application,
the child process of the launchpad-process-pool calls the setsid() to
run the process in a new session. In that time, the process group is separated
from the launchpad-process-pool. Checking the process group ID can reduce
the IPC between AMD and the caller process.
Change-Id: I3746046c36328ecacc27c6cda16afbe44c1e1cfd
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
return AUL_R_EINVAL;
}
- if (getpid() == pid) {
+ if (getpid() == pid || getpgid(getpid()) == pid) {
context.Initialize();
auto& preinit_appid = context.GetPreInitAppId();
if (!preinit_appid.empty()) {
return AUL_R_EINVAL;
}
- if (getpid() == pid) {
+ if (getpid() == pid || getpgid(getpid()) == pid) {
context.Initialize();
auto& preinit_pkgid = context.GetPreInitPkgId();
if (!preinit_pkgid.empty()) {