diff options
author | Matthew John Cheetham <mjcheetham@outlook.com> | 2022-09-22 19:59:32 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-09-23 00:20:37 +0300 |
commit | d69580498370236a93014e1b1b57685d1709b6c8 (patch) | |
tree | 9b879d7cee1ad14933735f867c046452ae63cd4e /contrib | |
parent | 1b3d6e17fe83eb6f79ffbac2f2c61bbf1eaef5f8 (diff) |
wincred: ignore unknown lines (do not die)
It is the expectation that credential helpers be liberal in what they
accept and conservative in what they return, to allow for future growth
and evolution of the protocol/interaction.
All of the other helpers (store, cache, osxkeychain, libsecret,
gnome-keyring) except `netrc` currently ignore any credential lines
that are not recognised, whereas the Windows helper (wincred) instead
dies.
Fix the discrepancy and ignore unknown lines in the wincred helper.
Signed-off-by: Matthew John Cheetham <mjcheetham@outlook.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/credential/wincred/git-credential-wincred.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/contrib/credential/wincred/git-credential-wincred.c b/contrib/credential/wincred/git-credential-wincred.c index 5091048f9c..ead6e267c7 100644 --- a/contrib/credential/wincred/git-credential-wincred.c +++ b/contrib/credential/wincred/git-credential-wincred.c @@ -278,8 +278,11 @@ static void read_credential(void) wusername = utf8_to_utf16_dup(v); } else if (!strcmp(buf, "password")) password = utf8_to_utf16_dup(v); - else - die("unrecognized input"); + /* + * Ignore other lines; we don't know what they mean, but + * this future-proofs us when later versions of git do + * learn new lines, and the helpers are updated to match. + */ } } |