private-lib cleanup

This commit is contained in:
netblue30 2023-03-09 15:25:45 -05:00
parent b689b69f6c
commit 91f2b3ffc2
5 changed files with 11 additions and 23 deletions

View file

@ -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);

View file

@ -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;
}

View file

@ -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) {

View file

@ -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

View file

@ -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