platform/upstream/nsjail.git
6 years agoMerge pull request #74 from jvvv/master
robertswiecki [Sun, 25 Feb 2018 00:03:50 +0000 (01:03 +0100)]
Merge pull request #74 from jvvv/master

nsjail.1: update for new options.

6 years agoREADME.md: adjust to match manual page.
John Vogel [Sat, 24 Feb 2018 08:08:56 +0000 (03:08 -0500)]
README.md: adjust to match manual page.

6 years agonsjail.1: update for new options.
John Vogel [Sat, 24 Feb 2018 07:39:36 +0000 (02:39 -0500)]
nsjail.1: update for new options.

Also, move the --cap option description so that it follows the
--keep-caps option, which matches the README and seems logical.

6 years agomnt: simplify mountPt
Robert Swiecki [Wed, 21 Feb 2018 02:29:26 +0000 (03:29 +0100)]
mnt: simplify mountPt

6 years agocmdline: add tmp mounts after parsing of cmdline as tmpfs_size can be specified after -T
Robert Swiecki [Tue, 20 Feb 2018 20:03:22 +0000 (21:03 +0100)]
cmdline: add tmp mounts after parsing of cmdline as tmpfs_size can be specified after -T

6 years agomnt: simpler describeMountPt
Robert Swiecki [Tue, 20 Feb 2018 15:03:32 +0000 (16:03 +0100)]
mnt: simpler describeMountPt

6 years agoconfigs/ - typo
Robert Swiecki [Tue, 20 Feb 2018 14:54:28 +0000 (15:54 +0100)]
configs/ - typo

6 years agoutil: simplify string splitting
Robert Swiecki [Tue, 20 Feb 2018 13:16:28 +0000 (14:16 +0100)]
util: simplify string splitting

6 years agocompare behaves like strcmp with results
Robert Swiecki [Mon, 19 Feb 2018 16:41:37 +0000 (17:41 +0100)]
compare behaves like strcmp with results

6 years agostrcmp -> std::string::compare
Robert Swiecki [Sun, 18 Feb 2018 13:37:33 +0000 (14:37 +0100)]
strcmp -> std::string::compare

6 years agocmdline: remove tmpfs_size from nsjconf_t
Robert Swiecki [Sun, 18 Feb 2018 01:47:46 +0000 (02:47 +0100)]
cmdline: remove tmpfs_size from nsjconf_t

6 years agoMakefile: require all for depend
Robert Swiecki [Sat, 17 Feb 2018 14:28:13 +0000 (15:28 +0100)]
Makefile: require all for depend

6 years agomake indent depend
Robert Swiecki [Sat, 17 Feb 2018 14:27:27 +0000 (15:27 +0100)]
make indent depend

6 years agoutil: remove file only of O_CREAT was specified
Robert Swiecki [Sat, 17 Feb 2018 14:27:00 +0000 (15:27 +0100)]
util: remove file only of O_CREAT was specified

6 years agocaps: use standard CAP_TO_INDEX/CAP_TO_MASK
Robert Swiecki [Sat, 17 Feb 2018 02:28:10 +0000 (03:28 +0100)]
caps: use standard CAP_TO_INDEX/CAP_TO_MASK

6 years agocmdline: create specific funcs for argv and mnt setups
Robert Swiecki [Sat, 17 Feb 2018 02:14:54 +0000 (03:14 +0100)]
cmdline: create specific funcs for argv and mnt setups

6 years agocaps: simplify dbgmsg generation
Robert Swiecki [Fri, 16 Feb 2018 16:03:05 +0000 (17:03 +0100)]
caps: simplify dbgmsg generation

6 years agocmdline: simpler unique_ptr construction 2.5
Robert Swiecki [Fri, 16 Feb 2018 15:05:26 +0000 (16:05 +0100)]
cmdline: simpler unique_ptr construction

6 years agoMakefile: warn about missing libnl-route-3
Robert Swiecki [Fri, 16 Feb 2018 14:57:41 +0000 (15:57 +0100)]
Makefile: warn about missing libnl-route-3

