mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-16 14:16:16 -06:00
private-lib cleanup
This commit is contained in:
parent
b689b69f6c
commit
91f2b3ffc2
5 changed files with 11 additions and 23 deletions
|
|
@ -606,7 +606,6 @@ void fs_var_run(void);
|
|||
void fs_var_lock(void);
|
||||
void fs_var_tmp(void);
|
||||
void fs_var_utmp(void);
|
||||
void dbg_test_dir(const char *dir);
|
||||
|
||||
// fs_dev.c
|
||||
void fs_dev_shm(void);
|
||||
|
|
|
|||
|
|
@ -177,7 +177,6 @@ static void mount_dev_shm(void) {
|
|||
int rv = mount(RUN_DEV_DIR "/shm", "/dev/shm", "none", MS_BIND, "mode=01777,gid=0");
|
||||
if (rv == -1) {
|
||||
fwarning("cannot mount the old /dev/shm in private-dev\n");
|
||||
dbg_test_dir(RUN_DEV_DIR "/shm");
|
||||
empty_dev_shm();
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -230,21 +230,6 @@ void fs_var_cache(void) {
|
|||
}
|
||||
}
|
||||
|
||||
void dbg_test_dir(const char *dir) {
|
||||
if (arg_debug) {
|
||||
if (is_dir(dir))
|
||||
printf("%s is a directory\n", dir);
|
||||
if (is_link(dir)) {
|
||||
char *lnk = realpath(dir, NULL);
|
||||
if (lnk) {
|
||||
printf("%s is a symbolic link to %s\n", dir, lnk);
|
||||
free(lnk);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void fs_var_lock(void) {
|
||||
|
||||
if (is_dir("/var/lock")) {
|
||||
|
|
@ -254,10 +239,8 @@ void fs_var_lock(void) {
|
|||
errExit("mounting /lock");
|
||||
fs_logger("tmpfs /var/lock");
|
||||
}
|
||||
else {
|
||||
else
|
||||
fwarning("/var/lock not mounted\n");
|
||||
dbg_test_dir("/var/lock");
|
||||
}
|
||||
}
|
||||
|
||||
void fs_var_tmp(void) {
|
||||
|
|
@ -271,10 +254,8 @@ void fs_var_tmp(void) {
|
|||
fs_logger("tmpfs /var/tmp");
|
||||
}
|
||||
}
|
||||
else {
|
||||
else
|
||||
fwarning("/var/tmp not mounted\n");
|
||||
dbg_test_dir("/var/tmp");
|
||||
}
|
||||
}
|
||||
|
||||
void fs_var_utmp(void) {
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
#include "../include/common.h"
|
||||
#include "../include/ldd_utils.h"
|
||||
#ifdef HAVE_PRIVATE_LIB
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <sys/mman.h>
|
||||
|
|
@ -357,3 +358,9 @@ printf("\n");
|
|||
close(fd);
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
int main(void) {
|
||||
printf("Sorry, private lib is disabled in this build\n");
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
|
@ -23,6 +23,7 @@
|
|||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#ifdef HAVE_PRIVATE_LIB
|
||||
// todo: resolve overlap with masked_lib_dirs[] array from fs_lib.c
|
||||
const char * const default_lib_paths[] = {
|
||||
"/usr/lib/x86_64-linux-gnu", // Debian & friends
|
||||
|
|
@ -63,3 +64,4 @@ doexit:
|
|||
close(fd);
|
||||
return retval;
|
||||
}
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue