Make it a bit more standards friendly
This commit is contained in:
parent
8a501f4ad6
commit
432c82bb34
@ -137,7 +137,7 @@ static bool cmdlineIsANumber(const char *s)
|
||||
return true;
|
||||
}
|
||||
|
||||
rlim_t cmdlineParseRLimit(int res, const char *optarg, unsigned long mul)
|
||||
__rlim64_t cmdlineParseRLimit(int res, const char *optarg, unsigned long mul)
|
||||
{
|
||||
struct rlimit64 cur;
|
||||
if (prlimit64(0, res, NULL, &cur) == -1) {
|
||||
@ -153,7 +153,7 @@ rlim_t cmdlineParseRLimit(int res, const char *optarg, unsigned long mul)
|
||||
LOG_F("RLIMIT %d needs a numeric or 'max'/'def' value ('%s' provided)", res,
|
||||
optarg);
|
||||
}
|
||||
rlim64_t val = strtoull(optarg, NULL, 0) * mul;
|
||||
__rlim64_t val = strtoull(optarg, NULL, 0) * mul;
|
||||
if (val == ULLONG_MAX && errno != 0) {
|
||||
PLOG_F("strtoul('%s', 0)", optarg);
|
||||
}
|
||||
|
14
common.h
14
common.h
@ -98,13 +98,13 @@ struct nsjconf_t {
|
||||
bool verbose;
|
||||
bool keep_env;
|
||||
bool keep_caps;
|
||||
rlim64_t rl_as;
|
||||
rlim64_t rl_core;
|
||||
rlim64_t rl_cpu;
|
||||
rlim64_t rl_fsize;
|
||||
rlim64_t rl_nofile;
|
||||
rlim64_t rl_nproc;
|
||||
rlim64_t rl_stack;
|
||||
__rlim64_t rl_as;
|
||||
__rlim64_t rl_core;
|
||||
__rlim64_t rl_cpu;
|
||||
__rlim64_t rl_fsize;
|
||||
__rlim64_t rl_nofile;
|
||||
__rlim64_t rl_nproc;
|
||||
__rlim64_t rl_stack;
|
||||
unsigned long personality;
|
||||
bool clone_newnet;
|
||||
bool clone_newuser;
|
||||
|
@ -79,11 +79,11 @@ static bool containDropPrivs(struct nsjconf_t *nsjconf)
|
||||
if (setgroups(0, group_list) == -1) {
|
||||
PLOG_D("setgroups(NULL) failed");
|
||||
}
|
||||
if (setresgid(nsjconf->inside_gid, nsjconf->inside_gid, nsjconf->inside_gid) == -1) {
|
||||
if (syscall(__NR_setresgid, nsjconf->inside_gid, nsjconf->inside_gid, nsjconf->inside_gid) == -1) {
|
||||
PLOG_E("setresgid(%u)", nsjconf->inside_gid);
|
||||
return false;
|
||||
}
|
||||
if (setresuid(nsjconf->inside_uid, nsjconf->inside_uid, nsjconf->inside_uid) == -1) {
|
||||
if (syscall(__NR_setresuid, nsjconf->inside_uid, nsjconf->inside_uid, nsjconf->inside_uid) == -1) {
|
||||
PLOG_E("setresuid(%u)", nsjconf->inside_uid);
|
||||
return false;
|
||||
}
|
||||
|
1
mount.c
1
mount.c
@ -23,6 +23,7 @@
|
||||
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <linux/sched.h>
|
||||
#include <sched.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
2
net.c
2
net.c
@ -45,6 +45,8 @@
|
||||
|
||||
#define IFACE_NAME "vs"
|
||||
|
||||
extern char **environ;
|
||||
|
||||
#if defined(NSJAIL_NL3_WITH_MACVLAN)
|
||||
#include <netlink/route/link.h>
|
||||
#include <netlink/route/link/macvlan.h>
|
||||
|
1
pid.c
1
pid.c
@ -21,6 +21,7 @@
|
||||
|
||||
#include "pid.h"
|
||||
|
||||
#include <linux/sched.h>
|
||||
#include <sched.h>
|
||||
#include <signal.h>
|
||||
#include <sys/prctl.h>
|
||||
|
Loading…
Reference in New Issue
Block a user