Commit 82ad3594 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Find OpenSSL program at configure time



Otherwise we depend on PATH at runtime.
Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent a55474c7
......@@ -449,6 +449,7 @@ lib/_autoconf.py: Makefile stamp-directories
echo "PKGLIBDIR = '$(pkglibdir)'"; \
echo "DRBD_BARRIERS = $(DRBD_BARRIERS)"; \
echo "SYSLOG_USAGE = '$(SYSLOG_USAGE)'"; \
echo "OPENSSL_PATH = '$(OPENSSL)'"; \
} > $@
$(REPLACE_VARS_SED): Makefile
......
......@@ -201,6 +201,14 @@ then
AC_MSG_WARN([pylint not found, checking code will not be possible])
fi
# Check for openssl
AC_ARG_VAR(OPENSSL, [openssl path])
AC_PATH_PROG(OPENSSL, [openssl], [])
if test -z "$OPENSSL"
then
AC_MSG_ERROR([openssl not found])
fi
# Check for socat
AC_ARG_VAR(SOCAT, [socat path])
AC_PATH_PROG(SOCAT, [socat], [])
......
......@@ -112,6 +112,7 @@ DEFAULT_FILE_STORAGE_DIR = _autoconf.FILE_STORAGE_DIR
SYSCONFDIR = _autoconf.SYSCONFDIR
TOOLSDIR = _autoconf.TOOLSDIR
CONF_DIR = SYSCONFDIR + "/ganeti"
OPENSSL_PATH = _autoconf.OPENSSL_PATH
MASTER_SOCKET = SOCKET_DIR + "/ganeti-master"
......
......@@ -2273,7 +2273,8 @@ def GenerateSelfSignedSslCert(file_name, validity=(365 * 5)):
# Set permissions before writing key
os.chmod(tmp_file_name, 0600)
result = RunCmd(["openssl", "req", "-new", "-newkey", "rsa:1024",
result = RunCmd([constants.OPENSSL_PATH, "req",
"-new", "-newkey", "rsa:1024",
"-days", str(validity), "-nodes", "-x509",
"-keyout", tmp_file_name, "-out", tmp_file_name,
"-batch"])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment