Skip to contentSkip to conversation

PATCH: test portability, avoid GNUism and use POSIX regex

Openvpn-devel In review Matthias Andree 2 participants 6 messages Sep 6, 2019 – Sep 24, 2019

lore
Share & tools
lore
#0 lore raw

This patch should be applied to the 2.4 and master branches.

#1 lore raw

PATCH 1/1 tests/t__lpback.sh: Switch sed(1) to POSIX-compatible regex.

From: Kyle Evans <[email protected]...>

A test run with FreeBSD PR 229925 'Disallow escaping ordinary characters in regex(3)' reveals one sed expression that uses the GNU-extension "\s".
Given that this is the only occurrence and it's a trivial fix, update it to be POSIX-compatible.

---
 tests/t_lpback.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/t_lpback.sh +1 -1
index 2052c626..bb8a1d51 100755
@@ -26,7 +26,7 @@ trap "rm -f key.$$ log.$$ ; exit 1" 0 3
 
 # Get list of supported ciphers from openvpn --show-ciphers output
 CIPHERS=$(${top_builddir}/src/openvpn/openvpn --show-ciphers | \
-            sed -e '/The following/,/^$/d' -e s'/ .*//' -e '/^\s*$/d')
+            sed -e '/The following/,/^$/d' -e s'/ .*//' -e '/^[[:space:]]*$/d')
 
 # SK, 2014-06-04: currently the DES-EDE3-CFB1 implementation of OpenSSL is
 # broken (see http://rt.openssl.org/Ticket/Display.html?id=2867), so exclude

--
2.21.0

#2 lore raw

Re: [Openvpn-devel] [PATCH] tests/t__lpback.sh: Switch sed(1) to POSIX-compatible regex.

What is the review status of the change Kyle Evans proposed below that I've relayed on Sept 6th?

Am 06.09.19 um 19:44 schrieb Matthias Andree:

Quoted 26 lines

From: Kyle Evans <[email protected]...>

A test run with FreeBSD PR 229925 'Disallow escaping ordinary characters in regex(3)' reveals one sed expression that uses the GNU-extension "\s".
Given that this is the only occurrence and it's a trivial fix, update it to be POSIX-compatible.

---
 tests/t_lpback.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/t_lpback.sh +1 -2
index 2052c626..bb8a1d51 100755
@@ -26,7 +26,7 @@ trap "rm -f key.$$ log.$$ ; exit 1" 0 3
 
 # Get list of supported ciphers from openvpn --show-ciphers output
 CIPHERS=$(${top_builddir}/src/openvpn/openvpn --show-ciphers | \
-            sed -e '/The following/,/^$/d' -e s'/ .*//' -e '/^\s*$/d')
+            sed -e '/The following/,/^$/d' -e s'/ .*//' -e '/^[[:space:]]*$/d')
 
 # SK, 2014-06-04: currently the DES-EDE3-CFB1 implementation of OpenSSL is
 # broken (see http://rt.openssl.org/Ticket/Display.html?id=2867), so exclude
--

2.21.0

#3 lore raw

Re: [Openvpn-devel] [PATCH] tests/t__lpback.sh: Switch sed(1) to POSIX-compatible regex.

In reply to Matthias Andree

Ping again - please review.

Am 06.09.19 um 19:44 schrieb Matthias Andree:

Quoted 33 lines

From: Kyle Evans <[email protected]...>

A test run with FreeBSD PR 229925 'Disallow escaping ordinary characters in regex(3)' reveals one sed expression that uses the GNU-extension "\s".
Given that this is the only occurrence and it's a trivial fix, update it to be POSIX-compatible.

---
 tests/t_lpback.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/t_lpback.sh +1 -2
index 2052c626..bb8a1d51 100755
@@ -26,7 +26,7 @@ trap "rm -f key.$$ log.$$ ; exit 1" 0 3
 
 # Get list of supported ciphers from openvpn --show-ciphers output
 CIPHERS=$(${top_builddir}/src/openvpn/openvpn --show-ciphers | \
-            sed -e '/The following/,/^$/d' -e s'/ .*//' -e '/^\s*$/d')
+            sed -e '/The following/,/^$/d' -e s'/ .*//' -e '/^[[:space:]]*$/d')
 
 # SK, 2014-06-04: currently the DES-EDE3-CFB1 implementation of OpenSSL is
 # broken (see http://rt.openssl.org/Ticket/Display.html?id=2867), so exclude
--

2.21.0

_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Acked-by on v1 1/1
#4 lore raw

Re: [Openvpn-devel] [PATCH] tests/t__lpback.sh: Switch sed(1) to POSIX-compatible regex.

In reply to Matthias Andree

Hi,

tests/t_lpback.sh trap "rm -f key.$$ log.$$ ; exit 1" 0 3 · line 30

Quoted 9 lines · Matthias Andree
tests/t_lpback.sh +1 -1
@@ -26,7 +26,7 @@ trap "rm -f key.$$ log.$$ ; exit 1" 0 3
 
 # Get list of supported ciphers from openvpn --show-ciphers output
 CIPHERS=$(${top_builddir}/src/openvpn/openvpn --show-ciphers | \
-            sed -e '/The following/,/^$/d' -e s'/ .*//' -e '/^\s*$/d')
+            sed -e '/The following/,/^$/d' -e s'/ .*//' -e '/^[[:space:]]*$/d')
 

I wanted to test this across our zoo of funny platforms - namely stuff like "OpenSolaris" or "AIX", and did not find the time yet.

To my amazement, all platforms seem to support the [[:space:]] notation correctly, at least the output of

  openvpn --show-ciphers | sed -e '/^[[:space:]]*$/d'

is correctly relieved of all empty lines. Even AIX.

Thus:

will merge tomorrow

gert

Signature · 6 lines
"If was one thing all people took for granted, was conviction that if you 
 feed honest figures into a computer, honest figures come out. Never doubted 
 it myself till I met a computer with a sense of humor."
                             Robert A. Heinlein, The Moon is a Harsh Mistress

Gert Doering - Munich, Germany                             [email protected]...
#5 lore raw

[Openvpn-devel] [PATCH applied] Re: tests/t_lpback.sh: Switch sed(1) to POSIX-compatible regex.

In reply to Matthias Andree

Your patch has been applied to the master and release/2.4 branch.

Thanks.

commit 7e4a261cc92a813f9e9ba9ee91c6e08de9d843f8 (master) commit ab34d883901e8e59abf5cc5990f1f206c9b0dc58 (release/2.4)

Author: Kyle Evans
Date:   Fri Sep 6 19:44:59 2019 +0200
     tests/t_lpback.sh: Switch sed(1) to POSIX-compatible regex.

     Signed-off-by: Matthias Andree <[email protected]...>
     Acked-by: Gert Doering <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg18806.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering