Commit 34d5f429 authored by Elvin Sindrilaru's avatar Elvin Sindrilaru
Browse files

XROOTD: Rename XrdxCastor2ServerAcc to XrdxCastor2Acc

parent 5a9feb0a
%attr(0755,root,root) usr/lib/libxrdxcastor2serveracc.so*
%attr(0755,root,root) usr/lib/libxrdxcastor2acc.so*
%attr(0755,root,root) usr/lib/libxrdxcastor2ofs.so*
%attr(0755,root,root) usr/lib/libxrdxcastor2fs.so*
%attr(0755,root,root) usr/bin/x2proc
......
......@@ -34,7 +34,7 @@ set (XRDXCASTOR2FS_LIB_SRC_FILES
XrdxCastor2FsFile.cpp
XrdxCastor2FsDirectory.cpp
XrdxCastor2FsStats.cpp
XrdxCastor2ServerAcc.cpp
XrdxCastor2Acc.cpp
XrdxCastor2Stager.cpp
XrdxCastor2Proc.cpp
XrdxCastorLogging.cpp
......@@ -49,16 +49,16 @@ target_link_libraries (xrdxcastor2fs castorclient castorcommon castorns crypto
install (TARGETS xrdxcastor2fs DESTINATION ${CASTOR_DEST_LIB_DIR})
################################################################################
# Rules to build and install libXrdxCastor2ServerAcc.so
# Rules to build and install libXrdxCastor2Acc.so
################################################################################
set (XRDXCASTOR2SERVERACC_LIB_SRC_FILES
XrdxCastor2ServerAcc.cpp
set (XRDXCASTOR2ACC_LIB_SRC_FILES
XrdxCastor2Acc.cpp
XrdxCastorLogging.cpp
XrdxCastorTiming.cpp)
add_library (xrdxcastor2serveracc SHARED ${XRDXCASTOR2SERVERACC_LIB_SRC_FILES})
CastorSetLibraryVersions (xrdxcastor2serveracc)
target_link_libraries (xrdxcastor2serveracc crypto ${UUID_LIB} ${XROOTD_XRDUTILS_LIB})
install (TARGETS xrdxcastor2serveracc DESTINATION ${CASTOR_DEST_LIB_DIR})
add_library (xrdxcastor2acc SHARED ${XRDXCASTOR2ACC_LIB_SRC_FILES})
CastorSetLibraryVersions (xrdxcastor2acc)
target_link_libraries (xrdxcastor2acc crypto ${UUID_LIB} ${XROOTD_XRDUTILS_LIB})
install (TARGETS xrdxcastor2acc DESTINATION ${CASTOR_DEST_LIB_DIR})
################################################################################
# Rules to build and install libXrdxCastor2Ofs.so
......
......@@ -27,7 +27,7 @@
#include <sstream>
/*-----------------------------------------------------------------------------*/
#include "XrdVersion.hh"
#include "XrdxCastor2ServerAcc.hpp"
#include "XrdxCastor2Acc.hpp"
#include "XrdxCastorTiming.hpp"
/*-----------------------------------------------------------------------------*/
#include "XrdSec/XrdSecInterface.hh"
......@@ -38,8 +38,8 @@
#include "XrdSys/XrdSysDNS.hh"
/*-----------------------------------------------------------------------------*/
XrdSysError TkEroute(0, "xCastorServerAcc");
XrdVERSIONINFO(XrdAccAuthorizeObject, xCastor2ServAcc);
XrdSysError AccEroute(0, "xCastor2Acc_");
XrdVERSIONINFO(XrdAccAuthorizeObject, xCastor2Acc);
//------------------------------------------------------------------------------
// XrdAccAuthorizeObject() is called to obtain an instance of the auth object
......@@ -55,28 +55,26 @@ extern "C" XrdAccAuthorize* XrdAccAuthorizeObject(XrdSysLogger* lp,
const char* cfn,
const char* parm)
{
TkEroute.SetPrefix("XrdxCastor2ServerAcc::");
TkEroute.logger(lp);
TkEroute.Say("++++++ (c) 2008 CERN/IT-DM-SMD ",
"xCastor2ServerAcc (xCastor File System) v 1.0");
XrdAccAuthorize* acc = (XrdAccAuthorize*) new XrdxCastor2ServerAcc();
AccEroute.logger(lp);
AccEroute.Say("++++++ (c) 2014 CERN/IT-DSS xCastor2Acc v1.0");
XrdAccAuthorize* acc = (XrdAccAuthorize*) new XrdxCastor2Acc();
if (!acc)
{
TkEroute.Say("------ xCastor2ServerAcc Allocation Failed!");
AccEroute.Say("------ xCastor2Acc allocation failed!");
return 0;
}
if (!(((XrdxCastor2ServerAcc*) acc)->Configure(cfn)) ||
(!(((XrdxCastor2ServerAcc*) acc)->Init())))
if (!((XrdxCastor2Acc*) acc)->Configure(cfn) ||
(!((XrdxCastor2Acc*) acc)->Init()))
{
TkEroute.Say("------ xCastor2ServerAcc initialization failed!");
AccEroute.Say("------ xCastor2Acc initialization failed!");
delete acc;
return 0;
}
else
{
TkEroute.Say("------ xCastor2ServerAcc initialization completed");
AccEroute.Say("++++++ xCastor2Acc initialization completed");
return acc;
}
}
......@@ -85,7 +83,7 @@ extern "C" XrdAccAuthorize* XrdAccAuthorizeObject(XrdSysLogger* lp,
//------------------------------------------------------------------------------
// Constructor
//------------------------------------------------------------------------------
XrdxCastor2ServerAcc::XrdxCastor2ServerAcc():
XrdxCastor2Acc::XrdxCastor2Acc():
XrdAccAuthorize(),
LogId(),
mAuthCertfile(""),
......@@ -102,7 +100,7 @@ XrdxCastor2ServerAcc::XrdxCastor2ServerAcc():
//------------------------------------------------------------------------------
// Destructor
//------------------------------------------------------------------------------
XrdxCastor2ServerAcc::~XrdxCastor2ServerAcc()
XrdxCastor2Acc::~XrdxCastor2Acc()
{ }
......@@ -110,12 +108,12 @@ XrdxCastor2ServerAcc::~XrdxCastor2ServerAcc()
// Configure the authorisation plugin
//------------------------------------------------------------------------------
bool
XrdxCastor2ServerAcc::Configure(const char* conf_file)
XrdxCastor2Acc::Configure(const char* conf_file)
{
char* var;
const char* val;
int cfgFD, NoGo = 0;
XrdOucStream Config(&TkEroute, getenv("XRDINSTANCE"));
XrdOucStream Config(&AccEroute, getenv("XRDINSTANCE"));
if (!conf_file || !*conf_file)
{
......@@ -258,7 +256,7 @@ XrdxCastor2ServerAcc::Configure(const char* conf_file)
// Initalise the plugin - get the public/private keys for signing
//------------------------------------------------------------------------------
bool
XrdxCastor2ServerAcc::Init()
XrdxCastor2Acc::Init()
{
// Read in the public key
if (!mAuthCertfile.empty())
......@@ -322,7 +320,7 @@ XrdxCastor2ServerAcc::Init()
// Signature with base64 encoding ( hash - sign - encode base64 )
//------------------------------------------------------------------------------
bool
XrdxCastor2ServerAcc::SignBase64(unsigned char* input,
XrdxCastor2Acc::SignBase64(unsigned char* input,
int inputlen,
std::string& sb64,
int& sb64len)
......@@ -397,7 +395,7 @@ XrdxCastor2ServerAcc::SignBase64(unsigned char* input,
// Verify if the data buffer matches the signature provided in base64buffer
//------------------------------------------------------------------------------
bool
XrdxCastor2ServerAcc::VerifyUnbase64(const char* data,
XrdxCastor2Acc::VerifyUnbase64(const char* data,
unsigned char* base64buffer,
const char* path)
{
......@@ -479,7 +477,7 @@ XrdxCastor2ServerAcc::VerifyUnbase64(const char* data,
// Decode opaque information
//------------------------------------------------------------------------------
bool
XrdxCastor2ServerAcc::Decode(const char* opaque, AuthzInfo& authz)
XrdxCastor2Acc::Decode(const char* opaque, AuthzInfo& authz)
{
if (!opaque) return false;
......@@ -583,7 +581,7 @@ XrdxCastor2ServerAcc::Decode(const char* opaque, AuthzInfo& authz)
// structure and sign all this with the private key of the server.
//------------------------------------------------------------------------------
std::string
XrdxCastor2ServerAcc::GetOpaqueAcc(AuthzInfo& authz, bool doSign)
XrdxCastor2Acc::GetOpaqueAcc(AuthzInfo& authz, bool doSign)
{
// Build authorization token
std::string token = BuildToken(authz);
......@@ -629,7 +627,7 @@ XrdxCastor2ServerAcc::GetOpaqueAcc(AuthzInfo& authz, bool doSign)
// Build the autorization token used for signing
//------------------------------------------------------------------------------
std::string
XrdxCastor2ServerAcc::BuildToken(const AuthzInfo& authz)
XrdxCastor2Acc::BuildToken(const AuthzInfo& authz)
{
std::ostringstream sstr;
sstr << authz.sfn
......@@ -650,7 +648,7 @@ XrdxCastor2ServerAcc::BuildToken(const AuthzInfo& authz)
// the specified operation
//------------------------------------------------------------------------------
XrdAccPrivs
XrdxCastor2ServerAcc::Access(const XrdSecEntity* Entity,
XrdxCastor2Acc::Access(const XrdSecEntity* Entity,
const char* path,
const Access_Operation oper,
XrdOucEnv* Env)
......@@ -681,7 +679,7 @@ XrdxCastor2ServerAcc::Access(const XrdSecEntity* Entity,
if (!Env)
{
xcastor_err("no opaque information for path=%s", path);
TkEroute.Emsg("Access", EIO, "no opaque information for path=", path);
AccEroute.Emsg("Access", EIO, "no opaque information for path=", path);
return XrdAccPriv_None;
}
......@@ -691,7 +689,7 @@ XrdxCastor2ServerAcc::Access(const XrdSecEntity* Entity,
if (!opaque)
{
TkEroute.Emsg("Access", EIO, "no opaque information for sfn=", path);
AccEroute.Emsg("Access", EIO, "no opaque information for sfn=", path);
return XrdAccPriv_None;
}
......@@ -712,11 +710,11 @@ XrdxCastor2ServerAcc::Access(const XrdSecEntity* Entity,
// Decode the authz information from the opaque info
if (mRequireCapability)
{
XrdxCastor2ServerAcc::AuthzInfo authz;
XrdxCastor2Acc::AuthzInfo authz;
if (!Decode(opaque, authz))
{
TkEroute.Emsg("Access", EACCES, "decode access token for sfn=", path);
AccEroute.Emsg("Access", EACCES, "decode access token for sfn=", path);
return XrdAccPriv_None;
}
......@@ -725,7 +723,7 @@ XrdxCastor2ServerAcc::Access(const XrdSecEntity* Entity,
if (ref_token.empty())
{
TkEroute.Emsg("Access", EACCES, "build reference token for sfn=", path);
AccEroute.Emsg("Access", EACCES, "build reference token for sfn=", path);
return XrdAccPriv_None;
}
......@@ -733,7 +731,7 @@ XrdxCastor2ServerAcc::Access(const XrdSecEntity* Entity,
if ((!VerifyUnbase64(ref_token.c_str(),
(unsigned char*)authz.signature.c_str(), path)))
{
TkEroute.Emsg("Access", EACCES, "verify signature in request sfn=", path);
AccEroute.Emsg("Access", EACCES, "verify signature in request sfn=", path);
return XrdAccPriv_None;
}
......@@ -743,7 +741,7 @@ XrdxCastor2ServerAcc::Access(const XrdSecEntity* Entity,
// If it does not fit, check that it is a replica location
if (authz.pfn2.find(authz.pfn1) == std::string::npos)
{
TkEroute.Emsg("Access", EACCES, "give access - the signature was not "
AccEroute.Emsg("Access", EACCES, "give access - the signature was not "
"provided for this path!");
return XrdAccPriv_None;
}
......@@ -752,7 +750,7 @@ XrdxCastor2ServerAcc::Access(const XrdSecEntity* Entity,
// Check validity time in authz
if (authz.exptime < now)
{
TkEroute.Emsg("Access", EACCES, "give access - the signature has expired already!");
AccEroute.Emsg("Access", EACCES, "give access - the signature has expired already!");
return XrdAccPriv_None;
}
}
......
......@@ -42,9 +42,9 @@ class XrdOucEnv;
class XrdSecEntity;
//------------------------------------------------------------------------------
//! Class XrdxCastor2ServerAcc
//! Class XrdxCastor2Acc
//------------------------------------------------------------------------------
class XrdxCastor2ServerAcc: public XrdAccAuthorize, public LogId
class XrdxCastor2Acc: public XrdAccAuthorize, public LogId
{
public:
......@@ -69,13 +69,13 @@ class XrdxCastor2ServerAcc: public XrdAccAuthorize, public LogId
//----------------------------------------------------------------------------
//! Constructor
//----------------------------------------------------------------------------
XrdxCastor2ServerAcc();
XrdxCastor2Acc();
//----------------------------------------------------------------------------
//! Destructor
//----------------------------------------------------------------------------
virtual ~XrdxCastor2ServerAcc();
virtual ~XrdxCastor2Acc();
//--------------------------------------------------------------------------
......
......@@ -87,7 +87,7 @@ XrdSfsFileSystem* XrdSfsGetFileSystem(XrdSfsFileSystem* native_fs,
gMgr = &myFS;
// Initialize authorization module ServerAcc used for securing the
// communication betweend redirector and diskserver
gMgr->mServerAcc = (XrdxCastor2ServerAcc*) XrdAccAuthorizeObject(lp, configfn, NULL);
gMgr->mServerAcc = (XrdxCastor2Acc*) XrdAccAuthorizeObject(lp, configfn, NULL);
if (!gMgr->mServerAcc)
{
......@@ -2291,7 +2291,7 @@ int XrdxCastor2Fs::Configure(XrdSysError& Eroute)
// We need to specify this if the server was not started with the explicit
// manager option ... e.g. see XrdOfs. The variable is needed in the
// XrdxCastor2ServerAcc to find out which keys are required to be loaded
// XrdxCastor2Acc to find out which keys are required to be loaded
Eroute.Say("=====> all.role: ", role.c_str(), "");
XrdOucString sTokenLockTime = "";
sTokenLockTime += msTokenLockTime;
......
......@@ -32,7 +32,7 @@
#include "XrdSfs/XrdSfsInterface.hh"
/*-----------------------------------------------------------------------------*/
#include "XrdxCastor2FsStats.hpp"
#include "XrdxCastor2ServerAcc.hpp"
#include "XrdxCastor2Acc.hpp"
#include "XrdxCastor2FsUFS.hpp"
/*-----------------------------------------------------------------------------*/
......@@ -488,7 +488,7 @@ public:
///< up on a disk server in seconds before the token expires
char* ConfigFN; ///< path to config file
XrdxCastor2ServerAcc* mServerAcc; ///< authorization module for token encryption/decryption
XrdxCastor2Acc* mServerAcc; ///< authorization module for token encryption/decryption
std::string mZeroProc; ///< path to a 0-byte file in the proc filesystem
std::string mSrvTargetPort; ///< xrootd port where redirections go on the OFSs - default is 1094
long long xCastor2FsDelayRead; ///< if true, all reads get a default delay to come back later
......
......@@ -545,7 +545,7 @@ XrdxCastor2FsFile::open(const char* path,
}
// Add the opaque authorization information for the server for read & write
XrdxCastor2ServerAcc::AuthzInfo authz;
XrdxCastor2Acc::AuthzInfo authz;
authz.sfn = (char*) origpath;
authz.pfn1 = (char*) resp_info.mRedirectionPfn1.c_str();
authz.pfn2 = (char*) resp_info.mRedirectionPfn2.c_str();
......
......@@ -18,7 +18,6 @@
*
*
* @author Castor Dev team, castor-dev@cern.ch
* @author Castor Dev team, castor-dev@cern.ch
*
******************************************************************************/
......
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