]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream: Explictly set LC_ALL=C on each sort invocation.
authordtucker@openbsd.org <dtucker@openbsd.org>
Fri, 23 May 2025 08:40:13 +0000 (08:40 +0000)
committerDarren Tucker <dtucker@dtucker.net>
Fri, 23 May 2025 09:02:37 +0000 (19:02 +1000)
Remove it from sshd_config (where it could be overridden by shell startup
scripts, eg on macos-15) causing random test failures.  with & ok djm@

OpenBSD-Regress-ID: ad0a6678964784096e9a9e6d15ead36beed92f18

regress/agent-restrict.sh

index 057856f1bbdf25d88424405b5d2278f4388e2464..7fc30fa5467cde3716eaa4e63443c6f0cf6a0de5 100644 (file)
@@ -1,4 +1,4 @@
-#      $OpenBSD: agent-restrict.sh,v 1.7 2025/03/28 21:45:55 dtucker Exp $
+#      $OpenBSD: agent-restrict.sh,v 1.8 2025/05/23 08:40:13 dtucker Exp $
 #      Placed in the Public Domain.
 
 tid="agent restrictions"
@@ -52,10 +52,6 @@ done
 cat $OBJ/ssh_proxy.bak >> $OBJ/ssh_proxy
 cat $OBJ/ssh_proxy.bak >> $OBJ/ssh_proxy_noid
 
-LC_ALL=C
-export LC_ALL
-echo "SetEnv LC_ALL=${LC_ALL}" >> sshd_proxy
-
 verbose "prepare known_hosts"
 rm -f $OBJ/known_hosts
 for h in a b c x ; do
@@ -84,7 +80,8 @@ reset_keys() {
        _command=""
        case "$_whichcmd" in
        authinfo)       _command="cat \$SSH_USER_AUTH" ;;
-       keylist)                _command="$SSHADD -L | cut -d' ' -f-2 | sort" ;;
+       keylist)                _command="$SSHADD -L | cut -d' ' -f-2 | \
+           env LC_ALL=C sort" ;;
        *)              fatal "unsupported command $_whichcmd" ;;
        esac
        trace "reset keys"
@@ -227,7 +224,7 @@ rm -f $OBJ/expect_list.pre
 for u in a b c d e x; do
        cut -d " " -f-2 $OBJ/user_${u}.pub >> $OBJ/expect_list.pre
 done
-sort $OBJ/expect_list.pre > $OBJ/expect_list
+env LC_ALL=C sort $OBJ/expect_list.pre > $OBJ/expect_list
 for h in a b c d e; do
        cp $OBJ/expect_list $OBJ/expect_$h
        expect_succeed $h "unrestricted keylist"
@@ -332,7 +329,7 @@ if test ! -z "\$me" ; then
        cat \$SSH_USER_AUTH
 fi
 echo AGENT
-$SSHADD -L | egrep "^ssh" | cut -d" " -f-2 | sort
+$SSHADD -L | egrep "^ssh" | cut -d" " -f-2 | env LC_ALL=C sort
 if test -z "\$next" ; then 
        touch $OBJ/done
        echo "FINISH"
@@ -369,7 +366,7 @@ prepare_multihop_expected() {
        done
        rm -f $OBJ/expect_a
        echo "AGENT" >> $OBJ/expect_a
-       test "x$_keys" = "xnone" || sort $OBJ/expect_keys >> $OBJ/expect_a
+       test "x$_keys" = "xnone" || env LC_ALL=C sort $OBJ/expect_keys >> $OBJ/expect_a
        echo "NEXT" >> $OBJ/expect_a
        for h in $_hops ; do 
                echo "HOSTNAME host_$h" >> $OBJ/expect_a
@@ -377,7 +374,7 @@ prepare_multihop_expected() {
                (printf "publickey " ; cut -d" " -f-2 $OBJ/user_a.pub) >> $OBJ/expect_a
                echo "AGENT" >> $OBJ/expect_a
                if test "x$_keys" = "xall" ; then
-                       sort $OBJ/expect_keys >> $OBJ/expect_a
+                       env LC_ALL=C sort $OBJ/expect_keys >> $OBJ/expect_a
                fi
                if test "x$h" != "x$_lasthop" ; then
                        if test "x$_keys" = "xfiltered" ; then