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-02 18:30:54 +0000
commit24fe8a518324e291b9ea3fe4e60f2e0fb4f857c5 (patch)
treeb2ceb2cbc92a99b783a35c61ffaff5fd2b03ab39
parentc7e3703352037a5afacdc4126725f351fe7da72b (diff)
downloadsrc-24fe8a518324e291b9ea3fe4e60f2e0fb4f857c5.tar.gz
src-24fe8a518324e291b9ea3fe4e60f2e0fb4f857c5.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 Approved by: re (cperciva, expedited MFC) Sponsored by: The FreeBSD Foundation (cherry picked from commit e093c61b2d69e9cca54a2332096c0e36f97bffc0)
-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 ca043de20f62..225d1e31e3ec 100644
--- a/usr.sbin/freebsd-update/freebsd-update.sh
+++ b/usr.sbin/freebsd-update/freebsd-update.sh
@@ -3505,6 +3505,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}