Problem with msdfs root on "virtual" Samba server

John P Janosik jpjanosi at
Wed Mar 27 13:44:07 GMT 2002

Shirish -

I will try this patch tomorrow, it looks like it should work as long as
ismyip returns true for addresses aliased to loopback.

I am not sure if my terminology is correct, but here is how our setup

We have an AIX box running eNetwork Dispatcher called end-e(,
this machine also has other IP aliases rchfs(,
smbpub(, and smb1(   We have a mix of AIX and
Linux machines running Samba called rchsmb1, rchsmb2, etc.  When the
dispatcher machine receives a packet with a destination of one of the
"cluster" addreses(rchfs, smbpub, or smb1) the dispatcher software chooses
a Samba server to send the packet to based on the load of each Samba server
and some other rules.

The dispatcher forwards packets by changing the hardware address of the
destination in the packet and sending the packet out on the same interface
it received it on.  Each Samba server has the "cluster" addresses aliased
on its loopback so that it will receive the packets forwarded by the
dispatcher.  Each of the cluster addresses has static WINS entries.



                      Shirish Kalele                                                                                             
                      <kalele at veritas.c        To:       John P Janosik/Rochester/IBM at IBMUS                                      
                      om>                      cc:       samba-technical at                                         
                                               Subject:  Re: Problem with msdfs root on "virtual" Samba server                   
                      03/27/2002 10:41                                                                                           

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.


Index: msdfs.c
RCS file: /data/cvs/samba/source/msdfs/msdfs.c,v
retrieving revision
diff -u -r1.10.4.20 msdfs.c
--- msdfs.c        2002/03/25 17:58:09 
+++ 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 @@


-        /* 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
                                      dp.hostname, pathname));
                 return False;
+               }

         /* Check for a non-DFS share */
@@ -802,7 +811,7 @@
                         jn[cnt].referral_count = 1;


-                                     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
>                    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?
>John Janosik
>jpjanosi at

More information about the samba-technical mailing list