Closed thaJeztah closed 1 year ago
I'll do a follow-up to improve the home-dir lookup (now that we made pass
compile for other platforms as well), but making this fix separate first.
Patch coverage: 50.00
% and no project coverage change.
Comparison is base (
2860ca4
) 54.68% compared to head (372315b
) 54.68%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
@crazy-max ptal 😅
Added a commit to use os.UserHomeDir()
PTAL
commit a13ff500176e7570239691424050fb46b0a7f05b (https://github.com/docker/docker-credential-helpers/pull/109) simplified the handling of env-vars in getPassDir(), but moved interpolation of env-vars to the end of the function.
As a result, a custom path passed through
$PASSWORD_STORE_DIR
would now be interpolated, instead of taken as-is. For example;Would now interpolate
$PWD
, instead of using a literal$PWD
.This patch changes the logic to only expand env-vars for the default location.
pass: make home-dir resolution platform agnostic
Use stdlib's
os.UserHomeDir()
instead of depending only on$HOME
. Note that this does not yet does nss lookups for situations where$HOME
/$USERPROFILE
is not set.