platform/upstream/nsjail.git
9 years agoMake nsjconf initialization from const struct 1.1
Jagger [Wed, 2 Mar 2016 01:35:38 +0000 (02:35 +0100)]
Make nsjconf initialization from const struct

9 years agoSupport for --chroot ""
Jagger [Wed, 2 Mar 2016 01:30:30 +0000 (02:30 +0100)]
Support for --chroot ""

9 years agoFix common.h includes
Robert Swiecki [Tue, 1 Mar 2016 16:03:11 +0000 (17:03 +0100)]
Fix common.h includes

9 years agoComment on statvfs
Robert Swiecki [Tue, 1 Mar 2016 15:01:39 +0000 (16:01 +0100)]
Comment on statvfs

9 years agoTypo
Robert Swiecki [Tue, 1 Mar 2016 14:38:58 +0000 (15:38 +0100)]
Typo

9 years agoAdd locked mount flags during remounting
Robert Swiecki [Tue, 1 Mar 2016 14:36:32 +0000 (15:36 +0100)]
Add locked mount flags during remounting

9 years agoMore specific error message for EACCES during mount()
Robert Swiecki [Tue, 1 Mar 2016 14:02:33 +0000 (15:02 +0100)]
More specific error message for EACCES during mount()

9 years agoBetter rtnl_link_name2i() error message
Jagger [Mon, 29 Feb 2016 22:13:03 +0000 (23:13 +0100)]
Better rtnl_link_name2i() error message

9 years agoMissing check for nsjconf->iface
Jagger [Mon, 29 Feb 2016 22:10:14 +0000 (23:10 +0100)]
Missing check for nsjconf->iface

9 years agoMake valgrind silent
Jagger [Mon, 29 Feb 2016 21:22:03 +0000 (22:22 +0100)]
Make valgrind silent

9 years agoSkip type for macvlan in nl3
Jagger [Mon, 29 Feb 2016 21:18:57 +0000 (22:18 +0100)]
Skip type for macvlan in nl3

9 years agoUse NL3 for macvlan if present
Jagger [Mon, 29 Feb 2016 21:12:01 +0000 (22:12 +0100)]
Use NL3 for macvlan if present

9 years agoBetter cmdline descriptions
Robert Swiecki [Mon, 29 Feb 2016 19:20:38 +0000 (20:20 +0100)]
Better cmdline descriptions

9 years agoMake it possible to compile with clang
Robert Swiecki [Mon, 29 Feb 2016 18:09:39 +0000 (19:09 +0100)]
Make it possible to compile with clang

9 years agoIndent/Depend
Robert Swiecki [Mon, 29 Feb 2016 17:56:52 +0000 (18:56 +0100)]
Indent/Depend

9 years agoCreate 'vs' and put it into NS in one command
Robert Swiecki [Mon, 29 Feb 2016 16:59:49 +0000 (17:59 +0100)]
Create 'vs' and put it into NS in one command

9 years agoMissing 'name' in /sbin/ip macvlan
Robert Swiecki [Mon, 29 Feb 2016 16:56:03 +0000 (17:56 +0100)]
Missing 'name' in /sbin/ip macvlan

9 years agoDon't initialize the 'vs' interface by default
Robert Swiecki [Mon, 29 Feb 2016 16:50:25 +0000 (17:50 +0100)]
Don't initialize the 'vs' interface by default

9 years agoChange macvtap into macvlan mode bridge
Robert Swiecki [Mon, 29 Feb 2016 16:46:36 +0000 (17:46 +0100)]
Change macvtap into macvlan mode bridge

9 years agoAdd child only after successful clone()
Robert Swiecki [Mon, 29 Feb 2016 15:09:08 +0000 (16:09 +0100)]
Add child only after successful clone()

9 years agoBetter description for --user / --group
Robert Swiecki [Mon, 29 Feb 2016 14:47:33 +0000 (15:47 +0100)]
Better description for --user / --group

