summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2011-05-29 13:38:20 +0200
committerVolker Lendecke <vl@samba.org>2011-05-29 14:39:12 +0200
commit7d47e65e326b5327f013bf2b4f448ee37172407d (patch)
tree48607ab0f262360df865b65283c5a4fc6319ff0f
parent5676f817c747feb1b2e4e100e5083e2ad75ce421 (diff)
downloadsamba-7d47e65e326b5327f013bf2b4f448ee37172407d.tar.gz
samba-7d47e65e326b5327f013bf2b4f448ee37172407d.tar.bz2
samba-7d47e65e326b5327f013bf2b4f448ee37172407d.zip
s3: Use cli_connect_nb in nmbd sync_child
-rw-r--r--source3/nmbd/nmbd_synclists.c22
1 files changed, 4 insertions, 18 deletions
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;
}