Problem with msdfs and fully qualified referral hostnames

John P Janosik jpjanosi at
Fri May 9 19:59:03 GMT 2003

We have run into a problem with msdfs support in Samba 2.2.8a when trying
to support both win9x and NT/2K/XP clients.  We originally set up the msdfs
symlinks with the netbios names of the servers so that both Win9x and
NT/2K/XP clients could use our msdfs root.  This was OK because the clients
were set up to use WINS servers that could resolve these names.  Now there
are XP clients at other sites configured to use different or no WINS
servers that would like to access our msdfs root.

I made the following change to allow us to use fully qualified DNS names in
our msdfs symlinks without breaking Win9x clients.  Does anyone see a
problem with this patch.  Could a change like this be added to Samba 3.0?

[root at rchsker msdfs]# diff -u msdfs.c.orig msdfs.c
--- msdfs.c.orig        Thu Apr 17 13:35:19 2003
+++ msdfs.c     Fri May  9 14:31:15 2003
@@ -141,7 +141,24 @@
                        *p = '\\';

                pstrcpy(reflist[i].alternate_path, "\\");
-               pstrcat(reflist[i].alternate_path, alt_path[i]);
+               if(get_remote_arch() == RA_WIN95) {
+                       /*Only pass the short hostname to older Windows
+                         Hopefully this is also the netbios name */
+                       char *r,*q = strchr(alt_path[i],'\\');
+                       if(q == NULL)
+                               return False;
+                       *q = '\0';
+                       r = strchr(alt_path[i],'.');
+                       if(r != NULL)
+                               *r = '\0';
+                       pstrcat(reflist[i].alternate_path, alt_path[i]);
+                       pstrcat(reflist[i].alternate_path, "\\");
+                       pstrcat(reflist[i].alternate_path, q+1);
+               } else
+                       pstrcat(reflist[i].alternate_path, alt_path[i]);
                reflist[i].proximity = 0;
                reflist[i].ttl = REFERRAL_TTL;
                DEBUG(10, ("parse_symlink: Created alt path: %s\n",


John Janosik
IBM Global Services SDC Northeast
Rochester Server Support, AFS/DFS Team
jpjanosi at

More information about the samba-technical mailing list