Merged V2.1 to HEAD

6833: Kerberos web filter for the web client.
   6834: Kerberos web filter for WebDAV
   6835: Updates to CIFS Kerberos logon support.
   6836: Fix issue with editing properties of AVM nodes and changed clipboard to use lock aware AVM service
   6837: Commented out the unknown opcode reporting as it can quickly fill the log files. AR-1742.
   6839: Patch to allow * and ? wildcard characters within a term in any web-client search
   6840: Fixed AR-1769: InvalidNameEndingPatch fails when running on 2.1
   6841: AR-1761.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6873 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2007-09-27 12:47:37 +00:00
parent b56284a70a
commit 1796e0b552
2 changed files with 932 additions and 4 deletions

View File

@@ -24,11 +24,15 @@
*/
package org.alfresco.repo.webdav;
import java.net.InetAddress;
import java.net.MalformedURLException;
import java.net.NetworkInterface;
import java.net.URL;
import javax.servlet.http.HttpServletResponse;
import org.alfresco.filesys.util.IPAddress;
/**
* Abstract base class for the hierarchical methods COPY and MOVE
*
@@ -186,15 +190,58 @@ public abstract class HierarchicalMethod extends WebDAVMethod
localPath = false;
}
else if (url.getHost().equals(m_request.getLocalName()) == false
else if (url.getHost().equalsIgnoreCase( m_request.getLocalName()) == false
&& url.getHost().equals(m_request.getLocalAddr()) == false)
{
// The target host may contain a domain or be specified as a numeric IP address
String targetHost = url.getHost();
if ( IPAddress.isNumericAddress( targetHost) == false)
{
String localHost = m_request.getLocalName();
int pos = targetHost.indexOf( ".");
if ( pos != -1)
targetHost = targetHost.substring( 0, pos);
pos = localHost.indexOf( ".");
if ( pos != -1)
localHost = localHost.substring( 0, pos);
// compare the host names
if ( targetHost.equalsIgnoreCase( localHost) == false)
localPath = false;
}
else
{
try
{
// Check if the target IP address is a local address
InetAddress targetAddr = InetAddress.getByName( targetHost);
if ( NetworkInterface.getByInetAddress( targetAddr) == null)
localPath = false;
}
catch (Exception ex)
{
// DEBUG
if ( logger.isDebugEnabled())
logger.debug("Failed to check target IP address, " + targetHost);
localPath = false;
}
}
// Debug
if (logger.isDebugEnabled())
if (localPath == false && logger.isDebugEnabled())
{
logger.debug("Destination path, different server name/address");
localPath = false;
logger.debug(" URL host=" + url.getHost() + ", localName=" + m_request.getLocalName() + ", localAddr=" + m_request.getLocalAddr());
}
}
else if (url.getPath().indexOf(m_request.getServletPath()) == -1)
{