From 7d47e65e326b5327f013bf2b4f448ee37172407d Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 29 May 2011 13:38:20 +0200 Subject: s3: Use cli_connect_nb in nmbd sync_child --- source3/nmbd/nmbd_synclists.c | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) (limited to 'source3/nmbd/nmbd_synclists.c') diff --git a/source3/nmbd/nmbd_synclists.c b/source3/nmbd/nmbd_synclists.c index 243222b675..964975e1a5 100644 --- a/source3/nmbd/nmbd_synclists.c +++ b/source3/nmbd/nmbd_synclists.c @@ -72,7 +72,6 @@ static void sync_child(char *name, int nm_type, fstring unix_workgroup; struct cli_state *cli; uint32 local_type = local ? SV_TYPE_LOCAL_LIST_ONLY : 0; - struct nmb_name called, calling; struct sockaddr_storage ss; NTSTATUS status; @@ -80,25 +79,12 @@ static void sync_child(char *name, int nm_type, * Patch from Andy Levine andyl@epicrealm.com. */ - cli = cli_initialise(); - if (!cli) { - return; - } - - cli_set_port(cli, 139); - in_addr_to_sockaddr_storage(&ss, ip); - status = cli_connect(cli, name, &ss); - if (!NT_STATUS_IS_OK(status)) { - cli_shutdown(cli); - return; - } - - make_nmb_name(&calling, get_local_machine_name(), 0x0); - make_nmb_name(&called , name, nm_type); - if (!cli_session_request(cli, &calling, &called)) { - cli_shutdown(cli); + status = cli_connect_nb(name, &ss, 139, nm_type, + get_local_machine_name(), Undefined, + &cli); + if (!NT_STATUS_IS_OK(status)) { return; } -- cgit