Opened 12 months ago

Last modified 7 months ago

#1196 accepted Patch submission

tests/t_lpback.sh: Replace 'echo -n' with 'printf'

Reported by: mnowak Owned by: Gert Döring
Priority: minor Milestone:
Component: Generic / unclassified Version: OpenVPN 2.4.7 (Community Ed)
Severity: Not set (select this one, unless your'e a OpenVPN developer) Keywords:
Cc:

Description

illumos echo does not support the '-n' option. It's more portable to replace it with printf.

--- openvpn-2.4.7/tests/t_lpback.sh	2019-02-20 13:28:23.000000000 +0000
+++ openvpn-2.4.7/tests/t_lpback.sh	2019-06-09 14:24:33.120063745 +0000
@@ -44,7 +44,7 @@ set +e
 e=0
 for cipher in ${CIPHERS}
 do
-    echo -n "Testing cipher ${cipher}... "
+    printf "Testing cipher ${cipher}... "
     ( "${top_builddir}/src/openvpn/openvpn" --test-crypto --secret key.$$ --cipher ${cipher} ) >log.$$ 2>&1
     if [ $? != 0 ] ; then
         echo "FAILED"

Before:

-n Testing cipher AES-128-CBC... 
OK
-n Testing cipher AES-128-CFB... 
OK
-n Testing cipher AES-128-CFB1... 
OK

After:

Testing cipher AES-128-CBC... OK
Testing cipher AES-128-CFB... OK
Testing cipher AES-128-CFB1... OK

Change History (1)

comment:1 Changed 7 months ago by Gert Döring

Owner: set to Gert Döring
Status: newaccepted

I used to assume that "printf" is not portable, but it seems it is (quickly checked, available on NetBSD, OpenBSD, FreeBSD, AIX). This is good :-)

To merge this, can you provide your real name + e-mail address so I can put that into the "author:" line of the commit, so due credits are given? Or you could send it to the openvpn-devel@… list :-)

If you do not want this, I'll just take this

Note: See TracTickets for help on using tickets.