wincred: handle empty username/password correctly
commit36125430ae085018aebd9b7affeb0e5ae7e10a2f
authorJakub Bereżański <kuba@berezanscy.pl>
Wed, 26 Jun 2013 09:07:55 +0000 (26 11:07 +0200)
committerStepan Kasal <kasal@ucw.cz>
Wed, 16 Apr 2014 14:32:20 +0000 (16 16:32 +0200)
tree8b1d473555d44f0e1bb745cfaf163cf3215b2595
parent68a67384bb7f3de6d1edd55532ebbe32b6e33ad8
wincred: handle empty username/password correctly

Empty (length 0) usernames and/or passwords, when saved in the Windows
Credential Manager, come back as null when reading the credential.

One use case for such empty credentials is with NTLM authentication, where
empty username and password instruct libcurl to authenticate using the
credentials of the currently logged-on user (single sign-on).

When locating the relevant credentials, make empty username match null.
When outputting the credentials, handle nulls correctly.

Signed-off-by: Jakub Bereżański <kuba@berezanscy.pl>
contrib/credential/wincred/git-credential-wincred.c