Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Mar 2023 18:31:11 GMT
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 24fe8a518324 - stable/13 - freebsd-update: avoid effects of user's environment on grep
Message-ID:  <202303021831.322IVBbE062608@gitrepo.freebsd.org>

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

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

commit 24fe8a518324e291b9ea3fe4e60f2e0fb4f857c5
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2022-12-14 17:13:19 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2023-03-02 18:30: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
    Approved by:    re (cperciva, expedited MFC)
    Sponsored by:   The FreeBSD Foundation
    
    (cherry picked from commit e093c61b2d69e9cca54a2332096c0e36f97bffc0)
---
 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 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}



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