[SCM] Samba Shared Repository - branch master updated - e000045f15665f1c5209f52bf5730bac5c14256b

Jeremy Allison jra at samba.org
Fri Jan 2 20:51:45 GMT 2009


The branch, master has been updated
       via  e000045f15665f1c5209f52bf5730bac5c14256b (commit)
       via  3d2d0203e57bacf0cd61cfb72780a4bd9aa42707 (commit)
      from  793f1cdbd918f2245255176572027763664d9d0b (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit e000045f15665f1c5209f52bf5730bac5c14256b
Merge: 3d2d0203e57bacf0cd61cfb72780a4bd9aa42707 793f1cdbd918f2245255176572027763664d9d0b
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Jan 2 12:51:18 2009 -0800

    Merge branch 'master' of ssh://jra@git.samba.org/data/git/samba

commit 3d2d0203e57bacf0cd61cfb72780a4bd9aa42707
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Jan 2 12:49:49 2009 -0800

    Remove cli_cm_set_dest_ss() - removes the global dest_ss
    from libsmb/clidfs.c. Keep the '-I<address>' option in
    smbclient working. The intent is to remove all globals
    from libsmb/clidfs.c.
    Jeremy.

-----------------------------------------------------------------------

Summary of changes:
 source3/client/client.c |   13 ++++++++-----
 source3/libsmb/clidfs.c |   20 +++++---------------
 2 files changed, 13 insertions(+), 20 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/client/client.c b/source3/client/client.c
index c63921a..529f21a 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -78,6 +78,7 @@ static bool showacls = false;
 bool lowercase = false;
 
 static struct sockaddr_storage dest_ss;
+static char dest_ss_str[INET6_ADDRSTRLEN];
 
 #define SEPARATORS " \t\n\r"
 
@@ -4043,7 +4044,8 @@ static int process_command_string(const char *cmd_in)
 	/* establish the connection if not already */
 
 	if (!cli) {
-		cli = cli_cm_open(talloc_tos(), NULL, desthost,
+		cli = cli_cm_open(talloc_tos(), NULL,
+				have_ip ? dest_ss_str : desthost,
 				service, true, smb_encrypt);
 		if (!cli) {
 			return 1;
@@ -4508,7 +4510,8 @@ static int process(const char *base_directory)
 	int rc = 0;
 
 	cli = cli_cm_open(talloc_tos(), NULL,
-			desthost, service, true, smb_encrypt);
+			have_ip ? dest_ss_str : desthost,
+			service, true, smb_encrypt);
 	if (!cli) {
 		return 1;
 	}
@@ -4586,7 +4589,8 @@ static int do_tar_op(const char *base_directory)
 	/* do we already have a connection? */
 	if (!cli) {
 		cli = cli_cm_open(talloc_tos(), NULL,
-			desthost, service, true, smb_encrypt);
+			have_ip ? dest_ss_str : desthost,
+			service, true, smb_encrypt);
 		if (!cli)
 			return 1;
 	}
@@ -4792,8 +4796,7 @@ static int do_message_op(struct user_auth_info *auth_info)
 					exit(1);
 				}
 				have_ip = true;
-
-				cli_cm_set_dest_ss(&dest_ss);
+				print_sockaddr(dest_ss_str, sizeof(dest_ss_str), &dest_ss);
 			}
 			break;
 		case 'E':
diff --git a/source3/libsmb/clidfs.c b/source3/libsmb/clidfs.c
index 4597e63..ac68700 100644
--- a/source3/libsmb/clidfs.c
+++ b/source3/libsmb/clidfs.c
@@ -54,8 +54,6 @@ static void cm_set_password(const char *newpass);
 
 static int port;
 static int name_type = 0x20;
-static bool have_ip;
-static struct sockaddr_storage dest_ss;
 
 static struct client_connection *connections;
 
@@ -133,8 +131,11 @@ static struct cli_state *do_connect(TALLOC_CTX *ctx,
 	}
 	sharename = servicename;
 	if (*sharename == '\\') {
-		server = sharename+2;
-		sharename = strchr_m(server,'\\');
+		sharename += 2;
+		if (server == NULL) {
+			server = sharename;
+		}
+		sharename = strchr_m(sharename,'\\');
 		if (!sharename) {
 			return NULL;
 		}
@@ -151,8 +152,6 @@ static struct cli_state *do_connect(TALLOC_CTX *ctx,
 
  again:
 	zero_sockaddr(&ss);
-	if (have_ip)
-		ss = dest_ss;
 
 	/* have to open a new connection */
 	if (!(c=cli_initialise()) || (cli_set_port(c, port) != port)) {
@@ -550,15 +549,6 @@ void cli_cm_set_fallback_after_kerberos(void)
 	cm_creds.fallback_after_kerberos = true;
 }
 
-/****************************************************************************
-****************************************************************************/
-
-void cli_cm_set_dest_ss(struct sockaddr_storage *pss)
-{
-	dest_ss = *pss;
-	have_ip = true;
-}
-
 /**********************************************************************
  split a dfs path into the server, share name, and extrapath components
 **********************************************************************/


-- 
Samba Shared Repository


More information about the samba-cvs mailing list