summaryrefslogtreecommitdiff
path: root/source3/rpc_client
diff options
context:
space:
mode:
Diffstat (limited to 'source3/rpc_client')
-rw-r--r--source3/rpc_client/cli_connect.c11
-rw-r--r--source3/rpc_client/cli_lsarpc.c8
-rw-r--r--source3/rpc_client/cli_use.c22
3 files changed, 22 insertions, 19 deletions
diff --git a/source3/rpc_client/cli_connect.c b/source3/rpc_client/cli_connect.c
index 147be96ba4..f935b53044 100644
--- a/source3/rpc_client/cli_connect.c
+++ b/source3/rpc_client/cli_connect.c
@@ -24,7 +24,7 @@
#include "includes.h"
-struct user_credentials *usr_creds = NULL;
+struct ntuser_creds *usr_creds = NULL;
extern int DEBUGLEVEL;
extern pstring scope;
@@ -35,7 +35,7 @@ struct cli_connection
uint32 num_connections;
char *srv_name;
char *pipe_name;
- struct user_credentials usr_creds;
+ struct ntuser_creds usr_creds;
struct cli_state *cli;
uint16 fnum;
};
@@ -74,7 +74,7 @@ void free_connections(void)
}
static struct cli_connection *cli_con_get(const char* srv_name,
- const char* pipe_name)
+ const char* pipe_name, BOOL reuse)
{
struct cli_connection *con = NULL;
@@ -96,7 +96,7 @@ static struct cli_connection *cli_con_get(const char* srv_name,
con->pipe_name = strdup(pipe_name);
}
- con->cli = cli_net_use_add(srv_name, usr_creds, True);
+ con->cli = cli_net_use_add(srv_name, usr_creds, True, reuse);
if (con->cli == NULL)
{
@@ -181,12 +181,13 @@ BOOL cli_connection_init(const char* srv_name, const char* pipe_name,
struct cli_connection **con)
{
BOOL res = True;
+ BOOL reuse = False;
/*
* allocate
*/
- *con = cli_con_get(srv_name, pipe_name);
+ *con = cli_con_get(srv_name, pipe_name, reuse);
if ((*con) == NULL)
{
diff --git a/source3/rpc_client/cli_lsarpc.c b/source3/rpc_client/cli_lsarpc.c
index 665383ca10..1cf584a29b 100644
--- a/source3/rpc_client/cli_lsarpc.c
+++ b/source3/rpc_client/cli_lsarpc.c
@@ -44,8 +44,8 @@ BOOL get_domain_sids(const char *myname,
BOOL res1 = True;
fstring dom3;
fstring dom5;
- extern struct user_credentials *usr_creds;
- struct user_credentials usr;
+ extern struct ntuser_creds *usr_creds;
+ struct ntuser_creds usr;
usr_creds = &usr;
ZERO_STRUCT(usr);
@@ -140,8 +140,8 @@ BOOL get_trust_sid_and_domain(const char* myname, char *server,
fstring dom3;
fstring dom5;
- extern struct user_credentials *usr_creds;
- struct user_credentials usr;
+ extern struct ntuser_creds *usr_creds;
+ struct ntuser_creds usr;
usr_creds = &usr;
ZERO_STRUCT(usr);
diff --git a/source3/rpc_client/cli_use.c b/source3/rpc_client/cli_use.c
index 93a85d748d..96122c307d 100644
--- a/source3/rpc_client/cli_use.c
+++ b/source3/rpc_client/cli_use.c
@@ -110,13 +110,14 @@ find client state. server name, user name, domain name and password must all
match.
****************************************************************************/
static struct cli_use *cli_find(const char* srv_name,
- const struct user_credentials *usr_creds)
+ const struct ntuser_creds *usr_creds,
+ BOOL reuse)
{
int i;
const char *sv_name = srv_name;
- struct user_credentials null_usr;
+ struct ntuser_creds null_usr;
- copy_user_creds(&null_usr, usr_creds);
+ copy_nt_creds(&null_usr, usr_creds);
usr_creds = &null_usr;
if (strnequal("\\\\", sv_name, 2))
@@ -156,7 +157,7 @@ static struct cli_use *cli_find(const char* srv_name,
{
continue;
}
- if (!usr_creds->reuse &&
+ if (!reuse &&
!pwd_compare(&usr_creds->pwd, &c->cli->usr.pwd))
{
DEBUG(100,("password doesn't match\n"));
@@ -179,7 +180,7 @@ static struct cli_use *cli_find(const char* srv_name,
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)
+ const struct ntuser_creds *usr_creds)
{
struct cli_use *cli = (struct cli_use*)malloc(sizeof(*cli));
@@ -206,8 +207,9 @@ static struct cli_use *cli_use_get(const char* srv_name,
init client state
****************************************************************************/
struct cli_state *cli_net_use_add(const char* srv_name,
- const struct user_credentials *usr_creds,
- BOOL redir)
+ const struct ntuser_creds *usr_creds,
+ BOOL redir,
+ BOOL reuse)
{
struct nmb_name calling;
struct nmb_name called;
@@ -215,7 +217,7 @@ struct cli_state *cli_net_use_add(const char* srv_name,
fstring dest_host;
struct in_addr ip;
- struct cli_use *cli = cli_find(srv_name, usr_creds);
+ struct cli_use *cli = cli_find(srv_name, usr_creds, reuse);
if (cli != NULL)
{
@@ -224,7 +226,7 @@ struct cli_state *cli_net_use_add(const char* srv_name,
}
/* reuse an existing connection requested, and one was not found */
- if (usr_creds != NULL && usr_creds->reuse && !redir)
+ if (usr_creds != NULL && reuse && !redir)
{
return False;
}
@@ -277,7 +279,7 @@ struct cli_state *cli_net_use_add(const char* srv_name,
delete a client state
****************************************************************************/
BOOL cli_net_use_del(const char* srv_name,
- const struct user_credentials *usr_creds,
+ const struct ntuser_creds *usr_creds,
BOOL force_close,
BOOL *connection_closed)
{