1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-11 16:58:40 +03:00

Remove the password length paramater from cli_full_connection - it really

didn't make any sense, and its was always just strlen(password) anyway.

This fixes it to be strlen(password)+1

Andrew Bartlett
(This used to be commit c205b18bd6b9b69200ff3db55f2c641631d4ab40)
This commit is contained in:
Andrew Bartlett 2002-05-24 05:14:16 +00:00
parent 40669777a5
commit 9c3d5d6fd0
8 changed files with 14 additions and 13 deletions

View File

@ -127,7 +127,7 @@ static NTSTATUS connect_to_domain_password_server(struct cli_state **cli,
/* Attempt connection */
result = cli_full_connection(cli, global_myname, server,
&dest_ip, 0, "IPC$", "IPC", "", "", "", 0);
&dest_ip, 0, "IPC$", "IPC", "", "", "");
if (!NT_STATUS_IS_OK(result)) {
release_server_mutex();

View File

@ -1030,7 +1030,7 @@ BOOL cli_connect(struct cli_state *cli, const char *host, struct in_addr *ip)
/* Initialise client credentials for authenticated pipe access */
static void init_creds(struct ntuser_creds *creds, char* username,
char* domain, char* password, int pass_len)
char* domain, char* password)
{
ZERO_STRUCTP(creds);
@ -1052,7 +1052,7 @@ NTSTATUS cli_full_connection(struct cli_state **output_cli,
struct in_addr *dest_ip, int port,
char *service, char *service_type,
char *user, char *domain,
char *password, int pass_len)
char *password)
{
struct ntuser_creds creds;
NTSTATUS nt_status;
@ -1113,7 +1113,8 @@ again:
return nt_status;
}
if (!cli_session_setup(cli, user, password, pass_len, password, pass_len,
if (!cli_session_setup(cli, user, password, strlen(password)+1,
password, strlen(password)+1,
domain)) {
DEBUG(1,("failed session setup\n"));
nt_status = cli_nt_error(cli);
@ -1125,7 +1126,7 @@ again:
if (service) {
if (!cli_send_tconX(cli, service, service_type,
(char*)password, pass_len)) {
(char*)password, strlen(password)+1)) {
DEBUG(1,("failed tcon_X\n"));
nt_status = cli_nt_error(cli);
cli_shutdown(cli);
@ -1135,7 +1136,7 @@ again:
}
}
init_creds(&creds, user, domain, password, pass_len);
init_creds(&creds, user, domain, password);
cli_init_creds(cli, &creds);
*output_cli = cli;

View File

@ -348,7 +348,7 @@ static NTSTATUS cm_open_connection(const char *domain,const char *pipe_name,
result = cli_full_connection(&(new_conn->cli), global_myname, new_conn->controller,
&dc_ip, 0, "IPC$",
"IPC", ipc_username, ipc_domain,
ipc_password, strlen(ipc_password));
ipc_password);
SAFE_FREE(ipc_username);
SAFE_FREE(ipc_domain);

View File

@ -757,7 +757,7 @@ static void usage(void)
&server_ip, 0,
"IPC$", "IPC",
username, domain,
password, strlen(password));
password);
if (!NT_STATUS_IS_OK(nt_status)) {
DEBUG(1,("Cannot connect to server. Error was %s\n", nt_errstr(nt_status)));

View File

@ -428,7 +428,7 @@ static struct cli_state *init_connection(struct cli_state **cli,
dest_ip, 0,
"IPC$", "IPC",
username, domain,
password, strlen(password)))) {
password))) {
return *cli;
} else {
return NULL;

View File

@ -56,7 +56,7 @@ static NTSTATUS modify_trust_password( char *domain, char *remote_machine,
&dest_ip, 0,
"IPC$", "IPC",
"", "",
"", 0))) {
""))) {
DEBUG(0,("modify_trust_password: Connection to %s failed!\n", remote_machine));
return NT_STATUS_UNSUCCESSFUL;
}

View File

@ -119,7 +119,7 @@ NTSTATUS connect_to_ipc(struct cli_state **c, struct in_addr *server_ip,
server_ip, opt_port,
"IPC$", "IPC",
opt_user_name, opt_workgroup,
opt_password, strlen(opt_password));
opt_password);
if (NT_STATUS_IS_OK(nt_status)) {
return nt_status;
@ -149,7 +149,7 @@ NTSTATUS connect_to_ipc_anonymous(struct cli_state **c,
server_ip, opt_port,
"IPC$", "IPC",
"", "",
"", 0);
"");
if (NT_STATUS_IS_OK(nt_status)) {
return nt_status;

View File

@ -722,7 +722,7 @@ static struct cli_state *connect_one(char *share)
&ip, 0,
share, "?????",
username, global_myworkgroup,
password, strlen(password)))) {
password))) {
return c;
} else {
return NULL;