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

Message ID 20190906174458.14975-2-matthias.andree@gmx.de
State Accepted
Headers show
Series
  • [Openvpn-devel] tests/t__lpback.sh: Switch sed(1) to POSIX-compatible regex.
Related show

Commit Message

Matthias Andree Sept. 6, 2019, 5:44 p.m.
From: Kyle Evans <kevans@FreeBSD.org>

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.

Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
---
 tests/t_lpback.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
2.21.0

Comments

Matthias Andree Sept. 15, 2019, 9:39 a.m. | #1
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:
> From: Kyle Evans <kevans@FreeBSD.org>
>
> 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.
>
> Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
> ---
>  tests/t_lpback.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tests/t_lpback.sh b/tests/t_lpback.sh
> index 2052c626..bb8a1d51 100755
> --- a/tests/t_lpback.sh
> +++ b/tests/t_lpback.sh
> @@ -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
Matthias Andree Sept. 24, 2019, 6:52 p.m. | #2
Ping again - please review.

Am 06.09.19 um 19:44 schrieb Matthias Andree:
> From: Kyle Evans <kevans@FreeBSD.org>
>
> 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.
>
> Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
> ---
>  tests/t_lpback.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tests/t_lpback.sh b/tests/t_lpback.sh
> index 2052c626..bb8a1d51 100755
> --- a/tests/t_lpback.sh
> +++ b/tests/t_lpback.sh
> @@ -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
> Openvpn-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openvpn-devel
Gert Doering Sept. 24, 2019, 9:36 p.m. | #3
Hi,

On Fri, Sep 06, 2019 at 07:44:59PM +0200, Matthias Andree wrote:
> --- a/tests/t_lpback.sh
> +++ b/tests/t_lpback.sh
> @@ -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:

Acked-By: gert@greenie.muc.de

will merge tomorrow

gert
Gert Doering Sept. 24, 2019, 9:49 p.m. | #4
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 <matthias.andree@gmx.de>
     Acked-by: Gert Doering <gert@greenie.muc.de>
     Message-Id: <20190906174458.14975-2-matthias.andree@gmx.de>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg18806.html
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering

Patch

diff --git a/tests/t_lpback.sh b/tests/t_lpback.sh
index 2052c626..bb8a1d51 100755
--- a/tests/t_lpback.sh
+++ b/tests/t_lpback.sh
@@ -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