9 years agoDefault values for 'vs' interface
Robert Swiecki [Mon, 29 Feb 2016 14:36:31 +0000 (15:36 +0100)]
Default values for 'vs' interface

9 years agoDefault net values for 'vs'
Jagger [Mon, 29 Feb 2016 01:59:59 +0000 (02:59 +0100)]
Default net values for 'vs'

9 years agoAdd network configuration for the 'vs' interface
Jagger [Mon, 29 Feb 2016 01:51:55 +0000 (02:51 +0100)]
Add network configuration for the 'vs' interface

9 years agoCheck for WIFSTOPPED/WIFCONTINUED with wait4
Jagger [Sun, 28 Feb 2016 23:32:14 +0000 (00:32 +0100)]
Check for WIFSTOPPED/WIFCONTINUED with wait4

9 years agoAdd --iface_lo_up
Jagger [Sun, 28 Feb 2016 23:14:36 +0000 (00:14 +0100)]
Add --iface_lo_up

9 years agoImplementation of netSystemSbinIp
Jagger [Sun, 28 Feb 2016 22:40:34 +0000 (23:40 +0100)]
Implementation of netSystemSbinIp

9 years agoSet-up parent in a separate function
Jagger [Sun, 28 Feb 2016 22:23:24 +0000 (23:23 +0100)]
Set-up parent in a separate function

9 years agoAlways put macvtap as virt.ns
Jagger [Sun, 28 Feb 2016 15:52:37 +0000 (16:52 +0100)]
Always put macvtap as virt.ns

9 years agoReturn early in case of problems with set-up of the child from parent
Jagger [Sun, 28 Feb 2016 15:43:35 +0000 (16:43 +0100)]
Return early in case of problems with set-up of the child from parent

9 years agoCorrect write() check
Jagger [Sun, 28 Feb 2016 15:38:10 +0000 (16:38 +0100)]
Correct write() check

9 years agoNo need to update /proc/pid/setgroups if euid==0
Jagger [Sun, 28 Feb 2016 01:41:57 +0000 (02:41 +0100)]
No need to update /proc/pid/setgroups if euid==0

9 years agoInitialize user/group maps from the parent process
Jagger [Sun, 28 Feb 2016 01:35:22 +0000 (02:35 +0100)]
Initialize user/group maps from the parent process

9 years agoInitialize user/group maps from the parent process
Jagger [Sun, 28 Feb 2016 01:34:43 +0000 (02:34 +0100)]
Initialize user/group maps from the parent process

9 years agoRemove debugging code
Jagger [Sun, 28 Feb 2016 01:15:36 +0000 (02:15 +0100)]
Remove debugging code

9 years agoNo need to add (default:none) in cmdline
Jagger [Sun, 28 Feb 2016 00:52:09 +0000 (01:52 +0100)]
No need to add (default:none) in cmdline

9 years agoAutomatically create destination dir for 'proc' and 'tmpfs' mounts
Robert Swiecki [Thu, 25 Feb 2016 17:45:23 +0000 (18:45 +0100)]
Automatically create destination dir for 'proc' and 'tmpfs' mounts

9 years agoImplement --bindhost
Robert Swiecki [Thu, 25 Feb 2016 17:27:48 +0000 (18:27 +0100)]
Implement --bindhost

9 years agoAdd MS_REC to MS_RDONLY
Robert Swiecki [Thu, 25 Feb 2016 17:27:42 +0000 (18:27 +0100)]
Add MS_REC to MS_RDONLY

9 years agoRemove (disable: false) from cmdline.c as it's obvious
Robert Swiecki [Tue, 16 Feb 2016 17:56:52 +0000 (18:56 +0100)]
Remove (disable: false) from cmdline.c as it's obvious

9 years agoEnv variables (setting/clearing)
Robert Swiecki [Tue, 26 Jan 2016 16:42:10 +0000 (17:42 +0100)]
Env variables (setting/clearing)

