aboutsummaryrefslogtreecommitdiffstats
path: root/src/firejail/fs_lib2.c
diff options
context:
space:
mode:
authorLibravatar smitsohu <smitsohu@gmail.com>2021-01-06 13:14:22 +0100
committerLibravatar smitsohu <smitsohu@gmail.com>2021-01-06 19:50:48 +0100
commit1e3891ed00c99a913f98fc1f42805fafe38f7ff5 (patch)
tree78adb56ff3a988e3ecfdbfca53549d65d3e7ef18 /src/firejail/fs_lib2.c
parentnon-dumpable plugins (diff)
downloadfirejail-1e3891ed00c99a913f98fc1f42805fafe38f7ff5.tar.gz
firejail-1e3891ed00c99a913f98fc1f42805fafe38f7ff5.tar.zst
firejail-1e3891ed00c99a913f98fc1f42805fafe38f7ff5.zip
fix broken tests and regression on 45304621a6c600d8e30e98bfbef05149caaf56c5
Diffstat (limited to 'src/firejail/fs_lib2.c')
-rw-r--r--src/firejail/fs_lib2.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/firejail/fs_lib2.c b/src/firejail/fs_lib2.c
index b2ae07f3e..758e079a4 100644
--- a/src/firejail/fs_lib2.c
+++ b/src/firejail/fs_lib2.c
@@ -30,6 +30,7 @@ extern void fslib_copy_dir(const char *full_path);
30//*************************************************************** 30//***************************************************************
31// standard libc libraries based on Debian's libc6 package 31// standard libc libraries based on Debian's libc6 package
32// selinux seems to be linked in most command line utilities 32// selinux seems to be linked in most command line utilities
33// libpcre2 is a dependency of selinux
33// locale (/usr/lib/locale) - without it, the program will default to "C" locale 34// locale (/usr/lib/locale) - without it, the program will default to "C" locale
34typedef struct liblist_t { 35typedef struct liblist_t {
35 const char *name; 36 const char *name;
@@ -38,6 +39,7 @@ typedef struct liblist_t {
38 39
39static LibList libc_list[] = { 40static LibList libc_list[] = {
40 { "libselinux.so.", 0 }, 41 { "libselinux.so.", 0 },
42 { "libpcre2-8.so.", 0 },
41 { "libapparmor.so.", 0}, 43 { "libapparmor.so.", 0},
42 { "ld-linux-x86-64.so.", 0 }, 44 { "ld-linux-x86-64.so.", 0 },
43 { "libanl.so.", 0 }, 45 { "libanl.so.", 0 },
@@ -104,16 +106,19 @@ static void stdc(const char *dirname) {
104 106
105void fslib_install_stdc(void) { 107void fslib_install_stdc(void) {
106 // install standard C libraries 108 // install standard C libraries
109 timetrace_start();
107 struct stat s; 110 struct stat s;
108 char *stdclib = "/lib64"; // CentOS, Fedora, Arch 111 char *stdclib = "/lib64"; // CentOS, Fedora, Arch
109 112
110 if (stat("/lib/x86_64-linux-gnu", &s) == 0) { // Debian & friends 113 if (stat("/lib/x86_64-linux-gnu", &s) == 0) { // Debian & friends
114 // PT_INTERP
115 fslib_duplicate("/lib64/ld-linux-x86-64.so.2");
116
111 mkdir_attr(RUN_LIB_DIR "/x86_64-linux-gnu", 0755, 0, 0); 117 mkdir_attr(RUN_LIB_DIR "/x86_64-linux-gnu", 0755, 0, 0);
112 selinux_relabel_path(RUN_LIB_DIR "/x86_64-linux-gnu", "/lib/x86_64-linux-gnu"); 118 selinux_relabel_path(RUN_LIB_DIR "/x86_64-linux-gnu", "/lib/x86_64-linux-gnu");
113 stdclib = "/lib/x86_64-linux-gnu"; 119 stdclib = "/lib/x86_64-linux-gnu";
114 } 120 }
115 121
116 timetrace_start();
117 stdc(stdclib); 122 stdc(stdclib);
118 123
119 // install locale 124 // install locale