diff options
author | netblue30 <netblue30@yahoo.com> | 2018-10-19 10:51:46 -0400 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2018-10-19 10:51:46 -0400 |
commit | ba4ea09a445944d34fcde9b749ebd1f8854cdb66 (patch) | |
tree | e2e31cd2d5e762f3825070aa0a2537b7594a5b4a | |
parent | set release version 0.9.56 (diff) | |
download | firejail-ba4ea09a445944d34fcde9b749ebd1f8854cdb66.tar.gz firejail-ba4ea09a445944d34fcde9b749ebd1f8854cdb66.tar.zst firejail-ba4ea09a445944d34fcde9b749ebd1f8854cdb66.zip |
testing
-rwxr-xr-x | gcov.sh | 35 | ||||
-rw-r--r-- | src/include/ldd_utils.h | 46 | ||||
-rw-r--r-- | src/lib/ldd_utils.c | 62 | ||||
-rwxr-xr-x | test/root/root.sh | 1 |
4 files changed, 6 insertions, 138 deletions
@@ -6,22 +6,17 @@ gcov_init() { | |||
6 | firemon --help > /dev/null | 6 | firemon --help > /dev/null |
7 | /usr/lib/firejail/fnet --help > /dev/null | 7 | /usr/lib/firejail/fnet --help > /dev/null |
8 | /usr/lib/firejail/fseccomp --help > /dev/null | 8 | /usr/lib/firejail/fseccomp --help > /dev/null |
9 | /usr/lib/firejail/ftee --help > /dev/null | ||
10 | /usr/lib/firejail/fcopy --help > /dev/null | ||
11 | /usr/lib/firejail/fldd --help > /dev/null | ||
12 | firecfg --help > /dev/null | 9 | firecfg --help > /dev/null |
13 | 10 | ||
14 | /usr/lib/firejail/fnetfilter --help > /dev/null | 11 | /usr/lib/firejail/fnetfilter --help > /dev/null |
15 | /usr/lib/firejail/fsec-print --help > /dev/null | 12 | /usr/lib/firejail/fsec-print --help > /dev/null |
16 | /usr/lib/firejail/fsec-optimize --help > /dev/null | 13 | /usr/lib/firejail/fsec-optimize --help > /dev/null |
17 | /usr/lib/firejail/faudit --help > /dev/null | ||
18 | /usr/lib/firejail/fbuilder --help > /dev/null | ||
19 | 14 | ||
20 | sudo chown $USER:$USER `find .` | 15 | sudo chown $USER:$USER `find .` |
21 | } | 16 | } |
22 | 17 | ||
23 | generate() { | 18 | generate() { |
24 | lcov -q --capture -d src/firejail -d src/firemon -d src/faudit -d src/fbuilder -d src/fcopy -d src/fnetfilter -d src/fsec-print -d src/fsec-optimize -d src/fseccomp -d src/fnet -d src/ftee -d src/lib -d src/firecfg -d src/fldd --output-file gcov-file-new | 19 | lcov -q --capture -d src/firejail -d src/firemon -d src/fnetfilter -d src/fsec-print -d src/fsec-optimize -d src/fseccomp -d src/fnet -d src/lib -d src/firecfg --output-file gcov-file-new |
25 | lcov --add-tracefile gcov-file-old --add-tracefile gcov-file-new --output-file gcov-file | 20 | lcov --add-tracefile gcov-file-old --add-tracefile gcov-file-new --output-file gcov-file |
26 | rm -fr gcov-dir | 21 | rm -fr gcov-dir |
27 | genhtml -q gcov-file --output-directory gcov-dir | 22 | genhtml -q gcov-file --output-directory gcov-dir |
@@ -32,7 +27,9 @@ generate() { | |||
32 | 27 | ||
33 | 28 | ||
34 | gcov_init | 29 | gcov_init |
35 | lcov -q --capture -d src/firejail -d src/firemon -d src/faudit -d src/fbuilder -d src/fcopy -d src/fnetfilter -d src/fsec-print -d src/fsec-optimize -d src/fseccomp -d src/fnet -d src/ftee -d src/lib -d src/firecfg -d src/fldd --output-file gcov-file-old | 30 | lcov -q --capture -d src/firejail -d src/firemon \ |
31 | -d src/fnetfilter -d src/fsec-print -d src/fsec-optimize -d src/fseccomp \ | ||
32 | -d src/fnet -d src/lib -d src/firecfg --output-file gcov-file-old | ||
36 | 33 | ||
37 | #make test-utils | 34 | #make test-utils |
38 | #generate | 35 | #generate |
@@ -44,10 +41,8 @@ lcov -q --capture -d src/firejail -d src/firemon -d src/faudit -d src/fbuilder - | |||
44 | make test-root | 41 | make test-root |
45 | generate | 42 | generate |
46 | sleep 2 | 43 | sleep 2 |
44 | exit | ||
47 | 45 | ||
48 | make test-chroot | ||
49 | generate | ||
50 | sleep 2 | ||
51 | 46 | ||
52 | make test-network | 47 | make test-network |
53 | generate | 48 | generate |
@@ -57,22 +52,10 @@ make test-stress | |||
57 | generate | 52 | generate |
58 | sleep 2 | 53 | sleep 2 |
59 | 54 | ||
60 | make test-ssh | ||
61 | generate | ||
62 | sleep 2 | ||
63 | |||
64 | make test-appimage | 55 | make test-appimage |
65 | generate | 56 | generate |
66 | sleep 2 | 57 | sleep 2 |
67 | 58 | ||
68 | make test-overlay | ||
69 | generate | ||
70 | sleep 2 | ||
71 | |||
72 | make test-fcopy | ||
73 | generate | ||
74 | sleep 2 | ||
75 | |||
76 | make test-profiles | 59 | make test-profiles |
77 | generate | 60 | generate |
78 | sleep 2 | 61 | sleep 2 |
@@ -93,14 +76,6 @@ make test-apps | |||
93 | generate | 76 | generate |
94 | sleep 2 | 77 | sleep 2 |
95 | 78 | ||
96 | make test-apps-x11 | ||
97 | generate | ||
98 | sleep 2 | ||
99 | |||
100 | make test-apps-x11-xorg | ||
101 | generate | ||
102 | sleep 2 | ||
103 | |||
104 | make test-filters | 79 | make test-filters |
105 | generate | 80 | generate |
106 | sleep 2 | 81 | sleep 2 |
diff --git a/src/include/ldd_utils.h b/src/include/ldd_utils.h deleted file mode 100644 index 28f5be7bf..000000000 --- a/src/include/ldd_utils.h +++ /dev/null | |||
@@ -1,46 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2014-2018 Firejail Authors | ||
3 | * | ||
4 | * This file is part of firejail project | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License along | ||
17 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
19 | */ | ||
20 | |||
21 | #ifndef LDD_UTILS_H | ||
22 | #define LDD_UTILS_H | ||
23 | |||
24 | #include "../include/common.h" | ||
25 | #include <elf.h> | ||
26 | |||
27 | #ifdef __LP64__ | ||
28 | #define Elf_Ehdr Elf64_Ehdr | ||
29 | #define Elf_Phdr Elf64_Phdr | ||
30 | #define Elf_Shdr Elf64_Shdr | ||
31 | #define Elf_Dyn Elf64_Dyn | ||
32 | #else | ||
33 | #define Elf_Ehdr Elf32_Ehdr | ||
34 | #define Elf_Phdr Elf32_Phdr | ||
35 | #define Elf_Shdr Elf32_Shdr | ||
36 | #define Elf_Dyn Elf32_Dyn | ||
37 | #endif | ||
38 | |||
39 | extern const char * const default_lib_paths[]; | ||
40 | |||
41 | // return 1 if this is a 64 bit program/library | ||
42 | int is_lib_64(const char *exe); | ||
43 | |||
44 | |||
45 | |||
46 | #endif \ No newline at end of file | ||
diff --git a/src/lib/ldd_utils.c b/src/lib/ldd_utils.c deleted file mode 100644 index b8a7aeed2..000000000 --- a/src/lib/ldd_utils.c +++ /dev/null | |||
@@ -1,62 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2014-2018 Firejail Authors | ||
3 | * | ||
4 | * This file is part of firejail project | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License along | ||
17 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
19 | */ | ||
20 | |||
21 | #include "../include/ldd_utils.h" | ||
22 | #include <sys/types.h> | ||
23 | #include <sys/stat.h> | ||
24 | #include <fcntl.h> | ||
25 | |||
26 | const char * const default_lib_paths[] = { | ||
27 | "/usr/lib/x86_64-linux-gnu", // Debian & friends | ||
28 | "/lib/x86_64-linux-gnu", // CentOS, Fedora | ||
29 | "/usr/lib", | ||
30 | "/lib", | ||
31 | "/lib64", | ||
32 | LIBDIR, | ||
33 | "/usr/local/lib", | ||
34 | "/usr/lib/x86_64-linux-gnu/mesa", // libGL.so is sometimes a symlink into this directory | ||
35 | "/usr/lib/x86_64-linux-gnu/mesa-egl", // libGL.so is sometimes a symlink into this directory | ||
36 | // "/usr/lib/x86_64-linux-gnu/plasma-discover", | ||
37 | NULL | ||
38 | }; | ||
39 | |||
40 | // return 1 if this is a 64 bit program/library | ||
41 | int is_lib_64(const char *exe) { | ||
42 | int retval = 0; | ||
43 | int fd = open(exe, O_RDONLY); | ||
44 | if (fd < 0) | ||
45 | return 0; | ||
46 | |||
47 | unsigned char buf[EI_NIDENT]; | ||
48 | ssize_t len = 0; | ||
49 | while (len < EI_NIDENT) { | ||
50 | ssize_t sz = read(fd, buf, EI_NIDENT); | ||
51 | if (sz <= 0) | ||
52 | goto doexit; | ||
53 | len += sz; | ||
54 | } | ||
55 | |||
56 | if (buf[EI_CLASS] == ELFCLASS64) | ||
57 | retval = 1; | ||
58 | |||
59 | doexit: | ||
60 | close(fd); | ||
61 | return retval; | ||
62 | } | ||
diff --git a/test/root/root.sh b/test/root/root.sh index a20142c5f..2760a5a61 100755 --- a/test/root/root.sh +++ b/test/root/root.sh | |||
@@ -12,6 +12,7 @@ if [ "$?" -eq 0 ]; | |||
12 | then | 12 | then |
13 | echo "TESTING: firecfg (test/root/firecfg.exp)" | 13 | echo "TESTING: firecfg (test/root/firecfg.exp)" |
14 | mv /home/netblue/.local/share/applications /home/netblue/.local/share/applications-store | 14 | mv /home/netblue/.local/share/applications /home/netblue/.local/share/applications-store |
15 | rm /etc/firejail/firejail.users | ||
15 | ./firecfg.exp | 16 | ./firecfg.exp |
16 | mv /home/netblue/.local/share/applications-store /home/netblue/.local/share/applications | 17 | mv /home/netblue/.local/share/applications-store /home/netblue/.local/share/applications |
17 | else | 18 | else |