9 years agoDefault re-chroot to '/'
Jagger [Mon, 25 Jan 2016 21:27:06 +0000 (22:27 +0100)]
Default re-chroot to '/'

9 years agoImplement --skip_setsid
Robert Swiecki [Mon, 25 Jan 2016 17:09:32 +0000 (18:09 +0100)]
Implement --skip_setsid

9 years agoUse --user x:y notation (not working yet)
Jagger [Sat, 23 Jan 2016 06:05:24 +0000 (07:05 +0100)]
Use --user x:y notation (not working yet)

9 years agoUse %#x instead of %u
Jagger [Thu, 21 Jan 2016 23:50:45 +0000 (00:50 +0100)]
Use %#x instead of %u

9 years agoRemove _FORTIFY_SOURCE=2
Jagger [Thu, 21 Jan 2016 23:11:31 +0000 (00:11 +0100)]
Remove _FORTIFY_SOURCE=2

9 years agoMerge pull request #4 from q3k/master
robertswiecki [Wed, 20 Jan 2016 19:23:02 +0000 (20:23 +0100)]
Merge pull request #4 from q3k/master

Move definition of _FORTIFY_SOURCE to nsjail.h

9 years agoMove definition of _FORTIFY_SOURCE to nsjail.h
Sergiusz 'q3k' Bazański [Wed, 20 Jan 2016 19:21:27 +0000 (20:21 +0100)]
Move definition of _FORTIFY_SOURCE to nsjail.h

This lets us undefine any built-in gcc macro. Otherwise, a redefinition
from the command line occurs and a warning is thrown, breaking the build
(due to -Werror).

9 years agoNo need to include log.h in util.h
Robert Swiecki [Wed, 20 Jan 2016 17:05:42 +0000 (18:05 +0100)]
No need to include log.h in util.h

9 years agocorrect guard macro comment
Robert Swiecki [Wed, 20 Jan 2016 17:00:13 +0000 (18:00 +0100)]
correct guard macro comment

9 years agoMissing util.*
Robert Swiecki [Wed, 20 Jan 2016 16:55:40 +0000 (17:55 +0100)]
Missing util.*

9 years agoIntroduce util.c
Jagger [Sun, 17 Jan 2016 03:14:09 +0000 (04:14 +0100)]
Introduce util.c

9 years agoCreate a file/dir inside jail beforemounting
Robert Swiecki [Thu, 14 Jan 2016 14:44:29 +0000 (15:44 +0100)]
Create a file/dir inside jail beforemounting

9 years agoAdd --cmd
Robert Swiecki [Thu, 14 Jan 2016 14:26:18 +0000 (15:26 +0100)]
Add --cmd

9 years agoRevert of .chroot = NULL
Jagger [Sat, 9 Jan 2016 15:11:31 +0000 (16:11 +0100)]
Revert of .chroot = NULL

9 years agoUse TAILQ instead of LIST to insert new mount entries at the end
Jagger [Sat, 9 Jan 2016 15:09:05 +0000 (16:09 +0100)]
Use TAILQ instead of LIST to insert new mount entries at the end

9 years agoSet a separate session/process_group
Robert Swiecki [Tue, 24 Nov 2015 17:34:05 +0000 (18:34 +0100)]
Set a separate session/process_group

9 years agoCorrectly cast arguments to syscall()
Robert Swiecki [Thu, 19 Nov 2015 14:04:34 +0000 (15:04 +0100)]
Correctly cast arguments to syscall()

9 years agoMerge pull request #3 from JamyDev/master
robertswiecki [Sat, 7 Nov 2015 14:03:28 +0000 (15:03 +0100)]
Merge pull request #3 from JamyDev/master

Add `cwd` option to define what folder in the jail the process should start in.

9 years agoUpdate readme with cwd property
Jamy Timmermans [Sat, 7 Nov 2015 12:33:50 +0000 (13:33 +0100)]
Update readme with cwd property

