From fc79ff14ede985232b3df995b9a432564668f89f Mon Sep 17 00:00:00 2001 From: Eric F Crist Date: Sat, 7 May 2022 07:07:17 -0500 Subject: [PATCH] Correct grep regex for POSIX compatibility Issue brought up by Michael Gmelin in FreeBSD bug: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=263812 The \d patter is not POSIX, instead :digit: or [0-9] should be used. Opted for the latter. Resolves #556 from freebsd/freebsd-ports@8e0b9d2 Signed-off-by: Eric F Crist --- ChangeLog | 3 ++- easyrsa3/easyrsa | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2df7099..9ffb81d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,8 +2,9 @@ Easy-RSA 3 ChangeLog 3.1.0 (TBD) * Introduce basic support for OpenSSL version 3 (#492) + * Update regex in grep to be POSIX compliant (#556) -3.0.9 (2022-05-04) +3.0.9 (2022-05-xx) * Upgrade OpenSSL from 1.1.0j to 1.1.1o (#405, #407) - We are buliding this ourselves now. * Fix --version so it uses EASYRSA_OPENSSL (#416) diff --git a/easyrsa3/easyrsa b/easyrsa3/easyrsa index 5310bee..8fe9332 100755 --- a/easyrsa3/easyrsa +++ b/easyrsa3/easyrsa @@ -2370,7 +2370,7 @@ default_server_san() { awk -F'=' '/^ *CN=/{print $2}' )" - if echo "$cn" | grep -E -q '^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$'; then + if echo "$cn" | grep -E -q '^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$'; then print "subjectAltName = IP:$cn" else print "subjectAltName = DNS:$cn"