wincred: handle empty username/password correctly
commit44add4550882c3bff5d9ebbb6eb2b47cc0505118
authorJakub Bereżański <kuba@berezanscy.pl>
Wed, 26 Jun 2013 09:07:55 +0000 (26 11:07 +0200)
committerJakub Bereżański <kuba@berezanscy.pl>
Wed, 26 Jun 2013 12:08:19 +0000 (26 14:08 +0200)
treec5291619245ebfaa7fd5396e2a6183184192cbad
parent6d82492a0267397e0e4af6eda2bff7887080e263
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