Skip to content

Commit

Permalink
cleanup(): For option --keep-tmp, do not try to remove temp-session
Browse files Browse the repository at this point in the history
The temp-session has been moved to temp-storage, so cannot be removed.

Signed-off-by: Richard T Bonhomme <[email protected]>
  • Loading branch information
TinCanTech committed Jan 6, 2024
1 parent 75dcfe6 commit 2e9b869
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions easyrsa3/easyrsa
Original file line number Diff line number Diff line change
Expand Up @@ -902,12 +902,15 @@ Temporary session not preserved."
rm -rf "$keep_tmp"
mv -f "$secured_session" "$keep_tmp"
print "Temp session preserved: $keep_tmp"
unset -v secured_session
fi
fi

# remove temp-session
remove_secure_session || \
warn "cleanup - remove_secure_session failed"
if [ "$secured_session" ]; then
remove_secure_session || \
warn "cleanup - remove_secure_session failed"
fi
fi

# shellcheck disable=SC3040 # POSIX set - cleanup()
Expand Down

0 comments on commit 2e9b869

Please sign in to comment.