Rename drop-capabilities options none to off

None might be ambiguous whether we are dropping none or whether we keep
none.

Rename to off to make more clear this option does not drop any.
This commit is contained in:
Christian Göttsche 2021-03-25 14:33:27 +01:00 committed by cgzones
parent 74d061700c
commit 812cfcb94d
2 changed files with 7 additions and 7 deletions

View File

@ -64,7 +64,7 @@ requesting a sort order with -s.
\fB\-H \-\-highlight-changes=DELAY\fR
Highlight new and old processes
.TP
\fB \-\-drop-capabilities[=none|basic|strict]\fR
\fB \-\-drop-capabilities[=off|basic|strict]\fR
Linux only; requires libcap support.
.br
Drop unneeded Linux capabilities.

View File

@ -73,7 +73,7 @@ in the source distribution for its full text.
#ifdef HAVE_LIBCAP
enum CapMode {
CAP_MODE_NONE,
CAP_MODE_OFF,
CAP_MODE_BASIC,
CAP_MODE_STRICT
};
@ -855,8 +855,8 @@ void Platform_longOptionsUsage(const char* name)
{
#ifdef HAVE_LIBCAP
printf(
" --drop-capabilities[=none|basic|strict] Drop Linux capabilities when running as root\n"
" none - do not drop any capabilities\n"
" --drop-capabilities[=off|basic|strict] Drop Linux capabilities when running as root\n"
" off - do not drop any capabilities\n"
" basic (default) - drop all capabilities not needed by %s\n"
" strict - drop all capabilities except those needed for\n"
" core functionality\n", name);
@ -882,8 +882,8 @@ bool Platform_getLongOption(int opt, int argc, char** argv) {
if (!mode || String_eq(mode, "basic")) {
Platform_capabilitiesMode = CAP_MODE_BASIC;
} else if (String_eq(mode, "none")) {
Platform_capabilitiesMode = CAP_MODE_NONE;
} else if (String_eq(mode, "off")) {
Platform_capabilitiesMode = CAP_MODE_OFF;
} else if (String_eq(mode, "strict")) {
Platform_capabilitiesMode = CAP_MODE_STRICT;
} else {
@ -903,7 +903,7 @@ bool Platform_getLongOption(int opt, int argc, char** argv) {
#ifdef HAVE_LIBCAP
static int dropCapabilities(enum CapMode mode) {
if (mode == CAP_MODE_NONE)
if (mode == CAP_MODE_OFF)
return 0;
/* capabilities we keep to operate */