svn commit: samba r12960 - in trunk/source/libsmb: .

vlendec at samba.org vlendec at samba.org
Mon Jan 16 16:28:15 GMT 2006


Author: vlendec
Date: 2006-01-16 16:28:14 +0000 (Mon, 16 Jan 2006)
New Revision: 12960

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=12960

Log:
One thing that has annoyed me for ages is the fact that you can't run
smbclient against smbd -i anymore, smbclient opens two connections.

This makes cli_dfs_get_referral use the already opened connection.

Jerry, could you please look at this?

Thanks,

Volker

Modified:
   trunk/source/libsmb/clidfs.c


Changeset:
Modified: trunk/source/libsmb/clidfs.c
===================================================================
--- trunk/source/libsmb/clidfs.c	2006-01-16 15:23:06 UTC (rev 12959)
+++ trunk/source/libsmb/clidfs.c	2006-01-16 16:28:14 UTC (rev 12960)
@@ -682,12 +682,15 @@
 	CLIENT_DFS_REFERRAL *refs = NULL;
 	size_t num_refs;
 	uint16 consumed;
-	struct cli_state *cli_ipc;
 	pstring fullpath;
+	BOOL res;
+	uint16 cnum;
 	
 	if ( !cli || !sharename )
 		return False;
 
+	cnum = cli->cnum;
+
 	/* special case.  never check for a referral on the IPC$ share */
 
 	if ( strequal( sharename, "IPC$" ) )
@@ -699,14 +702,21 @@
 
 	/* check for the referral */
 
-	if ( !(cli_ipc = cli_cm_open( cli->desthost, "IPC$", False )) )
+	if (!cli_send_tconX(cli, "IPC$", "IPC", NULL, 0)) {
 		return False;
-	
-	if ( !cli_dfs_get_referral(cli_ipc, fullpath, &refs, &num_refs, &consumed) 
-		|| !num_refs )
-	{
+	}
+
+	res = cli_dfs_get_referral(cli, fullpath, &refs, &num_refs, &consumed);
+
+	if (!cli_tdis(cli)) {
 		return False;
 	}
+
+	cli->cnum = cnum;
+		
+	if (!res || !num_refs ) {
+		return False;
+	}
 	
 	split_dfs_path( refs[0].dfspath, newserver, newshare );
 



More information about the samba-cvs mailing list