diff --git a/config/alfresco/subsystems/Authentication/kerberos/kerberos-authentication-context.xml b/config/alfresco/subsystems/Authentication/kerberos/kerberos-authentication-context.xml
index 9fd0d41ffd..66bbc2b2fe 100644
--- a/config/alfresco/subsystems/Authentication/kerberos/kerberos-authentication-context.xml
+++ b/config/alfresco/subsystems/Authentication/kerberos/kerberos-authentication-context.xml
@@ -87,6 +87,9 @@
${kerberos.authentication.cifs.configEntryName}
+
+ true
+
\ No newline at end of file
diff --git a/source/java/org/alfresco/filesys/auth/cifs/AlfrescoCifsAuthenticator.java b/source/java/org/alfresco/filesys/auth/cifs/AlfrescoCifsAuthenticator.java
index 3bf73c25cb..72e4baf044 100644
--- a/source/java/org/alfresco/filesys/auth/cifs/AlfrescoCifsAuthenticator.java
+++ b/source/java/org/alfresco/filesys/auth/cifs/AlfrescoCifsAuthenticator.java
@@ -26,9 +26,6 @@ package org.alfresco.filesys.auth.cifs;
import java.security.NoSuchAlgorithmException;
-import javax.transaction.Status;
-import javax.transaction.UserTransaction;
-
import net.sf.acegisecurity.Authentication;
import org.alfresco.filesys.alfresco.AlfrescoClientInfo;
@@ -42,6 +39,7 @@ import org.alfresco.jlan.smb.server.SMBSrvSession;
import org.alfresco.jlan.util.HexDump;
import org.alfresco.repo.security.authentication.NTLMMode;
import org.alfresco.repo.security.authentication.ntlm.NTLMPassthruToken;
+import org.alfresco.repo.transaction.RetryingTransactionHelper;
/**
* Alfresco Authenticator Class
@@ -94,7 +92,7 @@ public class AlfrescoCifsAuthenticator extends CifsAuthenticatorBase
* @param sess Server session
* @param alg Encryption algorithm
*/
- public int authenticateUser(ClientInfo client, SrvSession sess, int alg)
+ public int authenticateUser(final ClientInfo client, final SrvSession sess, final int alg)
{
// Check that the client is an Alfresco client
@@ -138,7 +136,6 @@ public class AlfrescoCifsAuthenticator extends CifsAuthenticatorBase
// Check if this is a guest logon
int authSts = AUTH_DISALLOW;
- UserTransaction tx = null;
try
{
@@ -172,24 +169,30 @@ public class AlfrescoCifsAuthenticator extends CifsAuthenticatorBase
else if ( getNTLMAuthenticator().getNTLMMode() == NTLMMode.MD4_PROVIDER)
{
// Start a transaction
+ authSts = doInTransaction(new RetryingTransactionHelper.RetryingTransactionCallback()
+ {
+
+ public Integer execute() throws Throwable
+ {
+ // Perform local MD4 password check
+ return doMD4UserAuthentication(client, sess, alg);
+ }
+ });
- tx = createTransaction();
- tx.begin();
-
- // Perform local MD4 password check
-
- authSts = doMD4UserAuthentication(client, sess, alg);
}
else
{
// Start a transaction
-
- tx = createTransaction();
- tx.begin();
+ authSts = doInTransaction(new RetryingTransactionHelper.RetryingTransactionCallback()
+ {
+
+ public Integer execute() throws Throwable
+ {
+ // Perform passthru authentication password check
+ return doPassthruUserAuthentication(client, sess, alg);
+ }
+ });
- // Perform passthru authentication password check
-
- authSts = doPassthruUserAuthentication(client, sess, alg);
}
// Check if the logon status indicates a guest logon
@@ -217,34 +220,6 @@ public class AlfrescoCifsAuthenticator extends CifsAuthenticatorBase
if ( logger.isDebugEnabled())
logger.debug( ex);
}
- finally
- {
- // Commit the transaction
-
- if ( tx != null)
- {
- try
- {
- // Commit or rollback the transaction
-
- if ( tx.getStatus() == Status.STATUS_MARKED_ROLLBACK)
- {
- // Transaction is marked for rollback
-
- tx.rollback();
- }
- else
- {
- // Commit the transaction
-
- tx.commit();
- }
- }
- catch ( Exception ex)
- {
- }
- }
- }
// Check for an administrator logon
diff --git a/source/java/org/alfresco/filesys/auth/cifs/CifsAuthenticatorBase.java b/source/java/org/alfresco/filesys/auth/cifs/CifsAuthenticatorBase.java
index 3bb68dd05a..f53df4d83a 100644
--- a/source/java/org/alfresco/filesys/auth/cifs/CifsAuthenticatorBase.java
+++ b/source/java/org/alfresco/filesys/auth/cifs/CifsAuthenticatorBase.java
@@ -24,8 +24,6 @@
*/
package org.alfresco.filesys.auth.cifs;
-import javax.transaction.UserTransaction;
-
import net.sf.acegisecurity.Authentication;
import org.alfresco.config.ConfigElement;
@@ -48,6 +46,7 @@ import org.alfresco.repo.security.authentication.AuthenticationComponent;
import org.alfresco.repo.security.authentication.MD4PasswordEncoder;
import org.alfresco.repo.security.authentication.MD4PasswordEncoderImpl;
import org.alfresco.repo.security.authentication.ntlm.NLTMAuthenticator;
+import org.alfresco.repo.transaction.RetryingTransactionHelper;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.cmr.security.AuthenticationService;
@@ -348,49 +347,28 @@ public abstract class CifsAuthenticatorBase extends CifsAuthenticator implements
* @param client
* ClientInfo
*/
- protected final void getHomeFolderForUser(ClientInfo client)
+ protected final void getHomeFolderForUser(final ClientInfo client)
{
// Check if the client is an Alfresco client, and not a null logon
-
- if ( client instanceof AlfrescoClientInfo == false ||
- client.isNullSession() == true)
- return;
-
- AlfrescoClientInfo alfClient = (AlfrescoClientInfo) client;
-
+
+ if (client instanceof AlfrescoClientInfo == false || client.isNullSession() == true)
+ return;
+
+ final AlfrescoClientInfo alfClient = (AlfrescoClientInfo) client;
+
// Get the home folder for the user
-
- UserTransaction tx = getTransactionService().getUserTransaction();
- NodeRef homeSpaceRef = null;
-
- try
+
+ doInTransaction(new RetryingTransactionHelper.RetryingTransactionCallback