(file) Return to UserFileHandler.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Security / UserManager

Diff for /pegasus/src/Pegasus/Security/UserManager/UserFileHandler.cpp between version 1.8.6.1 and 1.20

version 1.8.6.1, 2003/07/29 15:08:30 version 1.20, 2005/04/22 20:20:11
Line 1 
Line 1 
 //%/////////////////////////////////////////////////////////////////////////////  //%2005////////////////////////////////////////////////////////////////////////
 // //
 // Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM,  // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
 // The Open Group, Tivoli Systems  // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
   // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
   // IBM Corp.; EMC Corporation, The Open Group.
   // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
   // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
   // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
   // EMC Corporation; VERITAS Software Corporation; The Open Group.
 // //
 // Permission is hereby granted, free of charge, to any person obtaining a copy // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to // of this software and associated documentation files (the "Software"), to
Line 24 
Line 30 
 // Author: Sushma Fernandes, Hewlett Packard Company (sushma_fernandes@hp.com) // Author: Sushma Fernandes, Hewlett Packard Company (sushma_fernandes@hp.com)
 // //
 // Modified By: // 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)
 // //
 //%//////////////////////////////////////////////////////////////////////////// //%////////////////////////////////////////////////////////////////////////////
  
Line 35 
Line 46 
 /////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
  
 #include <Pegasus/Common/FileSystem.h> #include <Pegasus/Common/FileSystem.h>
 #include <Pegasus/Common/Destroyer.h>  
 #include <Pegasus/Common/Logger.h> #include <Pegasus/Common/Logger.h>
 #include <Pegasus/Common/System.h> #include <Pegasus/Common/System.h>
 #include <Pegasus/Common/Tracer.h> #include <Pegasus/Common/Tracer.h>
Line 76 
Line 86 
     System::getCurrentTime( sec, milliSec );     System::getCurrentTime( sec, milliSec );
  
     srand( (int) sec );     srand( (int) sec );
   #ifdef PEGASUS_PLATFORM_SOLARIS_SPARC
       Unit32      seed;
       randNum = rand_r(*seed);
   #else
     randNum = rand();     randNum = rand();
   #endif
  
     //     //
     // Make sure the random number generated is between 0-63.     // Make sure the random number generated is between 0-63.
Line 86 
Line 101 
     randNum >>= 6;     randNum >>= 6;
     *salt++ = _SALT_STRING[ randNum & 0x3f ];     *salt++ = _SALT_STRING[ randNum & 0x3f ];
  
     salt[2] = '\0';          *salt = '\0';
  
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
 } }
Line 108 
Line 123 
     // Get the PasswordFilePath property from the Config Manager.     // Get the PasswordFilePath property from the Config Manager.
     //     //
     String passwdFile;     String passwdFile;
     passwdFile = configManager->getCurrentValue(      passwdFile = ConfigManager::getHomedPath(
                        _PROPERTY_NAME_PASSWORD_FILEPATH);          configManager->getCurrentValue(_PROPERTY_NAME_PASSWORD_FILEPATH));
  
     //     //
     // Construct a PasswordFile object.     // Construct a PasswordFile object.
     //     //
     _passwordFile   = new PasswordFile(passwdFile);      _passwordFile.reset(new PasswordFile(passwdFile));
  
     //     //
     // Load the user information in to the cache.     // Load the user information in to the cache.
Line 123 
Line 138 
     {     {
         _loadAllUsers();         _loadAllUsers();
     }     }
     catch  (Exception& e)      catch  (const Exception&)
     {     {
         throw e;          throw;
     }     }
  
     //     //
     // Initialize the mutex, mutex lock needs to be held for any updates     // Initialize the mutex, mutex lock needs to be held for any updates
     // to the password cache and password file.     // to the password cache and password file.
     //     //
     _mutex = new Mutex;      _mutex.reset(new Mutex);
  
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
 } }
Line 145 
Line 160 
 { {
     PEG_METHOD_ENTER(TRC_USER_MANAGER, "UserFileHandler::~UserFileHandler");     PEG_METHOD_ENTER(TRC_USER_MANAGER, "UserFileHandler::~UserFileHandler");
  
     delete _passwordFile;  
     delete _mutex;  
   
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
 } }
  
