Remove the password length paramater from cli_full_connection - it really
authorAndrew Bartlett <abartlet@samba.org>
Fri, 24 May 2002 05:14:16 +0000 (05:14 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 24 May 2002 05:14:16 +0000 (05:14 +0000)
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)

source3/auth/auth_domain.c
source3/libsmb/cliconnect.c
source3/nsswitch/winbindd_cm.c
source3/rpcclient/rpcclient.c
source3/rpcclient/samsync.c
source3/smbd/change_trust_pw.c
source3/utils/net.c
source3/utils/smbcacls.c

index 91c111b557b16467d06b4b58c4fa1839e1e91d2f..69d922db12b7ba88a74839ab8fcd5b609919f66d 100644 (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();
index f41c3b77010e12cf0215dce8b9aece8bed60fb2d..7d18692236ca5395bd6091471c9b4708a16db9cf 100644 (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;
index ce484795f846ad2c30211f2c376bcdb917f74e9a..907282ddb9b8de0b17197515358ad53e151e9cda 100644 (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);
index 29b99165d3973ebbe6d6fee620371e5f1759b87d..1e2b42233f424122c8d079afeccc6d888010aa10 100644 (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)));
index 0b307980709ebc94b6de44c12fd59bee896908af..be5bc874be9d4ded1f2c95490fe490222823059e 100644 (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;
index 0d80d5718fa97ff34a4c5b2c2fa881fe19f2ddab..f81396dce53963c742bc5dd201d98e6ac1519e8a 100644 (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;
   }
index 0450d9519d4ec7b79698bea410e882cdbb2a0c06..fc5c6b90d547a90cd061831e74b0fbd4bbc99727 100644 (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;
index 62ab6357b41e88dd074d086d9d232cd4611b8652..7d0dd579fb16326abf721cbaab1f74e61d7f4753 100644 (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;