6 years agomake it compile under c++11 (e.g. ubuntu trusty)
Robert Swiecki [Fri, 16 Feb 2018 14:43:03 +0000 (15:43 +0100)]
make it compile under c++11 (e.g. ubuntu trusty)

6 years agosandbox: missing include
Robert Swiecki [Fri, 16 Feb 2018 14:24:24 +0000 (15:24 +0100)]
sandbox: missing include

6 years agoMerge branch 'master' of github.com:google/nsjail
Robert Swiecki [Fri, 16 Feb 2018 14:23:14 +0000 (15:23 +0100)]
Merge branch 'master' of github.com:google/nsjail

6 years agocmdline: use standard strto*
Robert Swiecki [Fri, 16 Feb 2018 14:23:02 +0000 (15:23 +0100)]
cmdline: use standard strto*

6 years agoMerge branch 'master' of ssh://github.com/google/nsjail
Robert Swiecki [Thu, 15 Feb 2018 00:33:41 +0000 (01:33 +0100)]
Merge branch 'master' of ssh://github.com/google/nsjail

6 years agonsjail: ignore SIGTTIN/SIGTTOU
Robert Swiecki [Thu, 15 Feb 2018 00:33:33 +0000 (01:33 +0100)]
nsjail: ignore SIGTTIN/SIGTTOU

6 years agouts: simplify sethostname
Robert Swiecki [Wed, 14 Feb 2018 15:38:36 +0000 (16:38 +0100)]
uts: simplify sethostname

6 years agocgroup: convert some const char* to std::string
Robert Swiecki [Tue, 13 Feb 2018 16:30:33 +0000 (17:30 +0100)]
cgroup: convert some const char* to std::string

6 years agoMakefile: check for existence of pkg-config
Robert Swiecki [Tue, 13 Feb 2018 16:12:55 +0000 (17:12 +0100)]
Makefile: check for existence of pkg-config

6 years agoMakefile: make some targets .PHONY
Robert Swiecki [Tue, 13 Feb 2018 16:09:31 +0000 (17:09 +0100)]
Makefile: make some targets .PHONY

6 years agorename ARRAYSIZE to ARR_SZ due to clash with protobufs headers
Robert Swiecki [Tue, 13 Feb 2018 15:53:45 +0000 (16:53 +0100)]
rename ARRAYSIZE to ARR_SZ due to clash with protobufs headers

6 years agomacros.h: surround ARRAYSIZE by guards
Robert Swiecki [Mon, 12 Feb 2018 21:39:42 +0000 (22:39 +0100)]
macros.h: surround ARRAYSIZE by guards

6 years agocmdline: correctly assign argv to nsjconf->argv
Robert Swiecki [Mon, 12 Feb 2018 16:31:45 +0000 (17:31 +0100)]
cmdline: correctly assign argv to nsjconf->argv

6 years agonsjail: free seccomp filter upon nsjail exit
Robert Swiecki [Mon, 12 Feb 2018 16:09:45 +0000 (17:09 +0100)]
nsjail: free seccomp filter upon nsjail exit

6 years agoconvert exec file and argv to string/vector
Robert Swiecki [Mon, 12 Feb 2018 15:52:05 +0000 (16:52 +0100)]
convert exec file and argv to string/vector

6 years agoutil: int -> size_t
Robert Swiecki [Mon, 12 Feb 2018 15:28:45 +0000 (16:28 +0100)]
util: int -> size_t

6 years agoswitc all == false cmps to !
Robert Swiecki [Mon, 12 Feb 2018 14:17:33 +0000 (15:17 +0100)]
switc all == false cmps to !

6 years agoconfig: remove unnecessary c_str()
Robert Swiecki [Mon, 12 Feb 2018 03:21:35 +0000 (04:21 +0100)]
config: remove unnecessary c_str()

6 years agologs: simplify timestr
Robert Swiecki [Mon, 12 Feb 2018 02:29:25 +0000 (03:29 +0100)]
logs: simplify timestr

