From 15e6690fa687e8d87c065dde10bf182ad2930d14 Mon Sep 17 00:00:00 2001 From: smitsohu Date: Sun, 7 Jul 2019 23:43:46 +0200 Subject: relocate mountinfo functionality test --- src/firejail/fs_whitelist.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/firejail/fs_whitelist.c b/src/firejail/fs_whitelist.c index bce44b9e5..c8fa8c72b 100644 --- a/src/firejail/fs_whitelist.c +++ b/src/firejail/fs_whitelist.c @@ -237,11 +237,6 @@ static void whitelist_path(ProfileEntry *entry) { return; } -#ifdef TEST_MOUNTINFO - printf("TEST_MOUNTINFO\n"); - path = "/etc/."; -#endif - // create path of the mount target if necessary int fd2 = mkpath(path, 0755); if (fd2 == -1) { @@ -305,7 +300,10 @@ static void whitelist_path(ProfileEntry *entry) { // check the last mount operation MountData *mptr = get_last_mount(); // will do exit(1) if the mount cannot be found - +#ifdef TEST_MOUNTINFO + printf("TEST_MOUNTINFO\n"); + mptr->dir = "foo"; +#endif // confirm the file was mounted on the right target // strcmp does not work here, because mptr->dir can be a child mount size_t path_len = strlen(path); -- cgit v1.2.3-70-g09d2