Skip to content

Commit

Permalink
security/easy-rsa: fix cert issuance with BSD grep
Browse files Browse the repository at this point in the history
easyrsa running on systems with bsdgrep for grep
fails issuing certs because it attempts \d as shorthand for
[[:digit:]] or [0-9] and triggers a grep failure with diagnostic

    grep: trailing backslash (\)

Filed upstream: OpenVPN/easy-rsa#556

PR:		263812
Submitted by:	grembo@
  • Loading branch information
mandree committed May 6, 2022
1 parent ad4519f commit 8e0b9d2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions security/easy-rsa/Makefile
@@ -1,5 +1,6 @@
PORTNAME= easy-rsa
DISTVERSION= 3.0.8
PORTREVISION= 1
CATEGORIES= security net-mgmt
MASTER_SITES= https://github.com/OpenVPN/easy-rsa/releases/download/v${DISTVERSION}/
DISTNAME= EasyRSA-${DISTVERSION}
Expand Down
11 changes: 11 additions & 0 deletions security/easy-rsa/files/patch-easyrsa
@@ -0,0 +1,11 @@
--- easyrsa.orig 2020-09-09 20:59:45 UTC
+++ easyrsa
@@ -1546,7 +1546,7 @@ default_server_san() {
easyrsa_openssl req -in "$path" -noout -subject -nameopt sep_multiline |
awk -F'=' '/^ *CN=/{print $2}'
)
- echo "$cn" | grep -E -q '^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$'
+ echo "$cn" | grep -E -q '^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$'
#shellcheck disable=SC2181
if [ $? -eq 0 ]; then
print "subjectAltName = IP:$cn"

0 comments on commit 8e0b9d2

Please sign in to comment.