diff options
Diffstat (limited to 'source3/rpc_client/cli_use.c')
-rw-r--r-- | source3/rpc_client/cli_use.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/source3/rpc_client/cli_use.c b/source3/rpc_client/cli_use.c index 31e3b69b2e..131edfeb5b 100644 --- a/source3/rpc_client/cli_use.c +++ b/source3/rpc_client/cli_use.c @@ -156,7 +156,8 @@ static struct cli_use *cli_find(const char* srv_name, { continue; } - if (!pwd_compare(&usr_creds->pwd, &c->cli->usr.pwd)) + if (!usr_creds->reuse && + !pwd_compare(&usr_creds->pwd, &c->cli->usr.pwd)) { continue; } @@ -221,6 +222,12 @@ struct cli_state *cli_net_use_add(const char* srv_name, return cli->cli; } + /* reuse an existing connection requested, and one was not found */ + if (usr_creds != NULL && usr_creds->reuse) + { + return False; + } + /* * allocate */ |