From 48cde30de673f300e6682abd8e03d1ef17fe0171 Mon Sep 17 00:00:00 2001 From: Chalith Desaman Date: Tue, 1 Dec 2020 10:43:00 +0530 Subject: [PATCH] Validating hpfs and hpws binary paths on startup (#178) --- src/conf.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/conf.cpp b/src/conf.cpp index 1d9f597e..c0b2d9db 100644 --- a/src/conf.cpp +++ b/src/conf.cpp @@ -563,14 +563,16 @@ namespace conf */ int validate_contract_dir_paths() { - const std::string paths[7] = { + const std::string paths[9] = { ctx.contract_dir, ctx.config_file, ctx.hist_dir, ctx.full_hist_dir, ctx.state_dir, ctx.tls_key_file, - ctx.tls_cert_file}; + ctx.tls_cert_file, + ctx.hpfs_exe_path, + ctx.hpws_exe_path}; for (const std::string &path : paths) { @@ -582,6 +584,10 @@ namespace conf << "openssl req -newkey rsa:2048 -new -nodes -x509 -days 3650 -keyout tlskey.pem -out tlscert.pem\n" << "and add it to " + ctx.config_dir << std::endl; } + else if (path == ctx.hpfs_exe_path || path == ctx.hpws_exe_path) + { + std::cout << path << " binary does not exist.\n"; + } else { std::cout << path << " does not exist.\n";