From b8ff47de1ef384f0801a8d776fb095cdfd1c7ebb Mon Sep 17 00:00:00 2001 From: Alan Davis Date: Tue, 11 Feb 2014 22:05:12 +0000 Subject: [PATCH] Merged HEAD-BUG-FIX (4.3/Cloud) to HEAD (4.3/Cloud) 57792: Merged V4.2-BUG-FIX (4.2.1) to HEAD-BUG-FIX (Cloud/4.3) 57768: Merged V4.1-BUG-FIX (4.1.8) to V4.2-BUG-FIX (4.2.1) 57694: Merged DEV to V4.1-BUG-FIX (4.1.8) 57603: MNT-9284 : Upload speed using CIFS between PostgreSQL and SQL Server 2008 Deleted an unnecessary transaction in org.alfresco.filesys.auth.cifs.CifsAuthenticatorBase#setCurrentUser. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@61879 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../auth/cifs/CifsAuthenticatorBase.java | 112 ++++++++---------- 1 file changed, 52 insertions(+), 60 deletions(-) diff --git a/source/java/org/alfresco/filesys/auth/cifs/CifsAuthenticatorBase.java b/source/java/org/alfresco/filesys/auth/cifs/CifsAuthenticatorBase.java index 0533c52c68..af79d71798 100644 --- a/source/java/org/alfresco/filesys/auth/cifs/CifsAuthenticatorBase.java +++ b/source/java/org/alfresco/filesys/auth/cifs/CifsAuthenticatorBase.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2010 Alfresco Software Limited. + * Copyright (C) 2005-2013 Alfresco Software Limited. * * This file is part of Alfresco * @@ -450,75 +450,67 @@ public abstract class CifsAuthenticatorBase extends CifsAuthenticator implements getAuthenticationComponent().clearCurrentSecurityContext(); return; } - - doInTransaction(new RetryingTransactionHelper.RetryingTransactionCallback() + if (client.isGuest() == false && client instanceof AlfrescoClientInfo) { - public Object execute() throws Throwable + // Set the authentication context for the request + + AlfrescoClientInfo alfClient = (AlfrescoClientInfo) client; + if (alfClient.hasAuthenticationTicket()) { - if (client.isGuest() == false && client instanceof AlfrescoClientInfo) + boolean ticketFailed = false; + + try { - // Set the authentication context for the request - - AlfrescoClientInfo alfClient = (AlfrescoClientInfo) client; - if (alfClient.hasAuthenticationTicket()) - { - boolean ticketFailed = false; - - try - { - getAuthenticationService().validate(alfClient.getAuthenticationTicket()); - } - catch (AuthenticationException e) - { - // Indicate the existing ticket is bad - - ticketFailed = true; - - // DEBUG - - if ( logger.isDebugEnabled()) - logger.debug("Failed to validate ticket, user=" + client.getUserName() + ", ticket=" + alfClient.getAuthenticationTicket()); - } - - // If the ticket did not validate then try and get a new ticket for the user - - if ( ticketFailed == true) { - - try { - String normalized = mapUserNameToPerson( client.getUserName(), false); - getAuthenticationComponent().setCurrentUser( normalized); - alfClient.setAuthenticationTicket(getAuthenticationService().getCurrentTicket()); - } - catch ( AuthenticationException ex) { - - // Cannot get a new ticket for the user + getAuthenticationService().validate(alfClient.getAuthenticationTicket()); + } + catch (AuthenticationException e) + { + // Indicate the existing ticket is bad - if ( logger.isErrorEnabled()) { - logger.error("Failed to get new ticket for user=" + client.getUserName()); - logger.error( ex); - } + ticketFailed = true; - // Clear the ticket/security context - - alfClient.setAuthenticationTicket(null); - getAuthenticationComponent().clearCurrentSecurityContext(); - } - } + // DEBUG + + if ( logger.isDebugEnabled()) + logger.debug("Failed to validate ticket, user=" + client.getUserName() + ", ticket=" + alfClient.getAuthenticationTicket()); + } + + // If the ticket did not validate then try and get a new ticket for the user + + if ( ticketFailed == true) { + + try { + String normalized = mapUserNameToPerson( client.getUserName(), false); + getAuthenticationComponent().setCurrentUser( normalized); + alfClient.setAuthenticationTicket(getAuthenticationService().getCurrentTicket()); } - else - { + catch ( AuthenticationException ex) { + + // Cannot get a new ticket for the user + + if ( logger.isErrorEnabled()) { + logger.error("Failed to get new ticket for user=" + client.getUserName()); + logger.error( ex); + } + + // Clear the ticket/security context + + alfClient.setAuthenticationTicket(null); getAuthenticationComponent().clearCurrentSecurityContext(); } } - else - { - // Enable guest access for the request - - getAuthenticationComponent().setGuestUserAsCurrentUser(); - } - return null; } - }); + else + { + getAuthenticationComponent().clearCurrentSecurityContext(); + } + } + else + { + // Enable guest access for the request + + getAuthenticationComponent().setGuestUserAsCurrentUser(); + } } /**