From e2c5c59bd32beac7203a0d46a42df77c934ac1f2 Mon Sep 17 00:00:00 2001 From: Robert Swiecki Date: Wed, 28 Aug 2019 22:18:58 +0200 Subject: [PATCH] standardize on envar vs envvar --- cmdline.cc | 6 +++--- config.proto | 8 ++++---- mnt.cc | 4 ++-- nsjail.1 | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cmdline.cc b/cmdline.cc index fb5b08a..39795ef 100644 --- a/cmdline.cc +++ b/cmdline.cc @@ -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" }, @@ -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; } diff --git a/config.proto b/config.proto index c405017..284efa7 100644 --- a/config.proto +++ b/config.proto @@ -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 = ""]; @@ -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 */ diff --git a/mnt.cc b/mnt.cc index a4faac6..47db86d 100644 --- a/mnt.cc +++ b/mnt.cc @@ -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; @@ -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; diff --git a/nsjail.1 b/nsjail.1 index 8f42bcf..39ae23f 100644 --- a/nsjail.1 +++ b/nsjail.1 @@ -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