aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2016-11-10 20:15:22 -0500
committerLibravatar netblue30 <netblue30@yahoo.com>2016-11-10 20:15:22 -0500
commitfffce11c3da087172c069ec0ff4c788f5bcc522b (patch)
tree7e3297f56448ebc8122f8fbb006fa3ce034ea62c /src
parenttesting (diff)
downloadfirejail-fffce11c3da087172c069ec0ff4c788f5bcc522b.tar.gz
firejail-fffce11c3da087172c069ec0ff4c788f5bcc522b.tar.zst
firejail-fffce11c3da087172c069ec0ff4c788f5bcc522b.zip
testing
Diffstat (limited to 'src')
-rw-r--r--src/firejail/fs_bin.c3
-rw-r--r--src/firejail/fs_etc.c3
-rw-r--r--src/firejail/fs_mkdir.c6
-rw-r--r--src/firejail/ls.c12
-rw-r--r--src/firejail/main.c3
-rw-r--r--src/firejail/x11.c3
-rw-r--r--src/firemon/interface.c3
-rw-r--r--src/firemon/procevent.c4
8 files changed, 37 insertions, 0 deletions
diff --git a/src/firejail/fs_bin.c b/src/firejail/fs_bin.c
index a3576e7c4..c906e32c0 100644
--- a/src/firejail/fs_bin.c
+++ b/src/firejail/fs_bin.c
@@ -247,6 +247,9 @@ void fs_private_bin_list(void) {
247 duplicate(ptr); 247 duplicate(ptr);
248 free(dlist); 248 free(dlist);
249 fs_logger_print(); 249 fs_logger_print();
250#ifdef HAVE_GCOV
251 __gcov_flush();
252#endif
250 _exit(0); 253 _exit(0);
251 } 254 }
252 // wait for the child to finish 255 // wait for the child to finish
diff --git a/src/firejail/fs_etc.c b/src/firejail/fs_etc.c
index 830de7c9f..ebcde29a3 100644
--- a/src/firejail/fs_etc.c
+++ b/src/firejail/fs_etc.c
@@ -171,6 +171,9 @@ void fs_private_etc_list(void) {
171 duplicate(ptr); 171 duplicate(ptr);
172 free(dlist); 172 free(dlist);
173 fs_logger_print(); 173 fs_logger_print();
174#ifdef HAVE_GCOV
175 __gcov_flush();
176#endif
174 _exit(0); 177 _exit(0);
175 } 178 }
176 // wait for the child to finish 179 // wait for the child to finish
diff --git a/src/firejail/fs_mkdir.c b/src/firejail/fs_mkdir.c
index cffe32a7a..6bcb3f33e 100644
--- a/src/firejail/fs_mkdir.c
+++ b/src/firejail/fs_mkdir.c
@@ -81,6 +81,9 @@ void fs_mkdir(const char *name) {
81 81
82 // create directory 82 // create directory
83 mkdir_recursive(expanded); 83 mkdir_recursive(expanded);
84#ifdef HAVE_GCOV
85 __gcov_flush();
86#endif
84 _exit(0); 87 _exit(0);
85 } 88 }
86 // wait for the child to finish 89 // wait for the child to finish
@@ -126,6 +129,9 @@ void fs_mkfile(const char *name) {
126 (void) rv; 129 (void) rv;
127 fclose(fp); 130 fclose(fp);
128 } 131 }
132#ifdef HAVE_GCOV
133 __gcov_flush();
134#endif
129 _exit(0); 135 _exit(0);
130 } 136 }
131 // wait for the child to finish 137 // wait for the child to finish
diff --git a/src/firejail/ls.c b/src/firejail/ls.c
index 7c5585324..1b759d7a1 100644
--- a/src/firejail/ls.c
+++ b/src/firejail/ls.c
@@ -358,6 +358,9 @@ void sandboxfs(int op, pid_t pid, const char *path1, const char *path2) {
358 // copy the file 358 // copy the file
359 if (copy_file(src_fname, tmp_fname, getuid(), getgid(), 0600)) 359 if (copy_file(src_fname, tmp_fname, getuid(), getgid(), 0600))
360 _exit(1); 360 _exit(1);
361#ifdef HAVE_GCOV
362 __gcov_flush();
363#endif
361 _exit(0); 364 _exit(0);
362 } 365 }
363 366
@@ -381,6 +384,9 @@ void sandboxfs(int op, pid_t pid, const char *path1, const char *path2) {
381 // copy the file 384 // copy the file
382 if (copy_file(tmp_fname, dest_fname, getuid(), getgid(), 0600)) 385 if (copy_file(tmp_fname, dest_fname, getuid(), getgid(), 0600))
383 _exit(1); 386 _exit(1);
387#ifdef HAVE_GCOV
388 __gcov_flush();
389#endif
384 _exit(0); 390 _exit(0);
385 } 391 }
386 392
@@ -423,6 +429,9 @@ void sandboxfs(int op, pid_t pid, const char *path1, const char *path2) {
423 // copy the file 429 // copy the file
424 if (copy_file(src_fname, tmp_fname, getuid(), getgid(), 0600)) 430 if (copy_file(src_fname, tmp_fname, getuid(), getgid(), 0600))
425 _exit(1); 431 _exit(1);
432#ifdef HAVE_GCOV
433 __gcov_flush();
434#endif
426 _exit(0); 435 _exit(0);
427 } 436 }
428 437
@@ -452,6 +461,9 @@ void sandboxfs(int op, pid_t pid, const char *path1, const char *path2) {
452 // copy the file 461 // copy the file
453 if (copy_file(tmp_fname, dest_fname, getuid(), getgid(), 0600)) 462 if (copy_file(tmp_fname, dest_fname, getuid(), getgid(), 0600))
454 _exit(1); 463 _exit(1);
464#ifdef HAVE_GCOV
465 __gcov_flush();
466#endif
455 _exit(0); 467 _exit(0);
456 } 468 }
457 469
diff --git a/src/firejail/main.c b/src/firejail/main.c
index 4759e6a5f..3f005b547 100644
--- a/src/firejail/main.c
+++ b/src/firejail/main.c
@@ -2461,6 +2461,9 @@ int main(int argc, char **argv) {
2461 network_main(child); 2461 network_main(child);
2462 if (arg_debug) 2462 if (arg_debug)
2463 printf("Host network configured\n"); 2463 printf("Host network configured\n");
2464#ifdef HAVE_GCOV
2465 __gcov_flush();
2466#endif
2464 _exit(0); 2467 _exit(0);
2465 } 2468 }
2466 2469
diff --git a/src/firejail/x11.c b/src/firejail/x11.c
index ecab8880a..54f947c45 100644
--- a/src/firejail/x11.c
+++ b/src/firejail/x11.c
@@ -692,6 +692,9 @@ void x11_xorg(void) {
692 execlp("/usr/bin/xauth", "/usr/bin/xauth", "-f", tmpfname, 692 execlp("/usr/bin/xauth", "/usr/bin/xauth", "-f", tmpfname,
693 "generate", display, "MIT-MAGIC-COOKIE-1", "untrusted", NULL); 693 "generate", display, "MIT-MAGIC-COOKIE-1", "untrusted", NULL);
694 694
695#ifdef HAVE_GCOV
696 __gcov_flush();
697#endif
695 _exit(0); 698 _exit(0);
696 } 699 }
697 700
diff --git a/src/firemon/interface.c b/src/firemon/interface.c
index bceed93d3..58990e6e5 100644
--- a/src/firemon/interface.c
+++ b/src/firemon/interface.c
@@ -146,6 +146,9 @@ static void print_sandbox(pid_t pid) {
146 return; 146 return;
147 net_ifprint(); 147 net_ifprint();
148 printf("\n"); 148 printf("\n");
149#ifdef HAVE_GCOV
150 __gcov_flush();
151#endif
149 _exit(0); 152 _exit(0);
150 } 153 }
151 154
diff --git a/src/firemon/procevent.c b/src/firemon/procevent.c
index 78a3a4fb2..1940f4a34 100644
--- a/src/firemon/procevent.c
+++ b/src/firemon/procevent.c
@@ -192,6 +192,10 @@ static int procevent_monitor(const int sock, pid_t mypid) {
192 tv.tv_usec = 0; 192 tv.tv_usec = 0;
193 193
194 while (1) { 194 while (1) {
195#ifdef HAVE_GCOV
196 __gcov_flush();
197#endif
198
195#define BUFFSIZE 4096 199#define BUFFSIZE 4096
196 char __attribute__ ((aligned(NLMSG_ALIGNTO)))buf[BUFFSIZE]; 200 char __attribute__ ((aligned(NLMSG_ALIGNTO)))buf[BUFFSIZE];
197 201