summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/smbd/conn.c25
-rw-r--r--source3/smbd/msdfs.c10
2 files changed, 33 insertions, 2 deletions
diff --git a/source3/smbd/conn.c b/source3/smbd/conn.c
index e899af1319..125277be21 100644
--- a/source3/smbd/conn.c
+++ b/source3/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/source3/smbd/msdfs.c b/source3/smbd/msdfs.c
index e321a8c8e4..6306745574 100644
--- a/source3/smbd/msdfs.c
+++ b/source3/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';