6 years agomove sandboxing setup from cmdline to nsjail
Robert Swiecki [Mon, 12 Feb 2018 02:11:58 +0000 (03:11 +0100)]
move sandboxing setup from cmdline to nsjail

6 years agosandbox: policy levels
Robert Swiecki [Mon, 12 Feb 2018 02:06:28 +0000 (03:06 +0100)]
sandbox: policy levels

6 years agosandbox: simplify policy parsing
Robert Swiecki [Mon, 12 Feb 2018 02:05:21 +0000 (03:05 +0100)]
sandbox: simplify policy parsing

6 years agomnt: strtol -> std::strtol
Robert Swiecki [Sun, 11 Feb 2018 22:53:03 +0000 (23:53 +0100)]
mnt: strtol -> std::strtol

6 years agomnt: move mnt_t to std::string
Robert Swiecki [Sun, 11 Feb 2018 22:44:43 +0000 (23:44 +0100)]
mnt: move mnt_t to std::string

6 years agocmdline: missing TEMP_FAILURE_RETRY
Robert Swiecki [Sun, 11 Feb 2018 15:55:19 +0000 (16:55 +0100)]
cmdline: missing TEMP_FAILURE_RETRY

6 years agocmdline: allow to mount arbitrary FSes with -m
Robert Swiecki [Sun, 11 Feb 2018 14:07:24 +0000 (15:07 +0100)]
cmdline: allow to mount arbitrary FSes with -m

6 years agocmdline: simplify string splitting
Robert Swiecki [Sun, 11 Feb 2018 13:56:30 +0000 (14:56 +0100)]
cmdline: simplify string splitting

6 years agomake indent depend
Robert Swiecki [Sun, 11 Feb 2018 03:02:43 +0000 (04:02 +0100)]
make indent depend

6 years agouser: simplify creation of uid/gid maps
Robert Swiecki [Sun, 11 Feb 2018 03:02:14 +0000 (04:02 +0100)]
user: simplify creation of uid/gid maps

6 years agocgroup: switch const char* to std::string
Robert Swiecki [Sun, 11 Feb 2018 02:39:07 +0000 (03:39 +0100)]
cgroup: switch const char* to std::string

6 years agomnt: convert describeMountPt from const char* to std::string
Robert Swiecki [Sat, 10 Feb 2018 23:24:43 +0000 (00:24 +0100)]
mnt: convert describeMountPt from const char* to std::string

6 years agonet: convert net::connToText to std::string
Robert Swiecki [Sat, 10 Feb 2018 23:17:44 +0000 (00:17 +0100)]
net: convert net::connToText to std::string

6 years agoutil: remove unused functions
Robert Swiecki [Sat, 10 Feb 2018 22:54:36 +0000 (23:54 +0100)]
util: remove unused functions

6 years agosandbox: convert kafel file/string as std::string
Robert Swiecki [Sat, 10 Feb 2018 22:46:15 +0000 (23:46 +0100)]
sandbox: convert kafel file/string as std::string

6 years agoconvert some funcs returning pointers to to TLS to std::string
Robert Swiecki [Sat, 10 Feb 2018 20:19:47 +0000 (21:19 +0100)]
convert some funcs returning pointers to to TLS to std::string

6 years agochange global vars to _ prefix
Robert Swiecki [Sat, 10 Feb 2018 19:32:04 +0000 (20:32 +0100)]
change global vars to _ prefix

6 years agoconvert proc_path to std::string
Robert Swiecki [Sat, 10 Feb 2018 19:16:17 +0000 (20:16 +0100)]
convert proc_path to std::string

6 years agoconfig: rename macro
Robert Swiecki [Sat, 10 Feb 2018 17:27:24 +0000 (18:27 +0100)]
config: rename macro

6 years agonsjail: iface_no_lo -> iface_lo
Robert Swiecki [Sat, 10 Feb 2018 17:22:51 +0000 (18:22 +0100)]
nsjail: iface_no_lo -> iface_lo

