From: Stefan Metzmacher Date: Tue, 16 Dec 2014 11:28:41 +0000 (+0000) Subject: s3:winbindd: fix anon fallback in cm_prepare_connection() X-Git-Url: http://git.samba.org/?p=obnox%2Fsamba%2Fsamba-obnox.git;a=commitdiff_plain;h=b9e4a8b869db20eb296950750ceb110eec3e3cd8 s3:winbindd: fix anon fallback in cm_prepare_connection() We should not crash with machine_password==NULL. Bug: https://bugzilla.samba.org/show_bug.cgi?id=11010 Signed-off-by: Stefan Metzmacher Reviewed-by: Andrew Bartlett --- diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c index 94fdfdf34e9..8ce286f6b26 100644 --- a/source3/winbindd/winbindd_cm.c +++ b/source3/winbindd/winbindd_cm.c @@ -1229,16 +1229,6 @@ static NTSTATUS cm_prepare_connection(struct winbindd_domain *domain, goto done; } - creds = cli_credentials_init_anon(talloc_tos()); - if (creds == NULL) { - result = NT_STATUS_NO_MEMORY; - goto done; - } - - machine_account = cli_credentials_get_username(creds); - machine_password = cli_credentials_get_password(creds); - machine_domain = cli_credentials_get_domain(creds); - /* Fall back to anonymous connection, this might fail later */ DEBUG(10,("cm_prepare_connection: falling back to anonymous " "connection for DC %s\n", @@ -1246,14 +1236,7 @@ static NTSTATUS cm_prepare_connection(struct winbindd_domain *domain, (*cli)->use_kerberos = False; - result = cli_session_setup(*cli, - machine_account, - machine_password, - strlen(machine_password)+1, - machine_password, - strlen(machine_password)+1, - machine_domain); - + result = cli_session_setup(*cli, "", "", 0, "", 0, ""); if (NT_STATUS_IS_OK(result)) { DEBUG(5, ("Connected anonymously\n")); goto session_setup_done;