From fbdcf2663b56007a438ac4f0d8d82436b1bfe688 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 11 Jul 2006 18:01:26 +0000 Subject: r16945: Sync trunk -> 3.0 for 3.0.24 code. Still need to do the upper layer directories but this is what everyone is waiting for.... Jeremy. (This used to be commit 9dafb7f48ca3e7af956b0a7d1720c2546fc4cfb8) --- source3/nmbd/nmbd_synclists.c | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) (limited to 'source3/nmbd') diff --git a/source3/nmbd/nmbd_synclists.c b/source3/nmbd/nmbd_synclists.c index 28ad92ed10..0e67c3f69c 100644 --- a/source3/nmbd/nmbd_synclists.c +++ b/source3/nmbd/nmbd_synclists.c @@ -68,7 +68,7 @@ static void sync_child(char *name, int nm_type, char *fname) { fstring unix_workgroup; - static struct cli_state cli; + struct cli_state *cli; uint32 local_type = local ? SV_TYPE_LOCAL_LIST_ONLY : 0; struct nmb_name called, calling; @@ -76,50 +76,55 @@ static void sync_child(char *name, int nm_type, * Patch from Andy Levine andyl@epicrealm.com. */ - if (!cli_initialise(&cli) || !cli_set_port(&cli, 139) || !cli_connect(&cli, name, &ip)) { + cli = cli_initialise(); + if (!cli) { + return; + } + + if (!cli_set_port(cli, 139) || !cli_connect(cli, name, &ip)) { return; } make_nmb_name(&calling, local_machine, 0x0); make_nmb_name(&called , name, nm_type); - if (!cli_session_request(&cli, &calling, &called)) { - cli_shutdown(&cli); + if (!cli_session_request(cli, &calling, &called)) { + cli_shutdown(cli); return; } - if (!cli_negprot(&cli)) { - cli_shutdown(&cli); + if (!cli_negprot(cli)) { + cli_shutdown(cli); return; } - if (!cli_session_setup(&cli, "", "", 1, "", 0, workgroup)) { - cli_shutdown(&cli); + if (!cli_session_setup(cli, "", "", 1, "", 0, workgroup)) { + cli_shutdown(cli); return; } - if (!cli_send_tconX(&cli, "IPC$", "IPC", "", 1)) { - cli_shutdown(&cli); + if (!cli_send_tconX(cli, "IPC$", "IPC", "", 1)) { + cli_shutdown(cli); return; } /* All the cli_XX functions take UNIX character set. */ - fstrcpy(unix_workgroup, cli.server_domain?cli.server_domain:workgroup); + fstrcpy(unix_workgroup, cli->server_domain ? cli->server_domain : workgroup); /* Fetch a workgroup list. */ - cli_NetServerEnum(&cli, unix_workgroup, + cli_NetServerEnum(cli, unix_workgroup, local_type|SV_TYPE_DOMAIN_ENUM, callback, NULL); /* Now fetch a server list. */ if (servers) { fstrcpy(unix_workgroup, workgroup); - cli_NetServerEnum(&cli, unix_workgroup, + cli_NetServerEnum(cli, unix_workgroup, local?SV_TYPE_LOCAL_LIST_ONLY:SV_TYPE_ALL, callback, NULL); } - cli_shutdown(&cli); + cli_shutdown(cli); } /******************************************************************* -- cgit