aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar smitsohu <smitsohu@gmail.com>2019-07-07 23:43:46 +0200
committerLibravatar smitsohu <smitsohu@gmail.com>2019-07-07 23:43:46 +0200
commit15e6690fa687e8d87c065dde10bf182ad2930d14 (patch)
treebaa7b61fcf09d23f13c0b3cb8dce72cca4165e67
parentUse __clone2 on ia64 (diff)
downloadfirejail-15e6690fa687e8d87c065dde10bf182ad2930d14.tar.gz
firejail-15e6690fa687e8d87c065dde10bf182ad2930d14.tar.zst
firejail-15e6690fa687e8d87c065dde10bf182ad2930d14.zip
relocate mountinfo functionality test
-rw-r--r--src/firejail/fs_whitelist.c10
1 files changed, 4 insertions, 6 deletions
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) {
237 return; 237 return;
238 } 238 }
239 239
240#ifdef TEST_MOUNTINFO
241 printf("TEST_MOUNTINFO\n");
242 path = "/etc/.";
243#endif
244
245 // create path of the mount target if necessary 240 // create path of the mount target if necessary
246 int fd2 = mkpath(path, 0755); 241 int fd2 = mkpath(path, 0755);
247 if (fd2 == -1) { 242 if (fd2 == -1) {
@@ -305,7 +300,10 @@ static void whitelist_path(ProfileEntry *entry) {
305 300
306 // check the last mount operation 301 // check the last mount operation
307 MountData *mptr = get_last_mount(); // will do exit(1) if the mount cannot be found 302 MountData *mptr = get_last_mount(); // will do exit(1) if the mount cannot be found
308 303#ifdef TEST_MOUNTINFO
304 printf("TEST_MOUNTINFO\n");
305 mptr->dir = "foo";
306#endif
309 // confirm the file was mounted on the right target 307 // confirm the file was mounted on the right target
310 // strcmp does not work here, because mptr->dir can be a child mount 308 // strcmp does not work here, because mptr->dir can be a child mount
311 size_t path_len = strlen(path); 309 size_t path_len = strlen(path);