mirror of https://github.com/apache/archiva.git
[MNG-1106] guard against NPE which can be generated by the LDAP user manager if misconfigured
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@750953 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
adf0f01d13
commit
4b34d911eb
|
@ -105,6 +105,10 @@ public class ArchivaServletAuthenticator
|
||||||
}
|
}
|
||||||
|
|
||||||
User user = securitySystem.getUserManager().findUser( principal );
|
User user = securitySystem.getUserManager().findUser( principal );
|
||||||
|
if ( user == null )
|
||||||
|
{
|
||||||
|
throw new UnauthorizedException( "The security system had an internal error - please check your system logs" );
|
||||||
|
}
|
||||||
if ( user.isLocked() )
|
if ( user.isLocked() )
|
||||||
{
|
{
|
||||||
throw new UnauthorizedException( "User account is locked." );
|
throw new UnauthorizedException( "User account is locked." );
|
||||||
|
|
|
@ -77,6 +77,10 @@ public class DefaultUserRepositories
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
User user = securitySystem.getUserManager().findUser( principal );
|
User user = securitySystem.getUserManager().findUser( principal );
|
||||||
|
if ( user == null )
|
||||||
|
{
|
||||||
|
throw new ArchivaSecurityException( "The security system had an internal error - please check your system logs" );
|
||||||
|
}
|
||||||
|
|
||||||
if ( user.isLocked() )
|
if ( user.isLocked() )
|
||||||
{
|
{
|
||||||
|
@ -145,6 +149,10 @@ public class DefaultUserRepositories
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
User user = securitySystem.getUserManager().findUser( principal );
|
User user = securitySystem.getUserManager().findUser( principal );
|
||||||
|
if ( user == null )
|
||||||
|
{
|
||||||
|
throw new ArchivaSecurityException( "The security system had an internal error - please check your system logs" );
|
||||||
|
}
|
||||||
|
|
||||||
if ( user.isLocked() )
|
if ( user.isLocked() )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue