diff options
Diffstat (limited to 'source/lib/msrpc-client.c')
-rw-r--r-- | source/lib/msrpc-client.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/source/lib/msrpc-client.c b/source/lib/msrpc-client.c index 0beaed85b47..8adfa65043b 100644 --- a/source/lib/msrpc-client.c +++ b/source/lib/msrpc-client.c @@ -202,6 +202,7 @@ void msrpc_sockopt(struct msrpc_state *msrpc, char *options) static BOOL msrpc_authenticate(struct msrpc_state *msrpc, + const vuser_key *key, const struct user_creds *usr) { struct msrpc_state msrpc_redir; @@ -217,7 +218,7 @@ static BOOL msrpc_authenticate(struct msrpc_state *msrpc, command = usr != NULL ? AGENT_CMD_CON : AGENT_CMD_CON_ANON; if (!create_user_creds(&ps, msrpc->pipe_name, 0x0, command, - msrpc->pid, usr)) + key, usr)) { DEBUG(0,("could not parse credentials\n")); close(sock); @@ -267,6 +268,7 @@ static BOOL msrpc_authenticate(struct msrpc_state *msrpc, } static BOOL msrpc_init_redirect(struct msrpc_state *msrpc, + const vuser_key *key, const char* pipe_name, const struct user_creds *usr) { @@ -284,7 +286,7 @@ static BOOL msrpc_init_redirect(struct msrpc_state *msrpc, msrpc->fd = sock; - if (!msrpc_authenticate(msrpc, usr)) + if (!msrpc_authenticate(msrpc, key, usr)) { DEBUG(0,("authenticate failed\n")); close(msrpc->fd); @@ -296,12 +298,12 @@ static BOOL msrpc_init_redirect(struct msrpc_state *msrpc, } BOOL msrpc_connect_auth(struct msrpc_state *msrpc, - uint32 pid, + const vuser_key *key, const char* pipename, const struct user_creds *usr) { ZERO_STRUCTP(msrpc); - if (!msrpc_initialise(msrpc, pid)) + if (!msrpc_initialise(msrpc, key)) { DEBUG(0,("unable to initialise msrpcent connection.\n")); return False; @@ -309,7 +311,7 @@ BOOL msrpc_connect_auth(struct msrpc_state *msrpc, msrpc_init_creds(msrpc, usr); - if (!msrpc_establish_connection(msrpc, pipename)) + if (!msrpc_establish_connection(msrpc, key, pipename)) { msrpc_shutdown(msrpc); return False; @@ -321,7 +323,8 @@ BOOL msrpc_connect_auth(struct msrpc_state *msrpc, /**************************************************************************** initialise a msrpcent structure ****************************************************************************/ -struct msrpc_state *msrpc_initialise(struct msrpc_state *msrpc, uint32 pid) +struct msrpc_state *msrpc_initialise(struct msrpc_state *msrpc, + const vuser_key *key) { if (!msrpc) { msrpc = (struct msrpc_state *)malloc(sizeof(*msrpc)); @@ -346,7 +349,7 @@ struct msrpc_state *msrpc_initialise(struct msrpc_state *msrpc, uint32 pid) msrpc->initialised = 1; msrpc_init_creds(msrpc, NULL); - msrpc->pid = pid; + msrpc->nt.key.vuid = UID_FIELD_INVALID; return msrpc; } @@ -374,7 +377,8 @@ void msrpc_shutdown(struct msrpc_state *msrpc) establishes a connection right up to doing tconX, reading in a password. ****************************************************************************/ BOOL msrpc_establish_connection(struct msrpc_state *msrpc, - const char *pipe_name) + const vuser_key *key, + const char *pipe_name) { DEBUG(5,("msrpc_establish_connection: connecting to %s (%s) - %s\n", pipe_name, @@ -389,7 +393,7 @@ BOOL msrpc_establish_connection(struct msrpc_state *msrpc, if (msrpc->fd == -1 && msrpc->redirect) { - if (msrpc_init_redirect(msrpc, pipe_name, &msrpc->usr)) + if (msrpc_init_redirect(msrpc, key, pipe_name, &msrpc->usr)) { DEBUG(10,("msrpc_establish_connection: redirected OK\n")); return True; @@ -411,7 +415,7 @@ BOOL msrpc_establish_connection(struct msrpc_state *msrpc, } } - if (!msrpc_authenticate(msrpc, &msrpc->usr)) + if (!msrpc_authenticate(msrpc, key, &msrpc->usr)) { DEBUG(0,("authenticate failed\n")); close(msrpc->fd); |