Skip to content

Commit

Permalink
Merge branch 'master' of github.com:google/nsjail
Browse files Browse the repository at this point in the history
  • Loading branch information
robertswiecki committed Sep 2, 2019
2 parents 0773b75 + 41305fd commit 3612c2a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions cmdline.cc
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ struct custom_option custom_opts[] = {
{ { "verbose", no_argument, NULL, 'v' }, "Verbose output" },
{ { "quiet", no_argument, NULL, 'q' }, "Log warning and more important messages only" },
{ { "really_quiet", no_argument, NULL, 'Q' }, "Log fatal messages only" },
{ { "keep_env", no_argument, NULL, 'e' }, "Pass all environment variables to the child process (default: all envvars are cleared)" },
{ { "env", required_argument, NULL, 'E' }, "Additional environment variable (can be used multiple times). If the envvar doesn't contain '=' (e.g. just the 'DISPLAY' string), the current envvar value will be used" },
{ { "keep_env", no_argument, NULL, 'e' }, "Pass all environment variables to the child process (default: all envars are cleared)" },
{ { "env", required_argument, NULL, 'E' }, "Additional environment variable (can be used multiple times). If the envar doesn't contain '=' (e.g. just the 'DISPLAY' string), the current envar value will be used" },
{ { "keep_caps", no_argument, NULL, 0x0501 }, "Don't drop any capabilities" },
{ { "cap", required_argument, NULL, 0x0509 }, "Retain this capability, e.g. CAP_PTRACE (can be specified multiple times)" },
{ { "silent", no_argument, NULL, 0x0502 }, "Redirect child process' fd:0/1/2 to /dev/null" },
Expand Down Expand Up @@ -198,7 +198,7 @@ void addEnv(nsjconf_t* nsjconf, const std::string& env) {
}
char* e = getenv(env.c_str());
if (!e) {
LOG_W("Requested to use the '%s' envvar, but it's not set. It'll be ignored",
LOG_W("Requested to use the '%s' envar, but it's not set. It'll be ignored",
env.c_str());
return;
}
Expand Down
8 changes: 4 additions & 4 deletions config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ message IdMap {
message MountPt {
/* Can be skipped for filesystems like 'proc' */
optional string src = 1 [default = ""];
/* Should 'src' path be prefixed with this envvar? */
/* Should 'src' path be prefixed with this envar? */
optional string prefix_src_env = 2 [default = ""];
/* If specified, contains buffer that will be written to the dst file */
optional bytes src_content = 3 [default = ""];
/* Mount point inside jail */
required string dst = 4 [default = ""];
/* Should 'dst' path be prefixed with this envvar? */
/* Should 'dst' path be prefixed with this envar? */
optional string prefix_dst_env = 5 [default = ""];
/* Can be empty for mount --bind mounts */
optional string fstype = 6 [default = ""];
Expand Down Expand Up @@ -115,8 +115,8 @@ message NsJailConfig {
/* Should the current environment variables be kept
when executing the binary */
optional bool keep_env = 19 [default = false];
/* EnvVars to be set before executing binaries. If the envvar doesn't contain '='
(e.g. just the 'DISPLAY' string), the current envvar value will be used */
/* EnvVars to be set before executing binaries. If the envar doesn't contain '='
(e.g. just the 'DISPLAY' string), the current envar value will be used */
repeated string envar = 20;

/* Should capabilities be preserved or dropped */
Expand Down
8 changes: 4 additions & 4 deletions mnt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ static bool addMountPt(mount_t* mnt, const std::string& src, const std::string&
if (!src_env.empty()) {
const char* e = getenv(src_env.c_str());
if (e == NULL) {
LOG_W("No such envvar:'%s'", src_env.c_str());
LOG_W("No such envar:'%s'", src_env.c_str());
return false;
}
mnt->src = e;
Expand All @@ -488,7 +488,7 @@ static bool addMountPt(mount_t* mnt, const std::string& src, const std::string&
if (!dst_env.empty()) {
const char* e = getenv(dst_env.c_str());
if (e == NULL) {
LOG_W("No such envvar:'%s'", dst_env.c_str());
LOG_W("No such envar:'%s'", dst_env.c_str());
return false;
}
mnt->dst = e;
Expand Down Expand Up @@ -572,9 +572,9 @@ const std::string describeMountPt(const mount_t& mpt) {
.append("'");

if (mpt.is_dir) {
descr.append(" is_dir:true");
descr.append(" dir:true");
} else {
descr.append(" is_dir:false");
descr.append(" dir:false");
}
if (!mpt.is_mandatory) {
descr.append(" mandatory:false");
Expand Down
4 changes: 2 additions & 2 deletions nsjail.1
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ Log warning and more important messages only
Log fatal messages only
.TP
\fB\-\-keep_env\fR|\fB\-e\fR
Pass all environment variables be passed process (default: all envvars are cleared)
Pass all environment variables be passed process (default: all envars are cleared)
.TP
\fB\-\-env\fR|\fB\-E\fR VALUE
Additional environment variable (can be used multiple times). If the envvar doesn't contain '=' (e.g. just the 'DISPLAY' string), the current envvar value will be used
Additional environment variable (can be used multiple times). If the envar doesn't contain '=' (e.g. just the 'DISPLAY' string), the current envar value will be used
.TP
\fB\-\-keep_caps\fR
Don't drop any capabilities
Expand Down

0 comments on commit 3612c2a

Please sign in to comment.