# HG changeset patch # User Franz Glasner # Date 1725566811 -7200 # Node ID 07071afd9ae56642af554d29d2bc9bce3c6729df # Parent c615279bb797b56067116a8e89c00fb245bd2ab7 Reset some variables in the process environment at loading time: GREP_OPTIONS and PATH_FSTAB. LC_ALL (and LANG and friends) are left alone currently. diff -r c615279bb797 -r 07071afd9ae5 sbin/fzfs --- a/sbin/fzfs Thu Sep 05 04:05:33 2024 +0200 +++ b/sbin/fzfs Thu Sep 05 22:06:51 2024 +0200 @@ -322,7 +322,7 @@ done else /sbin/mount -t zfs -p \ - | LC_ALL=C GREP_OPTIONS="" /usr/bin/egrep "^${_dsname}(/|\s)" \ + | LC_ALL=C /usr/bin/egrep "^${_dsname}(/|\s)" \ | LC_ALL=C /usr/bin/sort -n -r \ | while IFS=' '$'\t' read -r _name _mp _rest ; do if checkyes _opt_dry_run ; then diff -r c615279bb797 -r 07071afd9ae5 share/local-bsdtools/common.subr --- a/share/local-bsdtools/common.subr Thu Sep 05 04:05:33 2024 +0200 +++ b/share/local-bsdtools/common.subr Thu Sep 05 22:06:51 2024 +0200 @@ -438,9 +438,25 @@ _strict="${2-}" if checkyes _strict; then # Oracle docs - printf "%s" "$1" | LC_ALL=C GREP_OPTIONS="" /usr/bin/egrep -q '^[A-Za-z][-A-Za-z0-9_.]*(/[A-Za-z0-9][-A-Za-z0-9:_.]*)*(@[A-Za-z0-9][-A-Za-z0-9:_.]*)?$' + printf "%s" "$1" | LC_ALL=C /usr/bin/egrep -q '^[A-Za-z][-A-Za-z0-9_.]*(/[A-Za-z0-9][-A-Za-z0-9:_.]*)*(@[A-Za-z0-9][-A-Za-z0-9:_.]*)?$' else # OpenZFS - printf "%s" "$1" | LC_ALL=C GREP_OPTIONS="" /usr/bin/egrep -q '^[A-Za-z][-A-Za-z0-9:_. ]*(/[-A-Za-z0-9:_. ]+)*(@[-A-Za-z0-9:_. ]+)?$' + printf "%s" "$1" | LC_ALL=C /usr/bin/egrep -q '^[A-Za-z][-A-Za-z0-9:_. ]*(/[-A-Za-z0-9:_. ]+)*(@[-A-Za-z0-9:_. ]+)?$' fi } + + +#: +#: Clean the current process environment somewhat +#: +reset_environment() { + unset PATH_FSTAB + unset GREP_OPTIONS + + # XXX: should we do this + # export LC_ALL=C +} + + +# Automatically reset the environment +reset_environment