unittest: pass_hal_gtest: Modify path of systemctl command 33/185833/1 accepted/tizen/unified/20180808.063338 submit/tizen/20180803.032812
authorChanwoo Choi <cw00.choi@samsung.com>
Fri, 3 Aug 2018 01:54:22 +0000 (10:54 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Fri, 3 Aug 2018 01:54:22 +0000 (10:54 +0900)
To prevent malicious binary by changing path of systemctl,
modify path of systemctl command with absolute path.

Change-Id: I6a7bc842d43f954ac3ac9a1a43684d4de7167155
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
unittest/pass_hal_gtest.cpp

index 8f229d92b0142f53f667b2b3ae7ea6abcc597fd1..0b3b450219d27abe4f3c2ec3643c878487c889bc 100644 (file)
@@ -60,7 +60,7 @@ TEST_F(PassHalTest, GetResourceConfig)
        char path[] = "/etc/pass/pass.conf";
 
        /* Stop PASS daemon before HAL testing */
-       ret = system("systemctl stop pass.service");
+       ret = system("/bin/systemctl stop pass.service");
        ASSERT_EQ(ret, 0) << "PassServieStop Faield";
 
        ret = pass_get_resource_config(&g_pass, path);
@@ -533,7 +533,7 @@ TEST_F(PassHalTest, PutResourceConfig)
        }
 
        /* Restart PASS daemon before HAL testing */
-       ret = system("systemctl start pass.service");
+       ret = system("/bin/systemctl start pass.service");
        ASSERT_EQ(ret, 0) << "PassServiceStart Faield";
 }