9 years agoFix dereference in cwd option
Jamy Timmermans [Sat, 7 Nov 2015 12:11:55 +0000 (06:11 -0600)]
Fix dereference in cwd option

9 years agoAdd a `cwd` option
Jamy Timmermans [Sat, 7 Nov 2015 12:01:44 +0000 (13:01 +0100)]
Add a `cwd` option

This way the process being spawned can be in a directory if the
spawner’s choosing (as ling as it’s available in the chroot)

9 years agoMake it compile with -m32
Jagger [Sun, 18 Oct 2015 18:47:44 +0000 (20:47 +0200)]
Make it compile with -m32

9 years agoMake __user_cap_data_struct const
Jagger [Sun, 18 Oct 2015 18:39:06 +0000 (20:39 +0200)]
Make __user_cap_data_struct const

9 years agoUse 0x%tx for uintptr_t
Jagger [Sat, 17 Oct 2015 17:14:57 +0000 (19:14 +0200)]
Use 0x%tx for uintptr_t

9 years agoMove LOG_I earlier in subproc.c
Jagger [Sat, 17 Oct 2015 17:11:48 +0000 (19:11 +0200)]
Move LOG_I earlier in subproc.c

9 years agoUse just a single list for mount-points (RO, RW, chroot)
Jagger [Sat, 17 Oct 2015 14:48:30 +0000 (16:48 +0200)]
Use just a single list for mount-points (RO, RW, chroot)

9 years ago__FUNCTION__ -> __func__ as C99 standard
Jagger [Sat, 17 Oct 2015 01:51:35 +0000 (03:51 +0200)]
__FUNCTION__ -> __func__ as C99 standard

9 years agoUse rlimit64
Robert Swiecki [Tue, 13 Oct 2015 17:06:49 +0000 (19:06 +0200)]
Use rlimit64

9 years agoIn case there's no CLONE_NEWNS, just chroot()
Jagger [Sun, 16 Aug 2015 08:55:14 +0000 (10:55 +0200)]
In case there's no CLONE_NEWNS, just chroot()

9 years agoMake --disable_proc work
Jagger [Sat, 15 Aug 2015 18:48:48 +0000 (20:48 +0200)]
Make --disable_proc work

9 years agoindent 100
Jagger [Sat, 15 Aug 2015 18:10:07 +0000 (20:10 +0200)]
indent 100

9 years agoreadme typo
Jagger [Sat, 15 Aug 2015 14:20:48 +0000 (16:20 +0200)]
readme typo

9 years agoFixed flag description for --log
Jagger [Sat, 15 Aug 2015 14:05:57 +0000 (16:05 +0200)]
Fixed flag description for --log

9 years agoImplementation of MODE_STANDALONE_EXECVE
Jagger [Sat, 15 Aug 2015 14:02:38 +0000 (16:02 +0200)]
Implementation of MODE_STANDALONE_EXECVE

9 years agoBetter logging for clone failure 1.0
Jagger [Wed, 12 Aug 2015 02:32:34 +0000 (04:32 +0200)]
Better logging for clone failure

9 years agoUse 'R' as an alias for bindmount_ro
Jagger [Wed, 12 Aug 2015 02:27:57 +0000 (04:27 +0200)]
Use 'R' as an alias for bindmount_ro

9 years agoMore verbose error messages for mounting files/dirs
Jagger [Tue, 11 Aug 2015 23:17:54 +0000 (01:17 +0200)]
More verbose error messages for mounting files/dirs

9 years agoMove tmpfs mounting before pivot_chroot
Jagger [Tue, 11 Aug 2015 22:58:26 +0000 (00:58 +0200)]
Move tmpfs mounting before pivot_chroot

9 years agoCreate a file for sockets/devs/files bind mounts
Jagger [Tue, 11 Aug 2015 12:34:17 +0000 (14:34 +0200)]
Create a file for sockets/devs/files bind mounts