6 years agonet: move all iface_vs* options from char* to std::string
Robert Swiecki [Sat, 10 Feb 2018 17:18:40 +0000 (18:18 +0100)]
net: move all iface_vs* options from char* to std::string

6 years agolog: rename log to logs due to clash with glibc's log
Robert Swiecki [Sat, 10 Feb 2018 16:49:15 +0000 (17:49 +0100)]
log: rename log to logs due to clash with glibc's log

6 years agouser: remove unnecessary structs
Robert Swiecki [Sat, 10 Feb 2018 14:51:47 +0000 (15:51 +0100)]
user: remove unnecessary structs

6 years agoomit keyword 'struct'
Robert Swiecki [Sat, 10 Feb 2018 14:50:12 +0000 (15:50 +0100)]
omit keyword 'struct'

6 years agomake depend
Robert Swiecki [Sat, 10 Feb 2018 14:44:42 +0000 (15:44 +0100)]
make depend

6 years agomnt: replace sys/queue with std::vector
Robert Swiecki [Sat, 10 Feb 2018 13:38:01 +0000 (14:38 +0100)]
mnt: replace sys/queue with std::vector

6 years agomove common.h to macros.h
Robert Swiecki [Sat, 10 Feb 2018 04:25:55 +0000 (05:25 +0100)]
move common.h to macros.h

6 years agonsjail: move pids queue to a vector
Robert Swiecki [Sat, 10 Feb 2018 04:13:25 +0000 (05:13 +0100)]
nsjail: move pids queue to a vector

6 years agolog: open log file in cloexec mode
Robert Swiecki [Sat, 10 Feb 2018 03:13:39 +0000 (04:13 +0100)]
log: open log file in cloexec mode

6 years agonsjail: convert a couple of struct fields to std::string
Robert Swiecki [Sat, 10 Feb 2018 03:10:18 +0000 (04:10 +0100)]
nsjail: convert a couple of struct fields to std::string

6 years agonsjail: convert gids/uids to vector of structs
Robert Swiecki [Fri, 9 Feb 2018 23:37:23 +0000 (00:37 +0100)]
nsjail: convert gids/uids to vector of structs

6 years agonsjail: envs to vector of strings
Robert Swiecki [Fri, 9 Feb 2018 22:04:57 +0000 (23:04 +0100)]
nsjail: envs to vector of strings

6 years agonsjail: move openfd from queue to vector
Robert Swiecki [Fri, 9 Feb 2018 21:47:00 +0000 (22:47 +0100)]
nsjail: move openfd from queue to vector

6 years agonsjail: convert caps from queue to vector
Robert Swiecki [Fri, 9 Feb 2018 21:35:33 +0000 (22:35 +0100)]
nsjail: convert caps from queue to vector

6 years agonet: faster struct cleaning
Robert Swiecki [Fri, 9 Feb 2018 18:12:48 +0000 (19:12 +0100)]
net: faster struct cleaning

6 years agolog: use __PRETTY_FUNCTION__ instead of __func__
Robert Swiecki [Fri, 9 Feb 2018 18:07:29 +0000 (19:07 +0100)]
log: use __PRETTY_FUNCTION__ instead of __func__

6 years agoMakefile: remove C'isms
Robert Swiecki [Fri, 9 Feb 2018 17:57:31 +0000 (18:57 +0100)]
Makefile: remove C'isms

6 years agomake indent
Robert Swiecki [Fri, 9 Feb 2018 17:56:04 +0000 (18:56 +0100)]
make indent

6 years agoall: move to C++
Robert Swiecki [Fri, 9 Feb 2018 17:55:42 +0000 (18:55 +0100)]
all: move to C++

6 years agoutil: move to C++
Robert Swiecki [Fri, 9 Feb 2018 17:45:50 +0000 (18:45 +0100)]
util: move to C++

6 years agomount: move to C++
Robert Swiecki [Fri, 9 Feb 2018 17:26:16 +0000 (18:26 +0100)]
mount: move to C++

