core: Remove unused /var/run/.pass.pid file 13/139413/2 accepted/tizen/unified/20170720.164745 submit/tizen/20170719.015733
authorChanwoo Choi <cw00.choi@samsung.com>
Wed, 19 Jul 2017 01:27:29 +0000 (10:27 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Wed, 19 Jul 2017 01:43:47 +0000 (01:43 +0000)
PASS stores the pid to the /var/run/.pass.pid. But it is not used
and it has the security issue if the path is symbolic link.

This patch removes the /var/run/.pass.pid file.

Change-Id: I816da948f9ebe9203119bc4b21041d0a926aa338
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
src/core/main.c

index f1745449468dca74bba3ddb24d82a98ccc945509..72f95b8723b3efc3b81ed2aab92908128ab49868 100644 (file)
 #include "devices.h"
 #include "edbus-handler.h"
 
-#define PIDFILE_PATH           "/var/run/.pass.pid"
-
-static void writepid(char *pidpath)
-{
-       FILE *fp;
-
-       fp = fopen(pidpath, "w");
-       if (fp != NULL) {
-               fprintf(fp, "%d", getpid());
-               fclose(fp);
-       }
-}
-
 static void sig_quit(int signo)
 {
        _D("received SIGTERM signal %d", signo);
@@ -78,7 +65,6 @@ static int pass_main(int argc, char **argv)
 
 int main(int argc, char **argv)
 {
-       writepid(PIDFILE_PATH);
        ecore_init();
        return pass_main(argc, argv);
 }