mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
wbinfo: avoid segfault in wbinfo_auth_crap() if winbindd is not available
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13256 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
parent
b112cbc246
commit
8b0e1a77ae
@ -1798,13 +1798,22 @@ static bool wbinfo_auth_crap(char *username, bool use_ntlmv2, bool use_lanman)
|
|||||||
if (use_ntlmv2) {
|
if (use_ntlmv2) {
|
||||||
DATA_BLOB server_chal;
|
DATA_BLOB server_chal;
|
||||||
DATA_BLOB names_blob;
|
DATA_BLOB names_blob;
|
||||||
|
const char *netbios_name = NULL;
|
||||||
|
const char *domain = NULL;
|
||||||
|
|
||||||
|
netbios_name = get_winbind_netbios_name(),
|
||||||
|
domain = get_winbind_domain();
|
||||||
|
if (domain == NULL) {
|
||||||
|
d_fprintf(stderr, "Failed to get domain from winbindd\n");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
server_chal = data_blob(params.password.response.challenge, 8);
|
server_chal = data_blob(params.password.response.challenge, 8);
|
||||||
|
|
||||||
/* Pretend this is a login to 'us', for blob purposes */
|
/* Pretend this is a login to 'us', for blob purposes */
|
||||||
names_blob = NTLMv2_generate_names_blob(NULL,
|
names_blob = NTLMv2_generate_names_blob(NULL,
|
||||||
get_winbind_netbios_name(),
|
netbios_name,
|
||||||
get_winbind_domain());
|
domain);
|
||||||
|
|
||||||
if (pass != NULL &&
|
if (pass != NULL &&
|
||||||
!SMBNTLMv2encrypt(NULL, name_user, name_domain, pass,
|
!SMBNTLMv2encrypt(NULL, name_user, name_domain, pass,
|
||||||
|
Loading…
Reference in New Issue
Block a user