Commit 8b57f78f authored by David COME's avatar David COME
Browse files

Merge remote branch 'origin/master' into tapeserver

Conflicts:
	castor/legacymsg/TapeserverProxyTcpIp.cpp
	castor/tape/tapeserver/daemon/LabelSession.cpp
	castor/tape/tapeserver/daemon/TapeDaemonMain.cpp
	test/CMakeLists.txt
parents 4a5f4609 355220e3
......@@ -27,7 +27,6 @@
#include <vector>
#include <map>
#include "castor/exception/Exception.hpp"
#include "castor/exception/Internal.hpp"
// Local Includes
#include "ICnvFactory.hpp"
......@@ -99,7 +98,7 @@ castor::IConverter* castor::BaseCnvSvc::converter
const castor::ICnvFactory* fac =
castor::Converters::instance()->cnvFactory(repType(), objType);
if (0 == fac) {
castor::exception::Internal e;
castor::exception::Exception e;
e.getMessage() << "No factory found for object type "
<< objType << " and representation type "
<< repType();
......@@ -108,7 +107,7 @@ castor::IConverter* castor::BaseCnvSvc::converter
m_converters[objType] = fac->instantiate(this);
if (0!= m_converters[objType]) return m_converters[objType];
// Throw an exception since we did not find any suitable converter
castor::exception::Internal e;
castor::exception::Exception e;
e.getMessage() << "No converter for object type "
<< objType << " and representation type "
<< repType();
......
......@@ -28,7 +28,6 @@
#include "castor/Services.hpp"
#include "castor/BaseObject.hpp"
#include "castor/exception/Exception.hpp"
#include "castor/exception/Internal.hpp"
#include <Cmutex.h>
//------------------------------------------------------------------------------
......
......@@ -327,7 +327,6 @@ if (${COMPILE_SERVER} STREQUAL "1")
exception/CommandLineNotParsed.hpp
exception/Communication.hpp
exception/Exception.hpp
exception/Internal.hpp
exception/InvalidArgument.hpp
exception/InvalidNbArguments.hpp
exception/NoEntry.hpp
......
......@@ -33,7 +33,6 @@
#include "IObject.hpp"
#include "ICnvSvc.hpp"
#include "castor/exception/Exception.hpp"
#include "castor/exception/Internal.hpp"
//-----------------------------------------------------------------------------
// Constructor
......@@ -67,7 +66,7 @@ castor::IService* castor::Services::service(const std::string name,
const ISvcFactory* fac = castor::Factories::instance()->factory(id);
// if no factory is available, complain
if (0 == fac) {
castor::exception::Internal e;
castor::exception::Exception e;
e.getMessage() << "No factory found for object type " << id;
throw e;
}
......@@ -75,7 +74,7 @@ castor::IService* castor::Services::service(const std::string name,
IService* svc = fac->instantiate(name);
// if the service was not instantiated, complain
if (0 == svc) {
castor::exception::Internal e;
castor::exception::Exception e;
e.getMessage() << "No service found for service " << name;
throw e;
} else {
......@@ -162,7 +161,7 @@ castor::Services::cnvSvcFromAddress(castor::IAddress* address)
throw (castor::exception::Exception) {
// check address
if (0 == address) {
castor::exception::Internal ex;
castor::exception::Exception ex;
ex.getMessage() << "No appropriate converter for a null address !";
throw ex;
}
......@@ -170,7 +169,7 @@ castor::Services::cnvSvcFromAddress(castor::IAddress* address)
castor::ICnvSvc *cnvSvc =
cnvService(address->cnvSvcName(), address->cnvSvcType());
if (0 == cnvSvc) {
castor::exception::Internal ex;
castor::exception::Exception ex;
ex.getMessage() << "No conversion service with name "
<< address->cnvSvcName() << " and type "
<< address->cnvSvcType();
......
......@@ -36,7 +36,6 @@
#include "Cgrp.h"
#include "Cnetdb.h"
#include "common.h"
#include "castor/exception/Internal.hpp"
#include "castor/exception/OutOfMemory.hpp"
//------------------------------------------------------------------------------
......@@ -162,27 +161,27 @@ void castor::System::switchToCastorSuperuser()
// Get information on generic stage account from password file
if ((stage_passwd = Cgetpwnam(STAGERSUPERUSER)) == NULL) {
castor::exception::Internal e;
castor::exception::Exception e;
e.getMessage() << "Castor super user " << STAGERSUPERUSER
<< " not found in password file";
throw e;
}
// verify existence of its primary group id
if (Cgetgrgid(stage_passwd->pw_gid) == NULL) {
castor::exception::Internal e;
castor::exception::Exception e;
e.getMessage() << "Castor super user group does not exist";
throw e;
}
// Get information on generic stage account from group file
if ((stage_group = Cgetgrnam(STAGERSUPERGROUP)) == NULL) {
castor::exception::Internal e;
castor::exception::Exception e;
e.getMessage() << "Castor super user group " << STAGERSUPERGROUP
<< " not found in group file";
throw e;
}
// Verify consistency
if (stage_group->gr_gid != stage_passwd->pw_gid) {
castor::exception::Internal e;
castor::exception::Exception e;
e.getMessage() << "Inconsistent password file. The group of the "
<< "castor superuser " << STAGERSUPERUSER
<< " should be " << stage_group->gr_gid
......@@ -192,25 +191,25 @@ void castor::System::switchToCastorSuperuser()
}
// Undo group privilege
if (setregid (egid, rgid) < 0) {
castor::exception::Internal e;
castor::exception::Exception e;
e.getMessage() << "Unable to undo group privilege";
throw e;
}
// Undo user privilege
if (setreuid (euid, ruid) < 0) {
castor::exception::Internal e;
castor::exception::Exception e;
e.getMessage() << "Unable to undo user privilege";
throw e;
}
// set the effective privileges to superuser
if (setegid(stage_passwd->pw_gid) < 0) {
castor::exception::Internal e;
castor::exception::Exception e;
e.getMessage() << "Unable to set group privileges of Castor Superuser. "
<< "You may want to check that the suid bit is set properly";
throw e;
}
if (seteuid(stage_passwd->pw_uid) < 0) {
castor::exception::Internal e;
castor::exception::Exception e;
e.getMessage() << "Unable to set privileges of Castor Superuser.";
throw e;
}
......
......@@ -52,7 +52,6 @@
#include "castor/client/IResponseHandler.hpp"
#include "castor/exception/Exception.hpp"
#include "castor/exception/Communication.hpp"
#include "castor/exception/Internal.hpp"
#include "castor/exception/InvalidArgument.hpp"
#include "stager_client_api_common.hpp"
......@@ -191,7 +190,7 @@ castor::IClient* castor::client::BaseClient::createClient()
throw (castor::exception::Exception) {
// if no callbackSocket
if (0 == m_callbackSocket) {
castor::exception::Internal ex;
castor::exception::Exception ex;
ex.getMessage() << "No call back socket available";
throw ex;
}
......@@ -599,7 +598,7 @@ void castor::client::BaseClient::pollAnswersFromStager
// Check parameters
if ((req == NULL) || (req->client() == NULL)) {
castor::exception::Internal ex;
castor::exception::Exception ex;
ex.getMessage() << "Passed Request is NULL" << std::endl;
throw ex;
}
......
......@@ -28,7 +28,6 @@
#include "castor/IObject.hpp"
#include "castor/Services.hpp"
#include "castor/exception/Exception.hpp"
#include "castor/exception/Internal.hpp"
// Local Files
#include "DbBaseObj.hpp"
......@@ -51,7 +50,7 @@ void castor::db::DbBaseObj::initCnvSvc()
m_cnvSvc = dynamic_cast<castor::db::DbCnvSvc*>
(svcs()->cnvService(m_cnvSvcName, SVC_DBCNV));
if (!m_cnvSvc) {
castor::exception::Internal ex;
castor::exception::Exception ex;
ex.getMessage() << "No DbCnvSvc available";
throw ex;
}
......
......@@ -33,7 +33,6 @@
#include "castor/VectorAddress.hpp"
#include "castor/exception/BadVersion.hpp"
#include "castor/exception/Exception.hpp"
#include "castor/exception/Internal.hpp"
#include "castor/exception/InvalidArgument.hpp"
#include "castor/exception/NoEntry.hpp"
#include <iomanip>
......
......@@ -35,7 +35,6 @@
#include "castor/bwlist/ChangePrivilege.hpp"
#include "castor/db/DbCnvSvc.hpp"
#include "castor/exception/Exception.hpp"
#include "castor/exception/Internal.hpp"
#include "castor/exception/InvalidArgument.hpp"
#include "castor/exception/NoEntry.hpp"
#include "castor/exception/OutOfMemory.hpp"
......@@ -170,7 +169,7 @@ void castor::db::cnv::DbBWUserCnv::fillRep(castor::IAddress*,
cnvSvc()->commit();
}
} catch (castor::exception::SQLError& e) {
castor::exception::Internal ex;
castor::exception::Exception ex;
ex.getMessage() << "Error in fillRep for type " << type
<< std::endl << e.getMessage().str() << std::endl;
throw ex;
......
......@@ -32,7 +32,6 @@
#include "castor/VectorAddress.hpp"
#include "castor/db/DbCnvSvc.hpp"
#include "castor/exception/Exception.hpp"
#include "castor/exception/Internal.hpp"
#include "castor/exception/InvalidArgument.hpp"
#include "castor/exception/NoEntry.hpp"
#include "castor/exception/OutOfMemory.hpp"
......@@ -152,7 +151,7 @@ void castor::db::cnv::DbBaseAddressCnv::fillRep(castor::IAddress*,
cnvSvc()->commit();
}
} catch (castor::exception::SQLError& e) {
castor::exception::Internal ex;
castor::exception::Exception ex;
ex.getMessage() << "Error in fillRep for type " << type
<< std::endl << e.getMessage().str() << std::endl;
throw ex;
......
......@@ -24,7 +24,6 @@
*****************************************************************************/
// Include Files
#include "castor/exception/Internal.hpp"
#include "castor/db/DbCnvSvc.hpp"
#include "castor/Constants.hpp"
#include "castor/IObject.hpp"
......
......@@ -37,7 +37,6 @@
#include "castor/bwlist/RequestType.hpp"
#include "castor/db/DbCnvSvc.hpp"
#include "castor/exception/Exception.hpp"
#include "castor/exception/Internal.hpp"
#include "castor/exception/InvalidArgument.hpp"
#include "castor/exception/NoEntry.hpp"
#include "castor/exception/OutOfMemory.hpp"
......@@ -232,7 +231,7 @@ void castor::db::cnv::DbChangePrivilegeCnv::fillRep(castor::IAddress*,
cnvSvc()->commit();
}
} catch (castor::exception::SQLError& e) {
castor::exception::Internal ex;
castor::exception::Exception ex;
ex.getMessage() << "Error in fillRep for type " << type
<< std::endl << e.getMessage().str() << std::endl;
throw ex;
......
......@@ -32,7 +32,6 @@
#include "castor/VectorAddress.hpp"
#include "castor/db/DbCnvSvc.hpp"
#include "castor/exception/Exception.hpp"
#include "castor/exception/Internal.hpp"
#include "castor/exception/InvalidArgument.hpp"
#include "castor/exception/NoEntry.hpp"
#include "castor/exception/OutOfMemory.hpp"
......@@ -153,7 +152,7 @@ void castor::db::cnv::DbClientCnv::fillRep(castor::IAddress*,
cnvSvc()->commit();
}
} catch (castor::exception::SQLError& e) {
castor::exception::Internal ex;
castor::exception::Exception ex;
ex.getMessage() << "Error in fillRep for type " << type
<< std::endl << e.getMessage().str() << std::endl;
throw ex;
......
......@@ -32,7 +32,6 @@
#include "castor/VectorAddress.hpp"
#include "castor/db/DbCnvSvc.hpp"
#include "castor/exception/Exception.hpp"
#include "castor/exception/Internal.hpp"
#include "castor/exception/InvalidArgument.hpp"
#include "castor/exception/NoEntry.hpp"
#include "castor/exception/OutOfMemory.hpp"
......@@ -153,7 +152,7 @@ void castor::db::cnv::DbClientIdentificationCnv::fillRep(castor::IAddress*,
cnvSvc()->commit();
}
} catch (castor::exception::SQLError& e) {
castor::exception::Internal ex;
castor::exception::Exception ex;
ex.getMessage() << "Error in fillRep for type " << type
<< std::endl << e.getMessage().str() << std::endl;
throw ex;
......
......@@ -32,7 +32,6 @@
#include "castor/VectorAddress.hpp"
#include "castor/db/DbCnvSvc.hpp"
#include "castor/exception/Exception.hpp"
#include "castor/exception/Internal.hpp"
#include "castor/exception/InvalidArgument.hpp"
#include "castor/exception/NoEntry.hpp"
#include "castor/exception/OutOfMemory.hpp"
......@@ -153,7 +152,7 @@ void castor::db::cnv::DbDeviceGroupNameCnv::fillRep(castor::IAddress*,
cnvSvc()->commit();
}
} catch (castor::exception::SQLError& e) {
castor::exception::Internal ex;
castor::exception::Exception ex;
ex.getMessage() << "Error in fillRep for type " << type
<< std::endl << e.getMessage().str() << std::endl;
throw ex;
......
......@@ -34,7 +34,6 @@
#include "castor/VectorAddress.hpp"
#include "castor/db/DbCnvSvc.hpp"
#include "castor/exception/Exception.hpp"
#include "castor/exception/Internal.hpp"
#include "castor/exception/InvalidArgument.hpp"
#include "castor/exception/NoEntry.hpp"
#include "castor/exception/OutOfMemory.hpp"
......@@ -187,7 +186,7 @@ void castor::db::cnv::DbDiskPoolQueryCnv::fillRep(castor::IAddress*,
cnvSvc()->commit();
}
} catch (castor::exception::SQLError& e) {
castor::exception::Internal ex;
castor::exception::Exception ex;
ex.getMessage() << "Error in fillRep for type " << type
<< std::endl << e.getMessage().str() << std::endl;
throw ex;
......
......@@ -32,7 +32,6 @@
#include "castor/VectorAddress.hpp"
#include "castor/db/DbCnvSvc.hpp"
#include "castor/exception/Exception.hpp"
#include "castor/exception/Internal.hpp"
#include "castor/exception/InvalidArgument.hpp"
#include "castor/exception/NoEntry.hpp"
#include "castor/exception/OutOfMemory.hpp"
......@@ -153,7 +152,7 @@ void castor::db::cnv::DbFileClassCnv::fillRep(castor::IAddress*,
cnvSvc()->commit();
}
} catch (castor::exception::SQLError& e) {
castor::exception::Internal ex;
castor::exception::Exception ex;
ex.getMessage() << "Error in fillRep for type " << type
<< std::endl << e.getMessage().str() << std::endl;
throw ex;
......
......@@ -34,7 +34,6 @@
#include "castor/VectorAddress.hpp"
#include "castor/db/DbCnvSvc.hpp"
#include "castor/exception/Exception.hpp"
#include "castor/exception/Internal.hpp"
#include "castor/exception/InvalidArgument.hpp"
#include "castor/exception/NoEntry.hpp"
#include "castor/exception/OutOfMemory.hpp"
......@@ -186,7 +185,7 @@ void castor::db::cnv::DbFiles2DeleteCnv::fillRep(castor::IAddress*,
cnvSvc()->commit();
}
} catch (castor::exception::SQLError& e) {
castor::exception::Internal ex;
castor::exception::Exception ex;
ex.getMessage() << "Error in fillRep for type " << type
<< std::endl << e.getMessage().str() << std::endl;
throw ex;
......
......@@ -34,7 +34,6 @@
#include "castor/VectorAddress.hpp"
#include "castor/db/DbCnvSvc.hpp"
#include "castor/exception/Exception.hpp"
#include "castor/exception/Internal.hpp"
#include "castor/exception/InvalidArgument.hpp"
#include "castor/exception/NoEntry.hpp"
#include "castor/exception/OutOfMemory.hpp"
......@@ -210,7 +209,7 @@ void castor::db::cnv::DbFilesDeletedCnv::fillRep(castor::IAddress*,
cnvSvc()->commit();
}
} catch (castor::exception::SQLError& e) {
castor::exception::Internal ex;
castor::exception::Exception ex;
ex.getMessage() << "Error in fillRep for type " << type
<< std::endl << e.getMessage().str() << std::endl;
throw ex;
......
......@@ -34,7 +34,6 @@
#include "castor/VectorAddress.hpp"
#include "castor/db/DbCnvSvc.hpp"
#include "castor/exception/Exception.hpp"
#include "castor/exception/Internal.hpp"
#include "castor/exception/InvalidArgument.hpp"
#include "castor/exception/NoEntry.hpp"
#include "castor/exception/OutOfMemory.hpp"
......@@ -210,7 +209,7 @@ void castor::db::cnv::DbFilesDeletionFailedCnv::fillRep(castor::IAddress*,
cnvSvc()->commit();
}
} catch (castor::exception::SQLError& e) {
castor::exception::Internal ex;
castor::exception::Exception ex;
ex.getMessage() << "Error in fillRep for type " << type
<< std::endl << e.getMessage().str() << std::endl;
throw ex;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment