OpenSolaris (Joyent) Compatibility #135

Closed
opened 2025-12-29 00:25:35 +01:00 by adam · 6 comments
Owner

Originally created by @EvilJordan on GitHub (Aug 8, 2016).

The flag "grep -A1" on line 412 is not supported in Open Solaris.
If you have SANs, this will be a problem.

Therefore, a simple change can be made and then everything works without a hitch!
I wasn't sure how best to submit this, so I'm just doing it here in the hopes anyone Googling for an answer will find it.

Change:
altnames="$( <<<"${reqtext}" grep -A1 '^[[:space:]]*X509v3 Subject Alternative Name:[[:space:]]*$' | tail -n1 )"
to:
altnames="$( <<<"${reqtext}" awk '/^[[:space:]]*X509v3 Subject Alternative Name:[[:space:]]*$/{print;getline;print;}' | tail -n1 )"

Originally created by @EvilJordan on GitHub (Aug 8, 2016). The flag "grep -A1" on line 412 is not supported in Open Solaris. If you have SANs, this will be a problem. Therefore, a simple change can be made and then everything works without a hitch! I wasn't sure how best to submit this, so I'm just doing it here in the hopes anyone Googling for an answer will find it. Change: `altnames="$( <<<"${reqtext}" grep -A1 '^[[:space:]]*X509v3 Subject Alternative Name:[[:space:]]*$' | tail -n1 )"` to: `altnames="$( <<<"${reqtext}" awk '/^[[:space:]]*X509v3 Subject Alternative Name:[[:space:]]*$/{print;getline;print;}' | tail -n1 )"`
adam closed this issue 2025-12-29 00:25:36 +01:00
Author
Owner

@to-kn commented on GitHub (Feb 4, 2017):

Hi @lukas2511, on Debian with

awk -W version
mawk 1.3.3 Nov 1996, Copyright (C) Michael D. Brennan

compiled limits:
max NF             32767
sprintf buffer      2040

this break things and it always exits with
"ERROR: Certificate signing request contains non-DNS Subject Alternative Names"
(if you have SAN-Certs of course)

@to-kn commented on GitHub (Feb 4, 2017): Hi @lukas2511, on Debian with ``` awk -W version mawk 1.3.3 Nov 1996, Copyright (C) Michael D. Brennan compiled limits: max NF 32767 sprintf buffer 2040 ``` this break things and it always exits with "ERROR: Certificate signing request contains non-DNS Subject Alternative Names" (if you have SAN-Certs of course)
Author
Owner

@lukas2511 commented on GitHub (Feb 4, 2017):

@to-kn thanks, this should be fixed now

@lukas2511 commented on GitHub (Feb 4, 2017): @to-kn thanks, this should be fixed now
Author
Owner

@to-kn commented on GitHub (Feb 4, 2017):

Hi @lukas2511 no, i think you missunderstood me - the change you made (changing to awk instead of grep) does not work at the mentioned system...

@to-kn commented on GitHub (Feb 4, 2017): Hi @lukas2511 no, i think you missunderstood me - the change you made (changing to awk instead of grep) does not work at the mentioned system...
Author
Owner

@txr13 commented on GitHub (Feb 4, 2017):

This is the same error as reported in #351. Apparently installing gawk fixed the error--perhaps different providers of awk yield different results?

@txr13 commented on GitHub (Feb 4, 2017): This is the same error as reported in #351. Apparently installing gawk fixed the error--perhaps different providers of awk yield different results?
Author
Owner

@lukas2511 commented on GitHub (Feb 4, 2017):

@to-kn i did unterstand that, i was able to reproduce it using mawk, i changed how awk is used in this case and it should work with mawk now too, please test the change i made in 3d8d320c9f

@lukas2511 commented on GitHub (Feb 4, 2017): @to-kn i did unterstand that, i was able to reproduce it using mawk, i changed how awk is used in this case and it should work with mawk now too, please test the change i made in 3d8d320c9f5a8dbd2621de28cd02f8ba15be5dbf
Author
Owner

@EvilJordan commented on GitHub (Feb 19, 2017):

Sorry to have caused so much trouble, guys. It looks like the default grep on my system is some gimpy version. Forcing dehydrated to use the non-gimpy version fixed things for me.

@EvilJordan commented on GitHub (Feb 19, 2017): Sorry to have caused so much trouble, guys. It looks like the default grep on my system is some gimpy version. Forcing dehydrated to use the non-gimpy version fixed things for me.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/dehydrated#135