mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Removed auth null from list of available authentication types in the AlfrescoRpcAuthenticator.
Allow null RPC request to run without needing an authenticated session. Fix for AR-1605. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6266 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -424,10 +424,13 @@ public class NFSServer extends RpcNetworkServer implements RpcProcessor {
|
||||
}
|
||||
catch (RpcAuthenticationException ex) {
|
||||
|
||||
// Failed to authenticate the RPC client
|
||||
|
||||
rpc.buildAuthFailResponse(ex.getAuthenticationErrorCode());
|
||||
return rpc;
|
||||
// Failed to authenticate the RPC client, return an error unless the request is the 'null' request
|
||||
|
||||
if ( rpc.getProcedureId() != NFS.ProcNull)
|
||||
{
|
||||
rpc.buildAuthFailResponse(ex.getAuthenticationErrorCode());
|
||||
return rpc;
|
||||
}
|
||||
}
|
||||
|
||||
// Position the RPC buffer pointer at the start of the call parameters
|
||||
@@ -582,25 +585,28 @@ public class NFSServer extends RpcNetworkServer implements RpcProcessor {
|
||||
|
||||
// Commit, or rollback, any active user transaction
|
||||
|
||||
try
|
||||
{
|
||||
// Commit or rollback the transaction
|
||||
|
||||
nfsSess.endTransaction();
|
||||
}
|
||||
catch ( Exception ex)
|
||||
{
|
||||
// Debug
|
||||
|
||||
if ( logger.isDebugEnabled())
|
||||
logger.debug("Error committing transaction", ex);
|
||||
}
|
||||
if ( nfsSess != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Commit or rollback the transaction
|
||||
|
||||
nfsSess.endTransaction();
|
||||
}
|
||||
catch ( Exception ex)
|
||||
{
|
||||
// Debug
|
||||
|
||||
if ( logger.isDebugEnabled())
|
||||
logger.debug("Error committing transaction", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
// If there is an active transaction then roll it back
|
||||
|
||||
if ( nfsSess.hasUserTransaction())
|
||||
if ( nfsSess != null && nfsSess.hasUserTransaction())
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -4126,7 +4132,24 @@ public class NFSServer extends RpcNetworkServer implements RpcProcessor {
|
||||
|
||||
// Setup the authentication context for the request
|
||||
|
||||
getRpcAuthenticator().setCurrentUser( sess, sess.getClientInformation());
|
||||
try
|
||||
{
|
||||
getRpcAuthenticator().setCurrentUser( sess, sess.getClientInformation());
|
||||
}
|
||||
catch ( Throwable ex)
|
||||
{
|
||||
sess = null;
|
||||
|
||||
// DEBUG
|
||||
|
||||
if (logger.isDebugEnabled() && hasDebugFlag(DBG_ERROR))
|
||||
logger.debug("RPC Authencation Exception: " + ex.toString());
|
||||
}
|
||||
|
||||
// Check if the session is valid
|
||||
|
||||
if ( sess == null)
|
||||
throw new RpcAuthenticationException(Rpc.AuthBadCred);
|
||||
|
||||
// Return the server session
|
||||
|
||||
|
Reference in New Issue
Block a user