Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Mar 2023 16:04:08 GMT
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: e093c61b2d69 - main - freebsd-update: avoid effects of user's environment on grep
Message-ID:  <202303011604.321G48Ho053409@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by emaste:

URL: https://cgit.FreeBSD.org/src/commit/?id=e093c61b2d69e9cca54a2332096c0e36f97bffc0

commit e093c61b2d69e9cca54a2332096c0e36f97bffc0
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2022-12-14 17:13:19 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2023-03-01 16:02:54 +0000

    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
---
 usr.sbin/freebsd-update/freebsd-update.sh | 3 +++
 1 file changed, 3 insertions(+)

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}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202303011604.321G48Ho053409>