From 812cfcb94df0fc0e6f9d33e39078454842d61609 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Thu, 25 Mar 2021 14:33:27 +0100 Subject: [PATCH] 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. --- htop.1.in | 2 +- linux/Platform.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/htop.1.in b/htop.1.in index b2eba5d1..5408dbb4 100644 --- a/htop.1.in +++ b/htop.1.in @@ -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. diff --git a/linux/Platform.c b/linux/Platform.c index d5fd45dc..831ea273 100644 --- a/linux/Platform.c +++ b/linux/Platform.c @@ -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 */