[Samba] MSDFS

Shirish Kalele kalele at veritas.com
Mon Mar 25 19:22:04 GMT 2002


Harlan,

Could you try this patch to see if this fixes your problem? 

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"));

-----Original Message-----

I am using MSDFS with Samba 4a15 and everything is working when I go to
the IP address or the name of the system. The problem started when I
clustered the system using Heartbeat. The cluster is working but when I go
to the IP address of the Cluster the DFS links do not forward me to the to
the right location, it just opens to a blank folder. S if I go to the IP
address of ether of the computers in the cluster everything works but if I
go to the virtual IP address of the cluster the DFS does not work. ANY
ideas. Thanks









More information about the samba mailing list