[PATCH v6 0/7] util-linux: namespace utils
Bartosz Golaszewski
bartekgola at gmail.com
Thu Mar 17 14:52:22 UTC 2016
This series adds two namespaces-related applets reimplementing most
arguments supported by their upstream util-linux counterparts.
The sixth patch is an optional code shrink.
The last patch isn't connected to the namespace utils, but makes use
of the xfchdir() function introduced by patch 4/7.
v6:
- added a patch implementing xfchdir()
- shrunk the nsenter code a bit by using libbb xfuncs instead of
manual return code checking for chdir(), fchdir() and chroot()
v5:
- fixed the include guard in namespace.h to make it consistent with the
rest of the codebase
- added a separate patch implementing a macro for calculating the
string buffer size needed to store an integer type and used it in
the new applets
v4:
- split the namespace structure into the read-only and modifiable
parts
- made the read-only definition const and moved it out of the main
function in both applets
- moved the position indicators to an enum and replaced all the
ARRAY_SIZE() macros with NS_COUNT constant defined there
- fixed some whitespace errors
v3:
- moved the namespace positions into an enum for better readability
v2:
- v1 was badly rebased and patch 3/4 didn't compile - fixed it
- added some parenthesis for better readability in patch 3/4
v1: http://lists.busybox.net/pipermail/busybox/2016-March/083957.html
Bartosz Golaszewski (7):
libbb: add BIT() macro
libbb: INT_BUF_MAX(): new macro
unshare: new applet
libbb: xfchdir(): new function
nsenter: new applet
namespace utils: code shrink
runit: use xfchdir()
include/libbb.h | 4 +
libbb/xfuncs_printf.c | 6 +
runit/chpst.c | 3 +-
util-linux/namespace.c | 34 ++++
util-linux/namespace.h | 27 +++
util-linux/nsenter.c | 335 +++++++++++++++++++++++++++++++++++++
util-linux/unshare.c | 443 +++++++++++++++++++++++++++++++++++++++++++++++++
7 files changed, 850 insertions(+), 2 deletions(-)
create mode 100644 util-linux/namespace.c
create mode 100644 util-linux/namespace.h
create mode 100644 util-linux/nsenter.c
create mode 100644 util-linux/unshare.c
--
2.1.4
More information about the busybox
mailing list