Line 163 
Line 175 
         _passwordTable.clear();         _passwordTable.clear();
         _passwordFile->load(_passwordTable);         _passwordFile->load(_passwordTable);
     }     }
     catch (CannotOpenFile cof)      catch (CannotOpenFile&)
     {     {
         _passwordTable.clear();         _passwordTable.clear();
         PEG_METHOD_EXIT();         PEG_METHOD_EXIT();
         throw cof;          throw;
     }     }
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
 } }
Line 189 
Line 201 
     {     {
         _mutex->timed_lock(_MUTEX_TIMEOUT, pegasus_thread_self());         _mutex->timed_lock(_MUTEX_TIMEOUT, pegasus_thread_self());
     }     }
     catch (TimeOut e)      catch (TimeOut&)
     {     {
         //l10n         //l10n
         //throw PEGASUS_CIM_EXCEPTION( CIM_ERR_FAILED,         //throw PEGASUS_CIM_EXCEPTION( CIM_ERR_FAILED,
Line 198 
Line 210 
         throw PEGASUS_CIM_EXCEPTION_L( CIM_ERR_FAILED, MessageLoaderParms("Security.UserManager.UserFileHandler.TIMEOUT",         throw PEGASUS_CIM_EXCEPTION_L( CIM_ERR_FAILED, MessageLoaderParms("Security.UserManager.UserFileHandler.TIMEOUT",
                                                                         "Timed out trying to perform requested operation.Please re-try the operation again."));                                                                         "Timed out trying to perform requested operation.Please re-try the operation again."));
     }     }
     catch (WaitFailed e)      catch (WaitFailed&)
     {     {
     //l10n     //l10n
         //throw PEGASUS_CIM_EXCEPTION( CIM_ERR_FAILED,         //throw PEGASUS_CIM_EXCEPTION( CIM_ERR_FAILED,
Line 207 
Line 219 
         throw PEGASUS_CIM_EXCEPTION_L( CIM_ERR_FAILED, MessageLoaderParms("Security.UserManager.UserFileHandler.TIMEOUT",         throw PEGASUS_CIM_EXCEPTION_L( CIM_ERR_FAILED, MessageLoaderParms("Security.UserManager.UserFileHandler.TIMEOUT",
                                                                         "Timed out trying to perform requested operation.Please re-try the operation again."));                                                                         "Timed out trying to perform requested operation.Please re-try the operation again."));
     }     }
     catch (Deadlock e)      catch (Deadlock&)
     {     {
     //l10n     //l10n
         //throw PEGASUS_CIM_EXCEPTION( CIM_ERR_FAILED,         //throw PEGASUS_CIM_EXCEPTION( CIM_ERR_FAILED,
Line 271 
Line 283 
     {     {
         _passwordFile->save(_passwordTable);         _passwordFile->save(_passwordTable);
     }     }
     catch (CannotOpenFile& e)      catch (const CannotOpenFile&)
     {     {
         _mutex->unlock();         _mutex->unlock();
         PEG_METHOD_EXIT();         PEG_METHOD_EXIT();
         throw e;          throw;
     }     }
     catch (CannotRenameFile& e)      catch (const CannotRenameFile&)
     {     {
         //         //
         // reload password hash table from file         // reload password hash table from file
Line 286 
Line 298 
  
         _mutex->unlock();         _mutex->unlock();
         PEG_METHOD_EXIT();         PEG_METHOD_EXIT();
         throw e;          throw;
     }     }
     _mutex->unlock();     _mutex->unlock();
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
Line 347 
Line 359 
             throw PasswordMismatch(userName);             throw PasswordMismatch(userName);
         }         }
     }     }
     catch (Exception& e)      catch (const Exception&)
     {     {
         PEG_METHOD_EXIT();         PEG_METHOD_EXIT();
         throw e;          throw;
     }     }
  
     // encrypt new password     // encrypt new password


Legend:
Removed from v.1.8.6.1  
changed lines
  Added in v.1.20

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2