aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2022-12-14 17:13:19 +0000
committerEd Maste <emaste@FreeBSD.org>2023-03-01 16:02:54 +0000
commite093c61b2d69e9cca54a2332096c0e36f97bffc0 (patch)
tree05e8ffc78ff6ba7228e7e8af36d8c95798a68d91
parent1b003348526323d23785648fa449338447daec5f (diff)
downloadsrc-e093c61b2d69e9cca54a2332096c0e36f97bffc0.tar.gz
src-e093c61b2d69e9cca54a2332096c0e36f97bffc0.zip
freebsd-update: avoid effects of user's environment on grep
A user had GREP_OPTIONS containing --color=always, which broke grep use in freebsd-update. Unset this environment variable. PR: 255990 Reviewed by: kevans MFC after: 3 days Sponsored by: The FreeBSD Foundation
-rw-r--r--usr.sbin/freebsd-update/freebsd-update.sh3
1 files changed, 3 insertions, 0 deletions
diff --git a/usr.sbin/freebsd-update/freebsd-update.sh b/usr.sbin/freebsd-update/freebsd-update.sh
index 078043326115..b6cd241c4a48 100644
--- a/usr.sbin/freebsd-update/freebsd-update.sh
+++ b/usr.sbin/freebsd-update/freebsd-update.sh
@@ -3492,6 +3492,9 @@ fi
# Set LC_ALL in order to avoid problems with character ranges like [A-Z].
export LC_ALL=C
+# Clear environment variables that may affect operation of tools that we use.
+unset GREP_OPTIONS
+
get_params $@
for COMMAND in ${COMMANDS}; do
cmd_${COMMAND}