From 931c55f9e2b41473132683488820c6fb7c47506b Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Thu, 13 Jan 2022 12:50:48 +0100 Subject: libbb: invert the meaning of SETUP_ENV_NO_CHDIR -> SETUP_ENV_CHDIR Double negatives are hard to grok. function old new delta login_main 986 988 +2 su_main 474 470 -4 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 2/-4) Total: -2 bytes Signed-off-by: Denys Vlasenko --- include/libbb.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/libbb.h b/include/libbb.h index a0ffbef..780e9ae 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -1726,7 +1726,7 @@ extern void selinux_or_die(void) FAST_FUNC; /* setup_environment: - * if !SETUP_ENV_NO_CHDIR: + * if SETUP_ENV_CHDIR: * if cd(pw->pw_dir): ok: else if SETUP_ENV_TO_TMP: cd(/tmp) else: cd(/) or die * if SETUP_ENV_CLEARENV: cd(pw->pw_dir), clear environment, then set * TERM=(old value) @@ -1734,7 +1734,7 @@ extern void selinux_or_die(void) FAST_FUNC; * PATH=bb_default_[root_]path * HOME=pw->pw_dir * SHELL=shell - * else if SETUP_ENV_CHANGEENV: + * else if SETUP_ENV_CHANGEENV | SETUP_ENV_CHANGEENV_LOGNAME: * if not root (if pw->pw_uid != 0) or if SETUP_ENV_CHANGEENV_LOGNAME: * USER=pw->pw_name, LOGNAME=pw->pw_name * HOME=pw->pw_dir @@ -1748,7 +1748,7 @@ extern void selinux_or_die(void) FAST_FUNC; #define SETUP_ENV_CHANGEENV_LOGNAME (1 << 1) #define SETUP_ENV_CLEARENV (1 << 2) #define SETUP_ENV_TO_TMP (1 << 3) -#define SETUP_ENV_NO_CHDIR (1 << 4) +#define SETUP_ENV_CHDIR (1 << 4) void setup_environment(const char *shell, int flags, const struct passwd *pw) FAST_FUNC; void nuke_str(char *str) FAST_FUNC; #if ENABLE_FEATURE_SECURETTY && !ENABLE_PAM -- cgit v1.1