diff --git a/src/man/man8/opnsense-version.8 b/src/man/man8/opnsense-version.8 index 1b290e6d2..1fb701502 100644 --- a/src/man/man8/opnsense-version.8 +++ b/src/man/man8/opnsense-version.8 @@ -24,7 +24,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd Sep 24, 2018 +.Dd Sep 26, 2018 .Dt OPNSENSE-VERSION 8 .Os .Sh NAME @@ -58,6 +58,9 @@ Return the firmware ABI string. Return the product contact e-mail address. .It Fl f Return the cryptography flavour. +The correct flavour will be read from the installed OpenSSL +binary, or from release package metadata if the binary could +not be found. .It Fl H Return the release package commit hash. .It Fl N diff --git a/src/opnsense/scripts/shell/banner.php b/src/opnsense/scripts/shell/banner.php index bd5cb033b..420b9666e 100755 --- a/src/opnsense/scripts/shell/banner.php +++ b/src/opnsense/scripts/shell/banner.php @@ -34,14 +34,9 @@ require_once("interfaces.inc"); require_once("util.inc"); require_once("plugins.inc.d/openssh.inc"); -$hostname = $config['system']['hostname']; -$domain = $config['system']['domain']; -$flavour = $g['product_flavour']; -$version = $g['product_version']; -$product = $g['product_name']; -$machine = $g['product_arch']; +$version = trim(shell_exec('opnsense-version')); -echo "\n*** {$hostname}.{$domain}: {$product} {$version} ({$machine}/${flavour}) ***\n"; +echo "\n*** {$config['system']['hostname']}.{$config['system']['domain']}: {$version} ***\n"; $iflist = legacy_config_get_interfaces(array('virtual' => false)); diff --git a/src/sbin/opnsense-version b/src/sbin/opnsense-version index f3c3a3648..90748e93a 100755 --- a/src/sbin/opnsense-version +++ b/src/sbin/opnsense-version @@ -24,6 +24,7 @@ # POSSIBILITY OF SUCH DAMAGE. VERSION="/usr/local/opnsense/version/opnsense" +OPENSSL="/usr/local/bin/openssl" OUTPUT= if [ ! -f ${VERSION} ]; then @@ -75,4 +76,9 @@ if [ -z "${OUTPUT}" ]; then OUTPUT="\${product_name} \${product_version} \(\${product_arch}/\${product_flavour}\)" fi +if [ -z "${OUTPUT%%*product_flavour*}" -a -f ${OPENSSL} ]; then + RESULT=$(${OPENSSL} version) + product_flavour=${RESULT%% *} +fi + eval echo ${OUTPUT} diff --git a/src/www/crash_reporter.php b/src/www/crash_reporter.php index 95c95bde5..9c0357d70 100644 --- a/src/www/crash_reporter.php +++ b/src/www/crash_reporter.php @@ -65,14 +65,16 @@ include('head.inc'); $plugins = implode(' ', explode("\n", shell_exec('pkg info -g "os-*"'))); $crash_report_header = sprintf( - "%s\n%s %s (%s/%s)\n%sTime %s\n", + "%s %s\n%s %s %s\n%sTime %s\n%s\nPHP %s\n", php_uname('v'), - $g['product_name'], - "{$g['product_version']}-{$g['product_hash']}", $g['product_arch'], - $g['product_flavour'], + $g['product_name'], + $g['product_version'], + $g['product_hash'], empty($plugins) ? '' : "Plugins $plugins\n", - date('r') + date('r'), + OPENSSL_VERSION_TEXT, + PHP_VERSION ); if (isset($_SERVER['HTTP_USER_AGENT'])) {