From c53ca291e21761f1de5417ef596afba395a7f5d1 Mon Sep 17 00:00:00 2001 From: Abhishek Koneru Date: Wed, 6 Jun 2012 16:55:54 -0400 Subject: Fixes for NULL_RETURNS Coverity Issues - Part 2 --- .../src/com/netscape/cmscore/authentication/AuthSubsystem.java | 4 ++-- .../netscape/cmscore/authentication/PasswdUserDBAuthentication.java | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'base/common/src/com/netscape/cmscore/authentication') diff --git a/base/common/src/com/netscape/cmscore/authentication/AuthSubsystem.java b/base/common/src/com/netscape/cmscore/authentication/AuthSubsystem.java index fbb589376..c5b09a7d7 100644 --- a/base/common/src/com/netscape/cmscore/authentication/AuthSubsystem.java +++ b/base/common/src/com/netscape/cmscore/authentication/AuthSubsystem.java @@ -458,9 +458,9 @@ public class AuthSubsystem implements IAuthSubsystem { *

*/ public void shutdown() { - for (Enumeration e = mAuthMgrInsts.keys(); e.hasMoreElements();) { + for (AuthManagerProxy proxy : mAuthMgrInsts.values()) { - IAuthManager mgr = get(e.nextElement()); + IAuthManager mgr = proxy.getAuthManager(); log(ILogger.LL_INFO, CMS.getLogMessage("CMSCORE_AUTH_INSTANCE_SHUTDOWN", mgr.getName())); diff --git a/base/common/src/com/netscape/cmscore/authentication/PasswdUserDBAuthentication.java b/base/common/src/com/netscape/cmscore/authentication/PasswdUserDBAuthentication.java index 5b6418c00..fa8696c1d 100644 --- a/base/common/src/com/netscape/cmscore/authentication/PasswdUserDBAuthentication.java +++ b/base/common/src/com/netscape/cmscore/authentication/PasswdUserDBAuthentication.java @@ -191,7 +191,11 @@ public class PasswdUserDBAuthentication implements IAuthManager { e.printStackTrace(); // not a user in our user/group database. log(ILogger.LL_SECURITY, CMS.getLogMessage("CMSCORE_AUTH_UID_NOT_FOUND", uid, e.toString())); - throw new EInvalidCredentials(CMS.getUserMessage("CMS_AUTHENTICATION_INVALID_CREDENTIAL")); + throw new EInvalidCredentials(CMS.getUserMessage("CMS_AUTHENTICATION_INVALID_CREDENTIAL") + " " + e.getMessage()); + } + if (user == null) { + throw new EInvalidCredentials(CMS.getUserMessage("CMS_AUTHENTICATION_INTERNAL_ERROR", + "Failure in User Group subsystem.")); } authToken.set(TOKEN_USERDN, user.getUserDN()); authToken.set(TOKEN_USERID, user.getUserID()); -- cgit