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 \fB\-H \-\-highlight-changes=DELAY\fR
Highlight new and old processes Highlight new and old processes
.TP .TP
\fB \-\-drop-capabilities[=none|basic|strict]\fR \fB \-\-drop-capabilities[=off|basic|strict]\fR
Linux only; requires libcap support. Linux only; requires libcap support.
.br .br
Drop unneeded Linux capabilities. Drop unneeded Linux capabilities.

View File

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