summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1999-12-03 22:02:03 +0000
committerLuke Leighton <lkcl@samba.org>1999-12-03 22:02:03 +0000
commitc2a3b11b0738f57accafe19c84b682f761fa9631 (patch)
tree4b9f28894efb7376d2ea987adb791906e5e54076 /source3/libsmb
parent5db56cfce45b58087fdadeb842f08a5b75d828c9 (diff)
downloadsamba-c2a3b11b0738f57accafe19c84b682f761fa9631.tar.gz
samba-c2a3b11b0738f57accafe19c84b682f761fa9631.tar.bz2
samba-c2a3b11b0738f57accafe19c84b682f761fa9631.zip
starting "connection reuse" system in smb-agent. added version number
which isn't actually used right now :-) (This used to be commit d54a64ae3ab7cdc1ac67fb49f7255e6a106d624e)
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/clientgen.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c
index 176be9948b..3695680301 100644
--- a/source3/libsmb/clientgen.c
+++ b/source3/libsmb/clientgen.c
@@ -40,6 +40,7 @@ void copy_user_creds(struct user_credentials *to,
to->user_name[0] = 0;
pwd_set_nullpwd(&to->pwd);
to->ntlmssp_flags = 0;
+ to->reuse = False;
return;
}
@@ -47,6 +48,7 @@ void copy_user_creds(struct user_credentials *to,
safe_strcpy(to->user_name, from->user_name, sizeof(from->user_name)-1);
memcpy(&to->pwd, &from->pwd, sizeof(from->pwd));
to->ntlmssp_flags = from->ntlmssp_flags;
+ to->reuse = from->reuse;
};
int cli_set_port(struct cli_state *cli, int port)
@@ -785,6 +787,12 @@ BOOL cli_session_setup_x(struct cli_state *cli,
char *p;
BOOL esec = cli->capabilities & CAP_EXTENDED_SECURITY;
+ if (cli->usr.reuse)
+ {
+ DEBUG(3,("cli_session_setup_x: reuse enabled, skipping SMBsesssetupX\n"));
+ return True;
+ }
+
DEBUG(100,("cli_session_setup. extended security: %s\n",
BOOLSTR(esec)));
@@ -1063,6 +1071,12 @@ BOOL cli_session_setup(struct cli_state *cli,
BOOL cli_ulogoff(struct cli_state *cli)
{
+ if (cli->usr.reuse)
+ {
+ DEBUG(3,("cli_ulogoff: reuse enabled, skipping SMBulogoff\n"));
+ return True;
+ }
+
bzero(cli->outbuf,smb_size);
set_message(cli->outbuf,2,0,True);
CVAL(cli->outbuf,smb_com) = SMBulogoffX;
@@ -2981,6 +2995,12 @@ static int cli_init_redirect(struct cli_state *cli,
ZERO_STRUCT(data);
p = &data[4];
+ SSVAL(p, 0, 0);
+ p += 2;
+
+ SSVAL(p, 0, usr->reuse ? AGENT_CMD_CON_REUSE : AGENT_CMD_CON);
+ p += 2;
+
safe_strcpy(p, srv_name, 16);
p = skip_string(p, 1);
safe_strcpy(p, usr != NULL ? usr->user_name : "", 16);