#include <libgen.h>
#include <glob.h>
#include <elf.h>
+#include <linux/limits.h>
#include <libubox/utils.h>
static int elf_open(char **dir, const char *file)
{
struct library_path *p;
- char path[256];
+ char path[PATH_MAX];
int fd = -1;
*dir = NULL;
const char* find_lib(const char *file)
{
struct library *l;
- static char path[256];
+ static char path[PATH_MAX];
const char *p;
l = avl_find_element(&libraries, file, l, avl);
void load_ldso_conf(const char *conf)
{
FILE* fp = fopen(conf, "r");
- char line[256];
+ char line[PATH_MAX];
if (!fp) {
DEBUG("failed to open %s\n", conf);
while (!feof(fp)) {
int len;
- if (!fgets(line, 256, fp))
+ if (!fgets(line, sizeof(line), fp))
break;
len = strlen(line);
if (len < 2)
#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"))
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;