X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=credential.c;fp=credential.c;h=8825c6f132018c8527563c4ca0f1a1ea747b92e0;hb=aeb21ce22eec112b37975443a160cb5418c6ec22;hp=023b59d5711cf2fede0aa0408b47a1a6f64df059;hpb=fe86abd7511a9a6862d5706c6fa1d9b57a63ba09;p=thirdparty%2Fgit.git diff --git a/credential.c b/credential.c index 023b59d571..8825c6f132 100644 --- a/credential.c +++ b/credential.c @@ -33,13 +33,14 @@ void credential_clear(struct credential *c) } int credential_match(const struct credential *want, - const struct credential *have) + const struct credential *have, int match_password) { #define CHECK(x) (!want->x || (have->x && !strcmp(want->x, have->x))) return CHECK(protocol) && CHECK(host) && CHECK(path) && - CHECK(username); + CHECK(username) && + (!match_password || CHECK(password)); #undef CHECK } @@ -102,7 +103,7 @@ static int match_partial_url(const char *url, void *cb) warning(_("skipping credential lookup for key: credential.%s"), url); else - matches = credential_match(&want, c); + matches = credential_match(&want, c, 0); credential_clear(&want); return matches;