#include <fcntl.h>
#include <libgen.h>
#include <sched.h>
+#include <linux/limits.h>
#include "elf.h"
#include "capabilities.h"
{
const char *p = path;
struct stat s;
- char old[256];
- char new[256];
+ char old[PATH_MAX];
+ char new[PATH_MAX];
int fd;
if (strstr(p, "local"))
return 0;
}
-static int build_jail_fs()
+static int build_jail_fs(void)
{
struct library *l;
struct extra *m;
return -1;
}
- avl_init(&libraries, avl_strcmp, false, NULL);
- alloc_library_path("/lib");
- alloc_library_path("/lib64");
- alloc_library_path("/usr/lib");
- load_ldso_conf("/etc/ld.so.conf");
+ init_library_search();
if (elf_load_deps(*opts.jail_argv)) {
ERROR("failed to load dependencies\n");
static char** build_envp(const char *seccomp)
{
static char *envp[MAX_ENVP];
- static char preload_var[64];
- static char seccomp_var[64];
+ static char preload_var[PATH_MAX];
+ static char seccomp_var[PATH_MAX];
static char debug_var[] = "LD_DEBUG=all";
const char *preload_lib = find_lib("libpreload-seccomp.so");
int count = 0;
and will only drop capabilities/apply seccomp filter.\n\n");
}
-static int exec_jail()
+static int exec_jail(void)
{
char **envp = build_envp(opts.seccomp);
if (!envp)