summaryrefslogtreecommitdiffstats
path: root/source/rpc_client
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1999-12-08 21:43:03 +0000
committerLuke Leighton <lkcl@samba.org>1999-12-08 21:43:03 +0000
commit30c7fdd6ef10ecd35594311c1b250b95ff895489 (patch)
tree0eef964462f04360126253f57fa326923c1882ef /source/rpc_client
parent2245b0c6d13c7c5886e81f9137b05df883598c26 (diff)
downloadsamba-30c7fdd6ef10ecd35594311c1b250b95ff895489.tar.gz
samba-30c7fdd6ef10ecd35594311c1b250b95ff895489.tar.xz
samba-30c7fdd6ef10ecd35594311c1b250b95ff895489.zip
ABOUT TIME!!!!!!!!
damn, this one is bad. started, at least two days ago, to add an authentication mechanism to the smbd<->msrpc redirector/relay, such that sufficient unix / nt information could be transferred across the unix socket to do a become_user() on the other side of the socket. it is necessary that the msrpc daemon inherit the same unix and nt credentials as the smbd process from which it was spawned, until such time as the msrpc daemon receives an authentication request of its own, whereupon the msrpc daemon is responsible for authenticating the new credentials and doing yet another become_user() etc sequence.
Diffstat (limited to 'source/rpc_client')
-rw-r--r--source/rpc_client/cli_connect.c11
-rw-r--r--source/rpc_client/cli_lsarpc.c8
-rw-r--r--source/rpc_client/cli_use.c22
3 files changed, 22 insertions, 19 deletions
diff --git a/source/rpc_client/cli_connect.c b/source/rpc_client/cli_connect.c
index 147be96ba4e..f935b530444 100644
--- a/source/rpc_client/cli_connect.c
+++ b/source/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/source/rpc_client/cli_lsarpc.c b/source/rpc_client/cli_lsarpc.c
index 665383ca103..1cf584a29bc 100644
--- a/source/rpc_client/cli_lsarpc.c
+++ b/source/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/source/rpc_client/cli_use.c b/source/rpc_client/cli_use.c
index 93a85d748d9..96122c307dd 100644
--- a/source/rpc_client/cli_use.c
+++ b/source/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)
{