wincred: handle empty username/password correctly
commit52ab6cbbc312f16d96456f8ea8a2e7e81ba043ac
authorJakub Bereżański <kuba@berezanscy.pl>
Wed, 26 Jun 2013 09:07:55 +0000 (26 11:07 +0200)
committerKarsten Blees <blees@dcon.de>
Sat, 16 Aug 2014 00:59:53 +0000 (16 02:59 +0200)
tree33ffb3601738a1ee1375634eae51c079779f392e
parent0dd0cfbcb6d9043c99d6d9ae5e32f0197c74a481
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