Skip to content

Commit

Permalink
Improve detect_host() and show_host()
Browse files Browse the repository at this point in the history
Squashed commit of the following:

commit 5d48d39891b8ecd8c34f6faef1de06d327ed2b18
Merge: c905f09 2cfc18c
Author: Richard T Bonhomme <tincantech@protonmail.com>
Date:   Thu Nov 3 21:56:48 2022 +0000

    Merge branch 'restrain-detect_host' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-restrain-detect_host

    Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>

commit 2cfc18c
Author: Richard T Bonhomme <tincantech@protonmail.com>
Date:   Thu Nov 3 21:15:09 2022 +0000

    Improve detect_host() and show_host()

    These changes make reductions to:
    - The effects of detect_host()
    - The output of show_host()

    detect_host:
    - Does not set an SSL library.
    - Is not essential, so can be run before all other essential code.

    show_host:
    - Only show extended details for -v 'verbose' output.

    Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
  • Loading branch information
TinCanTech committed Nov 3, 2022
1 parent c905f09 commit 82483f1
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions easyrsa3/easyrsa
Original file line number Diff line number Diff line change
Expand Up @@ -3920,7 +3920,7 @@ detect_host() {
easyrsa_shell="$SHELL (Git)"
easyrsa_win_git_bash="${EXEPATH}"
# If found then set openssl NOW!
[ -e /usr/bin/openssl ] && set_var EASYRSA_OPENSSL /usr/bin/openssl
#[ -e /usr/bin/openssl ] && set_var EASYRSA_OPENSSL /usr/bin/openssl
fi
else
easyrsa_host_os=nix
Expand All @@ -3943,7 +3943,8 @@ detect_host() {
# Extra diagnostics
show_host() {
print_version
print "$host_out | ${ssl_version:-ssl_version not currently set}"
[ "$EASYRSA_VERBOSE" ] || return 0
print "$host_out"
[ "$EASYRSA_DEBUG" ] || return 0
case "$easyrsa_host_os" in
win) set ;;
Expand Down Expand Up @@ -4890,6 +4891,9 @@ trap "exit 3" 3
trap "exit 6" 6
trap "exit 14" 15

# Get host details - No configurable input allowed
detect_host

# Initialisation requirements
unset -v die_error_exit easyrsa_error_exit \
user_san_true user_vars_true alias_days
Expand Down Expand Up @@ -5077,9 +5081,6 @@ case "$cmd" in
unset -v no_pki_required
esac

# Get host details - does not require vars_setup
detect_host

# Mutual exclusions
# --nopass cannot be used with --passin and --passout
if [ "$EASYRSA_NO_PASS" ] && \
Expand Down

0 comments on commit 82483f1

Please sign in to comment.