Before executing an application, the child process creates the ID file.
If's for Application Manager.
Change-Id: I4e561b80071c12fb786ca89cab8a968d25e159ff
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
int _prepare_app_socket(void);
int _enable_external_pkg(bundle *b, const char *pkgid, uid_t pkg_uid);
int _verify_proc_caps(void);
+int _prepare_id_file(void);
#endif /* __LAUNCHPAD_COMMON_H__ */
ret = _prepare_app_socket();
if (ret < 0)
return PAD_ERR_FAILED;
+
+ ret = _prepare_id_file();
+ if (ret < 0)
+ return PAD_ERR_FAILED;
}
return 0;
return 0;
}
+
+int _prepare_id_file(void)
+{
+ char path[PATH_MAX];
+ int fd;
+
+ snprintf(path, sizeof(path), "/run/aul/apps/%u/%d/%s",
+ getuid(), getpid(), getenv("AUL_APPID"));
+ fd = open(path, O_CREAT | O_WRONLY | O_TRUNC, 0600);
+ if (fd < 0) {
+ _E("Failed to create %s. errno(%d)", path, errno);
+ return -1;
+ }
+ close(fd);
+
+ return 0;
+}
if (ret < 0)
return -1;
+ ret = _prepare_id_file();
+ if (ret < 0)
+ return -1;
+
return 0;
}