version 1.22, 2006/08/09 21:13:04
|
version 1.23, 2007/04/03 18:50:58
|
|
|
// | // |
//============================================================================== | //============================================================================== |
// | // |
// Author: Sushma Fernandes, Hewlett Packard Company (sushma_fernandes@hp.com) |
|
// |
|
// Modified By: |
|
// Amit K Arora, IBM (amita@in.ibm.com) for PEP#101 |
|
// Josephine Eskaline Joyce (jojustin@in.ibm.com) for PEP#101 |
|
// Josephine Eskaline Joyce (jojustin@in.ibm.com) for Bug#2486 |
|
// David Dillard, VERITAS Software Corp. |
|
// (david.dillard@veritas.com) |
|
// |
|
//%//////////////////////////////////////////////////////////////////////////// | //%//////////////////////////////////////////////////////////////////////////// |
| |
| |
|
|
| |
#include <Pegasus/Security/UserManager/UserFileHandler.h> | #include <Pegasus/Security/UserManager/UserFileHandler.h> |
#include <Pegasus/Security/UserManager/UserExceptions.h> | #include <Pegasus/Security/UserManager/UserExceptions.h> |
#include <Pegasus/Common/MessageLoader.h> //l10n |
#include <Pegasus/Common/MessageLoader.h> |
| |
PEGASUS_USING_STD; | PEGASUS_USING_STD; |
| |
|
|
} | } |
catch (TimeOut&) | catch (TimeOut&) |
{ | { |
//l10n |
throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, |
//throw PEGASUS_CIM_EXCEPTION( CIM_ERR_FAILED, |
MessageLoaderParms( |
//"Timed out trying to perform requested operation." |
"Security.UserManager.UserFileHandler.TIMEOUT", |
//"Please re-try the operation again."); |
"Timed out while attempting to perform the requested " |
throw PEGASUS_CIM_EXCEPTION_L( CIM_ERR_FAILED, MessageLoaderParms("Security.UserManager.UserFileHandler.TIMEOUT", |
"operation. Try the operation again.")); |
"Timed out trying to perform requested operation.Please re-try the operation again.")); |
|
} | } |
catch (WaitFailed&) | catch (WaitFailed&) |
{ | { |
//l10n |
throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, |
//throw PEGASUS_CIM_EXCEPTION( CIM_ERR_FAILED, |
MessageLoaderParms( |
//"Timed out trying to perform requested operation." |
"Security.UserManager.UserFileHandler.TIMEOUT", |
//"Please re-try the operation again."); |
"Timed out while attempting to perform the requested " |
throw PEGASUS_CIM_EXCEPTION_L( CIM_ERR_FAILED, MessageLoaderParms("Security.UserManager.UserFileHandler.TIMEOUT", |
"operation. Try the operation again.")); |
"Timed out trying to perform requested operation.Please re-try the operation again.")); |
|
} | } |
catch (Deadlock&) | catch (Deadlock&) |
{ | { |
//l10n |
throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, |
//throw PEGASUS_CIM_EXCEPTION( CIM_ERR_FAILED, |
MessageLoaderParms( |
//"Deak lock encountered trying to perform requested operation." |
"Security.UserManager.UserFileHandler.DEADLOCK", |
//"Please re-try the operation again."); |
"Deadlock encountered while attempting to perform the " |
throw PEGASUS_CIM_EXCEPTION_L( CIM_ERR_FAILED, MessageLoaderParms("Security.UserManager.UserFileHandler.DEADLOCK", |
"requested operation. Try the operation again.")); |
"Deak lock encountered trying to perform requested operation.Please re-try the operation again.")); |
|
} | } |
| |
switch (operation) | switch (operation) |
|
|
if (!_passwordTable.insert(userName,password)) | if (!_passwordTable.insert(userName,password)) |
{ | { |
_mutex->unlock(); | _mutex->unlock(); |
//l10n |
Logger::put_l( |
//Logger::put(Logger::ERROR_LOG, System::CIMSERVER, |
Logger::ERROR_LOG, System::CIMSERVER, Logger::SEVERE, |
//Logger::SEVERE, |
"Security.UserManager.UserFileHandler." |
//"Error updating user information for : $0.",userName); |
"ERROR_UPDATING_USER_INFO", |
Logger::put_l(Logger::ERROR_LOG, System::CIMSERVER,Logger::SEVERE, |
"Error updating the user information for user $0.", |
"Security.UserManager.UserFileHandler.ERROR_UPDATING_USER_INFO", |
userName); |
"Error updating user information for : $0.",userName); |
|
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
throw PasswordCacheError(); | throw PasswordCacheError(); |
} | } |
|
|
const String& password) | const String& password) |
{ | { |
char salt[3]; | char salt[3]; |
String encryptedPassword = String::EMPTY; |
String encryptedPassword; |
| |
PEG_METHOD_ENTER(TRC_USER_MANAGER, "UserFileHandler::addUserEntry"); | PEG_METHOD_ENTER(TRC_USER_MANAGER, "UserFileHandler::addUserEntry"); |
| |
|
|
const String& newPassword ) | const String& newPassword ) |
{ | { |
char salt[3]; | char salt[3]; |
String encryptedPassword = String::EMPTY; |
String encryptedPassword; |
| |
PEG_METHOD_ENTER(TRC_USER_MANAGER, "UserFileHandler::modifyUserEntry"); | PEG_METHOD_ENTER(TRC_USER_MANAGER, "UserFileHandler::modifyUserEntry"); |
| |
|
|
"UserFileHandler::verifyCIMUserPassword"); | "UserFileHandler::verifyCIMUserPassword"); |
| |
// Check if the user's password mathches the specified password | // Check if the user's password mathches the specified password |
String curPassword = String::EMPTY; |
String curPassword; |
String encryptedPassword = String::EMPTY; |
String encryptedPassword; |
String saltStr = String::EMPTY; |
String saltStr; |
| |
// Check if the user exists in the password table | // Check if the user exists in the password table |
if ( !_passwordTable.lookup(userName,curPassword) ) | if ( !_passwordTable.lookup(userName,curPassword) ) |