mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged V3.0 to HEAD
11375: MT - complete fix for ETHREEOH-189 11378: Supporting changes for license component in 3.0 (but not the license component itself ...) 11380: Fix for transaction error. ETHREEOH-451. 11383: Oracle upgrade and create SQL fixes (Can Entperprise-only later) 11384: Fix truelicense classpath in sdk-projects git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@12424 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -42,6 +42,7 @@ import javax.servlet.ServletResponse;
|
|||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import javax.servlet.http.HttpSession;
|
import javax.servlet.http.HttpSession;
|
||||||
|
import javax.transaction.Status;
|
||||||
import javax.transaction.UserTransaction;
|
import javax.transaction.UserTransaction;
|
||||||
|
|
||||||
import org.alfresco.filesys.ServerConfigurationBean;
|
import org.alfresco.filesys.ServerConfigurationBean;
|
||||||
@@ -412,6 +413,7 @@ public class NTLMAuthenticationFilter implements Filter
|
|||||||
|
|
||||||
Type3NTLMMessage type3Msg = new Type3NTLMMessage(ntlmByts);
|
Type3NTLMMessage type3Msg = new Type3NTLMMessage(ntlmByts);
|
||||||
processType3(type3Msg, req, resp, httpSess, chain);
|
processType3(type3Msg, req, resp, httpSess, chain);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -664,9 +666,58 @@ public class NTLMAuthenticationFilter implements Filter
|
|||||||
|
|
||||||
if ( m_authComponent.getNTLMMode() == NTLMMode.MD4_PROVIDER)
|
if ( m_authComponent.getNTLMMode() == NTLMMode.MD4_PROVIDER)
|
||||||
{
|
{
|
||||||
|
// Wrap the auth componenet calls in a transaction
|
||||||
|
|
||||||
|
UserTransaction tx = m_transactionService.getUserTransaction();
|
||||||
|
String md4hash = null;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
tx.begin();
|
||||||
|
|
||||||
// Get the stored MD4 hashed password for the user, or null if the user does not exist
|
// Get the stored MD4 hashed password for the user, or null if the user does not exist
|
||||||
|
|
||||||
String md4hash = m_authComponent.getMD4HashedPassword(userName);
|
md4hash = m_authComponent.getMD4HashedPassword(userName);
|
||||||
|
}
|
||||||
|
catch ( Throwable ex) {
|
||||||
|
|
||||||
|
if ( logger.isDebugEnabled())
|
||||||
|
logger.debug(ex);
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
|
||||||
|
// Rollback/commit the transaction if still valid
|
||||||
|
|
||||||
|
if ( tx != null) {
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Commit or rollback the transaction
|
||||||
|
|
||||||
|
if ( tx.getStatus() == Status.STATUS_MARKED_ROLLBACK ||
|
||||||
|
tx.getStatus() == Status.STATUS_ROLLEDBACK ||
|
||||||
|
tx.getStatus() == Status.STATUS_ROLLING_BACK)
|
||||||
|
{
|
||||||
|
// Transaction is marked for rollback
|
||||||
|
|
||||||
|
tx.rollback();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Commit the transaction
|
||||||
|
|
||||||
|
tx.commit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Throwable ex) {
|
||||||
|
|
||||||
|
if ( logger.isDebugEnabled())
|
||||||
|
logger.debug(ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if we got a valid MD4 hashed password
|
||||||
|
|
||||||
if ( md4hash != null)
|
if ( md4hash != null)
|
||||||
{
|
{
|
||||||
@@ -772,32 +823,43 @@ public class NTLMAuthenticationFilter implements Filter
|
|||||||
|
|
||||||
// commit
|
// commit
|
||||||
tx.commit();
|
tx.commit();
|
||||||
|
tx = null;
|
||||||
}
|
}
|
||||||
catch (Throwable ex)
|
catch ( Throwable ex) {
|
||||||
{
|
|
||||||
|
if ( logger.isDebugEnabled())
|
||||||
|
logger.debug(ex);
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
|
||||||
|
// Rollback/commit the transaction if still valid
|
||||||
|
|
||||||
|
if ( tx != null) {
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
// Commit or rollback the transaction
|
||||||
|
|
||||||
|
if ( tx.getStatus() == Status.STATUS_MARKED_ROLLBACK ||
|
||||||
|
tx.getStatus() == Status.STATUS_ROLLEDBACK ||
|
||||||
|
tx.getStatus() == Status.STATUS_ROLLING_BACK)
|
||||||
|
{
|
||||||
|
// Transaction is marked for rollback
|
||||||
|
|
||||||
tx.rollback();
|
tx.rollback();
|
||||||
}
|
}
|
||||||
catch (Exception ex2)
|
|
||||||
{
|
|
||||||
logger.error("Failed to rollback transaction", ex2);
|
|
||||||
}
|
|
||||||
if(ex instanceof RuntimeException)
|
|
||||||
{
|
|
||||||
throw (RuntimeException)ex;
|
|
||||||
}
|
|
||||||
else if(ex instanceof IOException)
|
|
||||||
{
|
|
||||||
throw (IOException)ex;
|
|
||||||
}
|
|
||||||
else if(ex instanceof ServletException)
|
|
||||||
{
|
|
||||||
throw (ServletException)ex;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
throw new RuntimeException("Authentication setup failed", ex);
|
// Commit the transaction
|
||||||
|
|
||||||
|
tx.commit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Throwable ex) {
|
||||||
|
|
||||||
|
if ( logger.isDebugEnabled())
|
||||||
|
logger.debug(ex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user