raggi / openssl-osx-ca

Simple periodic task to sync OSX Keychain certs to Homebrew installed OpenSSL & LibreSSL
Other
225 stars 24 forks source link

mktemp: too few X's in template ‘openssl-osx-ca’ with GNU coreutils in path #5

Closed smammy closed 10 years ago

smammy commented 10 years ago

I just installed openssl-osx-ca via your Homebrew tap. When I run it on the command line, I get an error:

$ /usr/local/Cellar/openssl-osx-ca/1.0.3/bin/openssl-osx-ca /usr/local/bin/brew
mktemp: too few X's in template ‘openssl-osx-ca’
mktemp failed

I have /usr/local/opt/coreutils/libexec/gnubin in my path in order to get the GNU versions of various utilities. Unfortunately, GNU mktemp isn't compatible with BSD mktemp.

This change fixed the problem:

--- /usr/local/bin/openssl-osx-ca.OLD   2014-04-10 08:38:59.000000000 -0400
+++ /usr/local/bin/openssl-osx-ca.NEW   2014-04-10 08:39:08.000000000 -0400
@@ -22,7 +22,7 @@

 [[ "${openssldir}" = "" ]] && echo "openssl directory not found" && exit 1

-tmpdir=$(mktemp -d -t openssl-osx-ca)
+tmpdir=$(/usr/bin/mktemp -d -t openssl-osx-ca)

 [[ "${tmpdir}" = "" ]] && echo "mktemp failed" && exit 1