9 years agoChecks for strdup() result. Use remountBindMount since we have it
Jagger [Wed, 15 Jul 2015 01:33:13 +0000 (03:33 +0200)]
Checks for strdup() result. Use remountBindMount since we have it

9 years agoMerge pull request #2 from jtolds/master
robertswiecki [Tue, 14 Jul 2015 20:11:18 +0000 (22:11 +0200)]
Merge pull request #2 from jtolds/master

Typo fix

9 years agoTypo fix
JT Olds [Mon, 13 Jul 2015 22:36:53 +0000 (16:36 -0600)]
Typo fix

9 years agotmpfs_size (size_t) + indent
Jagger [Tue, 7 Jul 2015 22:54:59 +0000 (00:54 +0200)]
tmpfs_size (size_t) + indent

9 years agoMerge pull request #1 from jtolds/master
robertswiecki [Tue, 7 Jul 2015 21:43:56 +0000 (23:43 +0200)]
Merge pull request #1 from jtolds/master

A collection of small changes (need feedback)

9 years agoMake tmpfs size configurable
JT Olds [Tue, 7 Jul 2015 20:17:44 +0000 (14:17 -0600)]
Make tmpfs size configurable

9 years agoReturn failing exit status on timeout
JT Olds [Tue, 7 Jul 2015 20:08:54 +0000 (14:08 -0600)]
Return failing exit status on timeout

9 years agoDon't mount NODEV so stuff like /dev/null works
JT Olds [Tue, 7 Jul 2015 20:08:03 +0000 (14:08 -0600)]
Don't mount NODEV so stuff like /dev/null works

Users now need to be careful about allowing device special files
in the jail.

9 years agoupdate readme
JT Olds [Tue, 7 Jul 2015 17:54:36 +0000 (11:54 -0600)]
update readme

9 years agoImprove bindmount interface.
JT Olds [Tue, 7 Jul 2015 17:15:37 +0000 (11:15 -0600)]
Improve bindmount interface.

Now supports readonly bindmounts and
differentiating between source and target path.

9 years agoReturn child exit status in standalone mode
JT Olds [Tue, 7 Jul 2015 16:33:10 +0000 (10:33 -0600)]
Return child exit status in standalone mode

9 years agoRemove unused struct definition
Robert Swiecki [Fri, 19 Jun 2015 14:35:02 +0000 (16:35 +0200)]
Remove unused struct definition

9 years agoIndent
Jagger [Thu, 18 Jun 2015 01:07:22 +0000 (03:07 +0200)]
Indent

9 years agoReplace self-made list of pointers with queue.h
Jagger [Thu, 18 Jun 2015 01:00:39 +0000 (03:00 +0200)]
Replace self-made list of pointers with queue.h

9 years agoInitialize nsjconf structure in the commandline module:
Robert Swiecki [Wed, 17 Jun 2015 14:52:51 +0000 (16:52 +0200)]
Initialize nsjconf structure in the commandline module:

10 years agoA crude way of cloning an eth interface
Jagger [Thu, 28 May 2015 01:37:08 +0000 (03:37 +0200)]
A crude way of cloning an eth interface

10 years ago+ .gitignore
Robert Swiecki [Wed, 27 May 2015 15:51:01 +0000 (17:51 +0200)]
+ .gitignore

10 years agoClose pipefd[1] before reading from pipefd[0]
Robert Swiecki [Wed, 27 May 2015 13:41:08 +0000 (15:41 +0200)]
Close pipefd[1] before reading from pipefd[0]

10 years agoDefine PR_SET_NO_NEW_PRIVS for older glibc-s
Robert Swiecki [Fri, 22 May 2015 12:31:08 +0000 (14:31 +0200)]
Define PR_SET_NO_NEW_PRIVS for older glibc-s

10 years agoMore instructive error message
Robert Swiecki [Thu, 21 May 2015 16:40:15 +0000 (18:40 +0200)]
More instructive error message