From: M Hickford via GitGitGadget <hidden> Date: 2024-02-18 22:51:37
From: M Hickford <redacted>
Since 0ce02e2f (credential/libsecret: store new attributes, 2023-06-16)
a test that stores empty username and password fails when
t0303-credential-external.sh is run with
GIT_TEST_CREDENTIAL_HELPER=libsecret.
Retrieve empty password carefully. This fixes test:
ok 14 - helper (libsecret) can store empty username
Signed-off-by: M Hickford <redacted>
---
libsecret: retrieve empty password
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1676%2Fhickford%2Flibsecret-empty-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1676/hickford/libsecret-empty-v1
Pull-Request: https://github.com/git/git/pull/1676
contrib/credential/libsecret/git-credential-libsecret.c | 3 +++
1 file changed, 3 insertions(+)
From: Patrick Steinhardt <hidden> Date: 2024-02-19 06:09:07
On Sun, Feb 18, 2024 at 10:51:34PM +0000, M Hickford via GitGitGadget wrote:
quoted hunk
From: M Hickford <redacted>
Since 0ce02e2f (credential/libsecret: store new attributes, 2023-06-16)
a test that stores empty username and password fails when
t0303-credential-external.sh is run with
GIT_TEST_CREDENTIAL_HELPER=libsecret.
Retrieve empty password carefully. This fixes test:
ok 14 - helper (libsecret) can store empty username
Signed-off-by: M Hickford <redacted>
---
libsecret: retrieve empty password
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1676%2Fhickford%2Flibsecret-empty-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1676/hickford/libsecret-empty-v1
Pull-Request: https://github.com/git/git/pull/1676
contrib/credential/libsecret/git-credential-libsecret.c | 3 +++
1 file changed, 3 insertions(+)
@@ -164,6 +164,9 @@ static int keyring_get(struct credential *c)if(g_strv_length(parts)>=1){g_free(c->password);c->password=g_strdup(parts[0]);+}else{+g_free(c->password);+c->password=strdup("");
Shouldn't we use `g_strdup()` here, like we do everywhere else in this
credential helper?
Patrick
}
for (int i = 1; i < g_strv_length(parts); i++) {
if (g_str_has_prefix(parts[i], "password_expiry_utc=")) {
base-commit: 3e0d3cd5c7def4808247caf168e17f2bbf47892b
--
gitgitgadget