6 years agocgroup: move to C++
Robert Swiecki [Fri, 9 Feb 2018 17:13:17 +0000 (18:13 +0100)]
cgroup: move to C++

6 years agouser: move to C++
Robert Swiecki [Fri, 9 Feb 2018 17:08:11 +0000 (18:08 +0100)]
user: move to C++

6 years agouts: move to C++
Robert Swiecki [Fri, 9 Feb 2018 16:59:51 +0000 (17:59 +0100)]
uts: move to C++

6 years agopid: move to C++
Robert Swiecki [Fri, 9 Feb 2018 16:57:19 +0000 (17:57 +0100)]
pid: move to C++

6 years agocaps: move to C++
Robert Swiecki [Fri, 9 Feb 2018 16:49:13 +0000 (17:49 +0100)]
caps: move to C++

6 years agocpu: move to C++
Robert Swiecki [Fri, 9 Feb 2018 16:41:16 +0000 (17:41 +0100)]
cpu: move to C++

6 years agonet: move to C++
Robert Swiecki [Fri, 9 Feb 2018 16:27:28 +0000 (17:27 +0100)]
net: move to C++

6 years agosandbox: move to C++
Robert Swiecki [Fri, 9 Feb 2018 16:16:41 +0000 (17:16 +0100)]
sandbox: move to C++

6 years agocontain: move to C++
Robert Swiecki [Fri, 9 Feb 2018 16:09:58 +0000 (17:09 +0100)]
contain: move to C++

6 years agosubproc: move to C++
Robert Swiecki [Fri, 9 Feb 2018 16:03:02 +0000 (17:03 +0100)]
subproc: move to C++

6 years agocmdline: move to C++
Robert Swiecki [Fri, 9 Feb 2018 14:44:29 +0000 (15:44 +0100)]
cmdline: move to C++

6 years agonsjail: make nsjail.c nsjail.cc
Robert Swiecki [Thu, 8 Feb 2018 14:24:17 +0000 (15:24 +0100)]
nsjail: make nsjail.c nsjail.cc

6 years agoMerge branch 'master' of github.com:google/nsjail
Robert Swiecki [Thu, 8 Feb 2018 14:23:26 +0000 (15:23 +0100)]
Merge branch 'master' of github.com:google/nsjail

6 years agoAdd missing O_RDONLY here and there
Robert Swiecki [Thu, 8 Feb 2018 14:23:15 +0000 (15:23 +0100)]
Add missing O_RDONLY here and there

6 years agocgroup: set cpu period as well
Robert Swiecki [Sun, 4 Feb 2018 03:23:45 +0000 (04:23 +0100)]
cgroup: set cpu period as well

6 years agocgroups: add support for CPU cgroup
Robert Swiecki [Sun, 4 Feb 2018 03:15:19 +0000 (04:15 +0100)]
cgroups: add support for CPU cgroup

6 years agosandbox: compile seccomp-bpf policy once only
Robert Swiecki [Thu, 1 Feb 2018 13:19:01 +0000 (14:19 +0100)]
sandbox: compile seccomp-bpf policy once only

6 years agoopen kafel file in each kafel subproc individually to avoid file pos sharing
Robert Swiecki [Wed, 31 Jan 2018 15:04:39 +0000 (16:04 +0100)]
open kafel file in each kafel subproc individually to avoid file pos sharing

6 years agorewind kafel file before using 2.4
Robert Swiecki [Wed, 31 Jan 2018 13:40:23 +0000 (14:40 +0100)]
rewind kafel file before using

6 years agoMerge pull request #72 from rutsky/fix_tmpfs_size
robertswiecki [Mon, 8 Jan 2018 01:50:30 +0000 (02:50 +0100)]
Merge pull request #72 from rutsky/fix_tmpfs_size

fix tmpfs size setting

6 years agofix tmpfs size setting
Vladimir Rutsky [Mon, 8 Jan 2018 00:36:12 +0000 (01:36 +0100)]
fix tmpfs size setting

Broken since c35857cff2c commit.

Signed-off-by: Vladimir Rutsky <rutsky@google.com>