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 <ecrist@secure-computing.net>
This commit is contained in:
Eric F Crist 2022-05-07 07:07:17 -05:00
parent a03a839685
commit fc79ff14ed
No known key found for this signature in database
GPG Key ID: 72964219390D0D0E
2 changed files with 3 additions and 2 deletions

View File

@ -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)

View File

@ -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"