add NETRC_FILE to allow passing credentials into kas home

Tools like wget and git can read credentials from $HOME/.netrc for
servers that require authentication. Allow users to pass in a .netrc
file into the kas home dir to support i.e. bitbake https fetching with
auth.

Signed-off-by: Henning Schild <henning.schild@siemens.com>
[Jan: style fix in command-line.rst]
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
Henning Schild
2022-06-23 14:51:22 +02:00
committed by Jan Kiszka
parent a8b69f5bd4
commit 71cf5dc17b
3 changed files with 19 additions and 2 deletions

View File

@@ -435,6 +435,11 @@ if [ -n "${GIT_CREDENTIAL_HELPER}" ] ; then
set -- "$@" -e GIT_CREDENTIAL_HELPER="${GIT_CREDENTIAL_HELPER}"
fi
if [ -f "${NETRC_FILE}" ]; then
set -- "$@" -v "$(readlink -f "${NETRC_FILE}")":/etc/skel/.netrc:ro \
-e NETRC_FILE="/etc/skel/.netrc"
fi
if [ -t 1 ]; then
set -- "$@" -t -i
fi