Problem with msdfs root on "virtual" Samba server

Shirish Kalele kalele at veritas.com
Wed Mar 27 09:54:10 GMT 2002


What is rchfs? Is it a netbios alias for the server?

This problem has been fixed in CVS. The patch below should do it for you.

Thanks,
Shirish

Index: msdfs.c
===================================================================
RCS file: /data/cvs/samba/source/msdfs/msdfs.c,v
retrieving revision 1.10.4.20
diff -u -r1.10.4.20 msdfs.c
--- msdfs.c	2002/03/25 17:58:09	1.10.4.20
+++ msdfs.c	2002/03/26 02:31:04
@@ -22,7 +22,7 @@
 
 #include "includes.h"
 
-extern pstring global_myname;
+extern fstring local_machine;
 extern uint32 global_client_caps;
 
 #ifdef WITH_MSDFS
@@ -346,10 +346,15 @@
 	parse_dfs_path(pathname, &dp);
 
 	/* Verify hostname in path */
-	if (global_myname && (strcasecmp(global_myname, dp.hostname) != 0)) {
+	if (local_machine && (strcasecmp(local_machine, dp.hostname) != 0)) {
+
+	   /* Hostname mismatch, check if one of our IP addresses */
+	   if (!ismyip(*interpret_addr2(dp.hostname))) {
+		
 		DEBUG(3, ("get_referred_path: Invalid hostname %s in path %s\n",
-			  dp.hostname, pathname));
+		  	  dp.hostname, pathname));
 		return False;
+	   }
 	}
 
 	pstrcpy(jn->service_name, dp.servicename);
@@ -662,11 +667,15 @@
  
         parse_dfs_path(pathname,&dp);
 
-        /* check if path is dfs : check hostname is the first token */
-        if(global_myname && (strcasecmp(global_myname,dp.hostname)!=0)) {
+        /* check if path is dfs : validate first token */
+        if (local_machine && (strcasecmp(local_machine,dp.hostname)!=0)) {
+	    
+	   /* Hostname mismatch, check if one of our IP addresses */
+	   if (!ismyip(*interpret_addr2(dp.hostname))) {
                 DEBUG(4,("create_junction: Invalid hostname %s in dfs path %s\n",
 			 dp.hostname, pathname));
                 return False;
+	   }
         }
 
         /* Check for a non-DFS share */
@@ -802,7 +811,7 @@
 		jn[cnt].referral_count = 1;
 	
 		slprintf(alt_path,sizeof(alt_path)-1,"\\\\%s\\%s", 
-			 global_myname, service_name);
+			 local_machine, service_name);
 		ref = jn[cnt].referral_list = (struct referral*) malloc(sizeof(struct referral));
 		if (jn[cnt].referral_list == NULL) {
 			DEBUG(0, ("Malloc failed!\n"));

On Tue, 26 Mar 2002, John P Janosik wrote:

>We have several Samba servers with access to the same filesystem that we
>load balance between with IBM eNetwork Dispatcher software.  We are
>currently running Samba 2.2.3a, but this has been working OK for a few
>years on past versions of Samba.  We found the following problem when
>trying to make a msdfs root share on these servers.
>
>The following check in msdfs/msdfs.c is failing because users will map
>drives to \\rchfs\home but the Samba server handling the request will have
>a different hostname.
>
>      /* Verify hostname in path */
>      if (global_myname && (strcasecmp(global_myname, dp.hostname) != 0)) {
>            DEBUG(3, ("get_referred_path: Invalid hostname %s in path
>%s\n",
>                    dp.hostname, pathname));
>            return False;
>      }
>
> I see two ways to try to get around this problem, remove the check or add
>an smb.conf parameter that is used to set the value of global_myname.
>
>I have a feeling that neither of these is the right thing to do, does
>anyone have any advice?
>
>
>Thanks,
>
>John Janosik
>jpjanosi at us.ibm.com
>





More information about the samba-technical mailing list