summaryrefslogtreecommitdiff
path: root/source3/nmbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-07-11 18:01:26 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:19:14 -0500
commitfbdcf2663b56007a438ac4f0d8d82436b1bfe688 (patch)
tree4e42c1f061391cea3d640152fd240682cbf4fd9a /source3/nmbd
parent5bf62a0c3cc95abe918f3e772bb10e0a90fdce22 (diff)
downloadsamba-fbdcf2663b56007a438ac4f0d8d82436b1bfe688.tar.gz
samba-fbdcf2663b56007a438ac4f0d8d82436b1bfe688.tar.bz2
samba-fbdcf2663b56007a438ac4f0d8d82436b1bfe688.zip
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)
Diffstat (limited to 'source3/nmbd')
-rw-r--r--source3/nmbd/nmbd_synclists.c33
1 files changed, 19 insertions, 14 deletions
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);
}
/*******************************************************************