summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1999-11-30 18:01:03 +0000
committerLuke Leighton <lkcl@samba.org>1999-11-30 18:01:03 +0000
commit4435c7e166017b963195638a8214b309316ed88f (patch)
treede02ee21be626b5b1b47794b2cd43424ae72903e /source3
parent4ced9734c0e979da9f01332aacd48e20106da30f (diff)
downloadsamba-4435c7e166017b963195638a8214b309316ed88f.tar.gz
samba-4435c7e166017b963195638a8214b309316ed88f.tar.bz2
samba-4435c7e166017b963195638a8214b309316ed88f.zip
added failed connections to the net use array, even though they'd been
freed / cleaned up. oops, dat bad, cos they get freed again when u quit. (This used to be commit 3c4a6256dd790413ce96d208689e13c649787c4c)
Diffstat (limited to 'source3')
-rw-r--r--source3/rpc_client/cli_use.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/source3/rpc_client/cli_use.c b/source3/rpc_client/cli_use.c
index a032db56aa..2f79d4c2cf 100644
--- a/source3/rpc_client/cli_use.c
+++ b/source3/rpc_client/cli_use.c
@@ -45,7 +45,6 @@ static void cli_use_free(struct cli_use *cli)
{
cli_ulogoff(cli->cli);
cli_shutdown(cli->cli);
- memset(cli->cli, 0, sizeof(*cli->cli));
free(cli->cli);
free(cli);
@@ -148,7 +147,6 @@ create a new client state from user credentials
****************************************************************************/
static struct cli_use *cli_use_get(const char* srv_name,
const struct user_credentials *usr_creds)
-
{
struct cli_use *cli = (struct cli_use*)malloc(sizeof(*cli));
@@ -171,8 +169,6 @@ static struct cli_use *cli_use_get(const char* srv_name,
cli->cli->use_ntlmv2 = lp_client_ntlmv2();
- add_cli_to_array(&num_clis, &clis, cli);
-
return cli;
}
@@ -203,13 +199,14 @@ struct cli_state *cli_net_use_addlist(char* servers,
if (!cli_connect_serverlist(cli->cli, servers))
{
- DEBUG(0,("cli_use_init: connection failed\n"));
+ DEBUG(0,("cli_net_use_addlist: connection failed\n"));
cli_use_free(cli);
return NULL;
}
cli->cli->ntlmssp_cli_flgs = 0x0;
+ add_cli_to_array(&num_clis, &clis, cli);
cli->num_users++;
return cli->cli;
@@ -264,13 +261,14 @@ struct cli_state *cli_net_use_add(const char* srv_name,
"IPC$", "IPC",
False, True))
{
- DEBUG(0,("cli_use_init: connection failed\n"));
+ DEBUG(0,("cli_net_use_add: connection failed\n"));
cli_use_free(cli);
return NULL;
}
cli->cli->ntlmssp_cli_flgs = 0x0;
+ add_cli_to_array(&num_clis, &clis, cli);
cli->num_users++;
return cli->cli;
@@ -286,6 +284,11 @@ BOOL cli_net_use_del(const char* srv_name,
{
int i;
const char *sv_name = srv_name;
+
+ DEBUG(10,("cli_net_use_del: %s. force close: %s\n",
+ srv_name, BOOLSTR(force_close)));
+ dbgflush();
+
if (strnequal("\\\\", sv_name, 2))
{
sv_name = &sv_name[2];
@@ -315,6 +318,11 @@ BOOL cli_net_use_del(const char* srv_name,
{
/* decrement number of users */
clis[i]->num_users--;
+
+ DEBUG(10,("idx: %i num_users now: %d\n",
+ i, clis[i]->num_users));
+ dbgflush();
+
if (force_close || clis[i]->num_users == 0)
{
cli_use_free(clis[i]);