[SCM] Samba Shared Repository - branch v3-2-test updated - release-3-2-0pre2-2319-g5c6ed77

Jeremy Allison jra at samba.org
Tue May 13 21:03:50 GMT 2008


The branch, v3-2-test has been updated
       via  5c6ed7774220dea30c2c8a564648406b4f3eacbf (commit)
      from  6200e8886b29469cb1dbbe441e4f642fb28b83f2 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test


- Log -----------------------------------------------------------------
commit 5c6ed7774220dea30c2c8a564648406b4f3eacbf
Author: Jeremy Allison <jra at samba.org>
Date:   Tue May 13 14:03:21 2008 -0700

    Fix bug #5460. The problem is RHEL5.0 shipped a CIFS client
    that sets the DFS bit on pathnames but doesn't
    send DFS paths. This causes lookups to fail as
    the smbd/msdfs.c code now just eats the first
    two parts of the pathname and uses the rest as
    the local path. The previous hostname check
    used to protect us from that as we knew that
    when the hostname was invalid it was a local
    path (and a broken client).
    I didn't want to put that check back in, but
    came up with another idea - even though the
    hostname can be a different one, the sharename
    must be valid on this machine. So we can check
    for a valid sharename instead.
    Jeremy.

-----------------------------------------------------------------------

Summary of changes:
 source/smbd/conn.c  |   25 +++++++++++++++++++++++--
 source/smbd/msdfs.c |   10 ++++++++++
 2 files changed, 33 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/smbd/conn.c b/source/smbd/conn.c
index 5aedadc..1a55522 100644
--- a/source/smbd/conn.c
+++ b/source/smbd/conn.c
@@ -63,10 +63,10 @@ bool conn_snum_used(int snum)
 	return(False);
 }
 
-
 /****************************************************************************
-find a conn given a cnum
+ Find a conn given a cnum.
 ****************************************************************************/
+
 connection_struct *conn_find(unsigned cnum)
 {
 	int count=0;
@@ -84,6 +84,27 @@ connection_struct *conn_find(unsigned cnum)
 	return NULL;
 }
 
+/****************************************************************************
+ Find a conn given a service name.
+****************************************************************************/
+
+connection_struct *conn_find_byname(const char *service)
+{
+	int count=0;
+	connection_struct *conn;
+
+	for (conn=Connections;conn;conn=conn->next,count++) {
+		if (strequal(lp_servicename(SNUM(conn)),service)) {
+			if (count > 10) {
+				DLIST_PROMOTE(Connections, conn);
+			}
+			return conn;
+		}
+	}
+
+	return NULL;
+}
+
 
 /****************************************************************************
   find first available connection slot, starting from a random position.
diff --git a/source/smbd/msdfs.c b/source/smbd/msdfs.c
index 4f9e739..7400f79 100644
--- a/source/smbd/msdfs.c
+++ b/source/smbd/msdfs.c
@@ -133,6 +133,16 @@ static NTSTATUS parse_dfs_path(const char *pathname,
 	if(p == NULL) {
 		pdp->servicename = temp;
 		pdp->reqpath = eos_ptr; /* "" */
+		/* Is this really our servicename ? */
+		if (NULL == conn_find_byname(pdp->servicename)) {
+			DEBUG(10,("parse_dfs_path: %s is not our servicename\n",
+				pdp->servicename));
+			p = temp;
+			DEBUG(10,("parse_dfs_path: trying to convert %s "
+				"to a local path\n",
+				temp));
+			goto local_path;
+		}
 		return NT_STATUS_OK;
 	}
 	*p = '\0';


-- 
Samba Shared Repository


More information about the samba-cvs mailing list