Commit 410f7aec authored by Daniele Kruse's avatar Daniele Kruse
Browse files

Using refernces of API instead of pointer

parent b83c2612
......@@ -47,8 +47,8 @@ int XrdProDir::checkClient(const XrdSecEntity *client, cta::SecurityIdentity &re
}
std::cout << "Dir request received from client. Username: " << client->name << " uid: " << pwd.pw_uid << " gid: " << pwd.pw_gid << std::endl;
requester.host = client->host;
requester.user.uid = pwd.pw_uid;
requester.user.gid = pwd.pw_gid;
requester.user.setUid(pwd.pw_uid);
requester.user.setGid(pwd.pw_gid);
free(buf);
return SFS_OK;
}
......@@ -62,7 +62,7 @@ int XrdProDir::open(const char *path, const XrdSecEntity *client, const char *op
if(SFS_OK!=checkResult) {
return checkResult;
}
m_itor = m_clientAPI->getDirectoryContents(requester, path);
m_itor = m_userApi.getDirectoryContents(requester, path);
return SFS_OK;
}
......@@ -95,8 +95,7 @@ const char * XrdProDir::FName() {
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
XrdProDir::XrdProDir(cta::MiddleTierAdmin *clientAPI, const char *user, int MonID): error(user, MonID) {
m_clientAPI = clientAPI;
XrdProDir::XrdProDir(cta::MockMiddleTierUser &userApi, const char *user, int MonID): error(user, MonID), m_userApi(userApi) {
}
//------------------------------------------------------------------------------
......
......@@ -5,7 +5,7 @@
#include "XrdSec/XrdSecEntity.hh"
#include "XrdSfs/XrdSfsInterface.hh"
#include "libs/client/MockMiddleTierAdmin.hpp"
#include "libs/client/MockMiddleTierUser.hpp"
class XrdProDir : public XrdSfsDirectory
{
......@@ -15,7 +15,7 @@ public:
virtual const char *nextEntry();
virtual int close();
virtual const char *FName();
XrdProDir(cta::MiddleTierAdmin *clientAPI, const char *user=0, int MonID=0);
XrdProDir(cta::MockMiddleTierUser &userApi, const char *user=0, int MonID=0);
virtual ~XrdProDir();
protected:
......@@ -25,9 +25,9 @@ protected:
cta::DirectoryIterator m_itor;
/**
* Pointer to the client API object
* Pointer to the user API object
*/
cta::MiddleTierAdmin *m_clientAPI;
cta::MockMiddleTierUser &m_userApi;
/**
* Checks whether client has correct permissions and fills the UserIdentity structure
......
......@@ -18,7 +18,7 @@ extern "C"
{
XrdSfsFileSystem *XrdSfsGetFileSystem (XrdSfsFileSystem* native_fs, XrdSysLogger* lp, const char* configfn)
{
return new XrdProFilesystem;
return new XrdProFilesystem();
}
}
......@@ -1028,7 +1028,7 @@ XrdSfsFile * XrdProFilesystem::newFile(char *user, int MonID)
//------------------------------------------------------------------------------
XrdSfsDirectory * XrdProFilesystem::newDir(char *user, int MonID)
{
return new XrdProDir(m_clientAPI, user, MonID);
return new XrdProDir(m_userApi, user, MonID);
}
//------------------------------------------------------------------------------
......
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