wincred: handle empty username/password correctly
commitfc861ab1ccddf106394aff3131e31d5651e7ac9a
authorJakub Bereżański <kuba@berezanscy.pl>
Wed, 26 Jun 2013 09:07:55 +0000 (26 11:07 +0200)
committerStepan Kasal <kasal@ucw.cz>
Thu, 29 May 2014 08:41:17 +0000 (29 10:41 +0200)
tree3d4508faefac474fba71811b19346420ed49e515
parent6efbe684e2657cbad82ed313cea6a03edf5b3154
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