Keep the command line account email out of account.conf's way
_initpath sources account.conf (twice, counting __initHome), and the assignment overwrote the ACCOUNT_EMAIL that -m had just exported, so --update-account -m sent the saved address instead of the given one. It also short-circuited _getAccountEmail, whose first branch is meant for the live value: the saved global address then won over the per-CA CA_EMAIL as well. Save the live value before the sourcing and restore it after. The saved address is still reached, by the _readaccountconf at the end of _getAccountEmail, which is where it belongs in the order.
This commit is contained in:
@@ -3475,12 +3475,22 @@ _initpath() {
|
||||
domain="$1"
|
||||
_ilength="$2"
|
||||
|
||||
#Keep the live ACCOUNT_EMAIL, the one -m exported in _process() or the
|
||||
#caller put in the environment. account.conf is sourced twice below (here
|
||||
#and inside __initHome), and a sourced assignment would overwrite it with
|
||||
#the saved address, so -m silently lost to whatever account.conf held.
|
||||
#The saved address is not lost either way: _getAccountEmail() reads it
|
||||
#with _readaccountconf as its last resort, after the per-CA CA_EMAIL.
|
||||
_cli_account_email="$ACCOUNT_EMAIL"
|
||||
|
||||
__initHome
|
||||
|
||||
if [ -f "$ACCOUNT_CONF_PATH" ]; then
|
||||
. "$ACCOUNT_CONF_PATH"
|
||||
fi
|
||||
|
||||
ACCOUNT_EMAIL="$_cli_account_email"
|
||||
|
||||
if [ "$_ACME_IN_CRON" ]; then
|
||||
if [ ! "$_USER_PATH_EXPORTED" ]; then
|
||||
_USER_PATH_EXPORTED=1
|
||||
|
||||
Reference in New Issue
Block a user