From d428d53a8bbf843d1b28ae0d9a81b3ee2f0ddb0c Mon Sep 17 00:00:00 2001 From: Eric F Crist Date: Sat, 7 May 2022 06:57:56 -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 --- easyrsa3/easyrsa | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easyrsa3/easyrsa b/easyrsa3/easyrsa index 4db2bb7..304e54e 100755 --- a/easyrsa3/easyrsa +++ b/easyrsa3/easyrsa @@ -2343,7 +2343,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"