]> git.ipfire.org Git - thirdparty/git.git/commit
credential/libsecret: erase matching creds only
authorM Hickford <mirth.hickford@gmail.com>
Wed, 26 Jul 2023 19:46:54 +0000 (19:46 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 26 Jul 2023 20:27:31 +0000 (13:27 -0700)
commit7144dee3ec233674ba534797e41fa399708c8313
treea0c6881894305e2865cc6fc4a074c658d503e0bd
parent6c26da8404c8acfed62fa4775b7b591f099bcd33
credential/libsecret: erase matching creds only

The credential erase request typically includes protocol, host, username
and password.

credential-libsecret erases a stored credential if it matches protocol,
host and username, regardless of password.

This is confusing in the case the stored password differs from that
in the request. This case can occur when multiple credential helpers are
configured.

Only erase credential if stored password matches request (or request
omits password).

This fixes test "helper (libsecret) does not erase a password distinct
from input" when t0303 is run with GIT_TEST_CREDENTIAL_HELPER set to
"libsecret". This test was added in aeb21ce22e (credential: avoid
erasing distinct password, 2023-06-13).

Signed-off-by: M Hickford <mirth.hickford@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/credential/libsecret/git-credential-libsecret.c