From patchwork Sun Aug 9 15:30:41 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 5222 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:21cf:b0:87d:ab56:3700 with SMTP id t15csp1785873mae; Sun, 9 Aug 2026 08:31:02 -0700 (PDT) X-Forwarded-Encrypted: i=2; AHgh+RqWLIvo9s5xrZxW8nU9U+I54rtZEv5mq9h+wKvuKxJWiXbtBFOIu87ziLNEq2mEn9bvlkCHAzeY+go=@openvpn.net X-Received: by 2002:a05:6808:c14a:b0:486:4892:d553 with SMTP id 5614622812f47-4afadc03178mr20823561b6e.0.1786289462404; Sun, 09 Aug 2026 08:31:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1786289462; cv=none; d=google.com; s=arc-20260327; b=MayxAVjS7Fsj64BZxmS/ZkP5kwFw+Nl+b8BUIwy/B1Jj2wRpo5EWyEARt488kEOuTi aiJnGAogbPG+C4mOT0Hf+v+TAbka77AG9aEOQA6kqZm367aeX2fsA2uxA2Io+mRzl/ZY YKbd89vOQqm1dToV8ngVuoHvjjrVKKI+IwJD0W62KKYaghUOQ5+vbnKlg2aEyKiOe37A SNAcAO+HrcId95GccOb4o2i3tHoHvqnlRbLhhawOEqwhC2xeS4VeUHxcZ48mDdhmdVIx 97U3MdB0QP8C4k93p9DcWvLVQs8Cwa9ZxTFTpr6J4wtTv+lfiL4BmZx6ZkbCF9NoXjHS NBJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:dkim-signature:dkim-signature; bh=s7YuN7pApunoqUPbgj77nyisK4JtNfKXlQwO5aa8sDU=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=gaz4QnDU0lLBbEZ47wg9Eyz7d4qdbrEydBEOP0UyH3FANVOZxa0GfqpIRij+I6SHiw VpyinlJflGfD3k9mFmRqUGQEWku0ZatAWsoCMyFVE1o/jKVpBMzuBtaMFs15dQ12BF5L MFxvSPq5ZIKApk+ZlY9h5gU22BGuMw8MbRbwea+BlXL4+yyEthO27MlBsuR9F0S/3NYq q2NaJN/HE6QKIQQyWh6S5k0qNRhvnQx92qT41ibj433DRMICrXCtbDe8OXVCLjds5zqB oHR2vxg1tC4eneQP0JqFvI50B6+gLrFig/foLyN/y6UR1TFftyGPytv3/AIYH7LeUVr+ bgtQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=eUiUrxHM; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=mOyutxIs; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=D4RYgeYw; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id 5614622812f47-4b1af089e3csi3822923b6e.51.2026.08.09.08.31.02 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 09 Aug 2026 08:31:02 -0700 (PDT) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=eUiUrxHM; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=mOyutxIs; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=D4RYgeYw; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Subject:MIME-Version:References:In-Reply-To:Message-ID:Date:To:From:Sender: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=s7YuN7pApunoqUPbgj77nyisK4JtNfKXlQwO5aa8sDU=; b=eUiUrxHMJr76TSAIMdvuhQE95Y TCdiY/mG75vxah7W255Pz5xFWyD9vA0wJbPefK3HyiiZOBJCz07/BHMTA2Lcz4U2SAGYxcV0YugLI U5YzxGs+Zl34TW6Po41vn9QNmYkAyZwTi1o/5q6AA6Mdz30lNOTNwlLAA6NaOFT5BiXc=; Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1wt5UJ-0002YT-Lk; Sun, 09 Aug 2026 15:30:57 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1wt5UH-0002YN-S7 for openvpn-devel@lists.sourceforge.net; Sun, 09 Aug 2026 15:30:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Enfv94r59x7iVZ8g0CprMEtLpByqMoMaBLbfae9kGdo=; b=mOyutxIs47v1O31CkXWXGM8xd5 ne9vZTBw+084hMCq1HXQGM3OZVbzkxz5H8LDhtQPjIozZ4FXGtFCxEtOnJm8Sc7df3o5IIOytSqRX 9Vu5zNcLHMRtm8AxK14eipYwBW/k5GwlKx8Uks6VQR2JtpTKh7CGo95YkcDY4beiqdSE=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID: Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Enfv94r59x7iVZ8g0CprMEtLpByqMoMaBLbfae9kGdo=; b=D4RYgeYwvf8KItGQTnaMBXqYAM p3je1q++IlrfH6UzDlsHupjOSXDWB7bsjff3JZMte9IcGplXgEJ6CGPXCdypRhJ6E9vLJbxezMiw2 NNO1/TWq8vWOnpATZE3G6EXFnjC+uRxmBK3rADQkkKZP7vMNF6KngTlIS6+KsedWXbKI=; Received: from [193.149.48.129] (helo=blue.greenie.muc.de) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1wt5UE-00053g-FD for openvpn-devel@lists.sourceforge.net; Sun, 09 Aug 2026 15:30:55 +0000 Received: from blue.greenie.muc.de (localhost [127.0.0.1]) by blue.greenie.muc.de (8.18.1/8.18.1) with ESMTP id 679FUl6r014752 for ; Sun, 9 Aug 2026 17:30:47 +0200 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.2/8.18.1/Submit) id 679FUlMF014750 for openvpn-devel@lists.sourceforge.net; Sun, 9 Aug 2026 17:30:47 +0200 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Sun, 9 Aug 2026 17:30:41 +0200 Message-ID: <20260809153046.14738-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.53.0 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "sfi-spamd-1.hosts.colo.sdot.me", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Frank Lichtenheld In some shells the echo builtin doesn't interpret -e as an argument, it just outputs it as a string. Examples for shells I have observed this with are dash on Ubuntu and /bin/sh on macOS. Content analysis details: (1.3 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-Headers-End: 1wt5UE-00053g-FD Subject: [Openvpn-devel] [PATCH v3] t_client.sh.in: Use printf instead of echo -e X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: 1873060259678766875 X-GMAIL-MSGID: 1873060259678766875 From: Frank Lichtenheld In some shells the echo builtin doesn't interpret -e as an argument, it just outputs it as a string. Examples for shells I have observed this with are dash on Ubuntu and /bin/sh on macOS. Use printf instead which should have better consistency across shells and operating systems. Change-Id: I746bd8c0fa3496d23569cde496438fc4189600fe Signed-off-by: Frank Lichtenheld Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1753 --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1753 This mail reflects revision 3 of this Change. Acked-by according to Gerrit (reflected above): diff --git a/tests/t_client.sh.in b/tests/t_client.sh.in index 7233187..0254c0c3 100755 --- a/tests/t_client.sh.in +++ b/tests/t_client.sh.in @@ -132,21 +132,20 @@ { case $V in 0) outbuf="" ;; # no per-test output at all - 1) echo -e "$@" # compact, details only on failure + 1) printf "$@\n" # compact, details only on failure outbuf="\n" ;; - *) echo -e "\n$@\n" ;; # print all, with a bit formatting + *) printf "\n$@\n" ;; # print all, with a bit formatting esac } output() { - NO_NL=''; if [ "X$1" = "X-n" ] ; then NO_NL=$1 ; shift ; fi + END_NL="\n"; if [ "X$1" = "X-n" ] ; then END_NL="" ; shift ; fi case $V in 0) ;; # no per-test output at all - 1) outbuf="$outbuf$@" # print details only on failure - test -z "$NO_NL" && outbuf="$outbuf\n" + 1) outbuf="$outbuf$@${END_NL}" # print details only on failure ;; - *) echo -e $NO_NL "$@" ;; # print everything + *) printf "$@${END_NL}" ;; # print everything esac } @@ -340,7 +339,7 @@ else output "skip check failed, SKIP test $SUF." SUMMARY_SKIP="$SUMMARY_SKIP $SUF" - echo -e "$outbuf" ; continue + printf "$outbuf" ; continue fi fi @@ -361,7 +360,7 @@ fail "make sure that ping hosts are ONLY reachable via VPN, SKIP test $SUF." SUMMARY_FAIL="$SUMMARY_FAIL $SUF" exit_code=31 - echo -e "$outbuf" ; continue + printf "$outbuf" ; continue fi pidfile="${top_builddir}/tests/$LOGDIR/openvpn-$SUF.pid" @@ -407,7 +406,7 @@ trap - 0 1 2 3 15 SUMMARY_FAIL="$SUMMARY_FAIL $SUF" exit_code=30 - echo -e "$outbuf" ; continue + printf "$outbuf" ; continue fi # make sure openvpn client is terminated in case shell exits @@ -470,15 +469,15 @@ SUMMARY_OK="$SUMMARY_OK $SUF" else if [ "$V" -gt 0 ] ; then - echo -e -n "$outbuf" - echo -e "test run $SUF: $fail_count test failures. FAIL.\n" + printf "$outbuf" + echo "test run $SUF: $fail_count test failures. FAIL." fi SUMMARY_FAIL="$SUMMARY_FAIL $SUF" exit_code=30 fi if [ -n "$test_cleanup" ]; then - echo -e "cleaning up: '$test_cleanup'" + echo "cleaning up: '$test_cleanup'" eval $test_cleanup fi