#include <XrdProofdAux.h>
Public Member Functions | |
XrdProofdAux () | |
Static Public Member Functions | |
static const char * | AdminMsgType (int type) |
static int | AssertDir (const char *path, XrdProofUI ui, bool changeown) |
static int | ChangeMod (const char *path, unsigned int mode) |
static int | ChangeOwn (const char *path, XrdProofUI ui) |
static int | ChangeToDir (const char *dir, XrdProofUI ui, bool changeown) |
static int | CheckIf (XrdOucStream *s, const char *h) |
static char * | Expand (char *p) |
static void | Expand (XrdOucString &path) |
static void | Form (XrdOucString &s, const char *fmt, int ns, const char *ss[5], int ni, int ii[5], int np, void *pp[5]) |
static void | Form (XrdOucString &s, const char *fmt, const char *s0, const char *s1=0, const char *s2=0, const char *s3=0, const char *s4=0) |
static void | Form (XrdOucString &s, const char *fmt, int i0, int i1=0, int i2=0, int i3=0, int i4=0) |
static void | Form (XrdOucString &s, const char *fmt, void *p0, void *p1=0, void *p2=0, void *p3=0, void *p4=0) |
static void | Form (XrdOucString &s, const char *fmt, int i0, const char *s0, const char *s1=0, const char *s2=0, const char *s3=0) |
static void | Form (XrdOucString &s, const char *fmt, const char *s0, int i0, int i1=0, int i2=0, int i3=0) |
static void | Form (XrdOucString &s, const char *fmt, const char *s0, const char *s1, int i0, int i1, int i2) |
static void | Form (XrdOucString &s, const char *fmt, int i0, int i1, const char *s0, const char *s1, const char *s2) |
static void | Form (XrdOucString &s, const char *fmt, const char *s0, const char *s1, const char *s2, int i0, int i1=0) |
static void | Form (XrdOucString &s, const char *fmt, int i0, int i1, int i2, const char *s0, const char *s1) |
static void | Form (XrdOucString &s, const char *fmt, const char *s0, const char *s1, const char *s2, const char *s3, int i1) |
static void | Form (XrdOucString &s, const char *fmt, int i0, int i1, int i2, int i3, const char *s0) |
static void | Form (XrdOucString &s, const char *fmt, int i0, int i1, void *p0) |
static void | Form (XrdOucString &s, const char *fmt, int i0, int i1, int i2, void *p0) |
static void | Form (XrdOucString &s, const char *fmt, int i0, int i1, int i2, int i3, void *p0) |
static void | Form (XrdOucString &s, const char *fmt, int i0, int i1, void *p0, int i2, int i3=0) |
static void | Form (XrdOucString &s, const char *fmt, void *p0, int i0, int i1) |
static void | Form (XrdOucString &s, const char *fmt, const char *s0, void *p0, int i0, int i1) |
static void | Form (XrdOucString &s, const char *fmt, void *p0, const char *s0, int i0) |
static void | Form (XrdOucString &s, const char *fmt, const char *s0, const char *s1, void *p0) |
static void | Form (XrdOucString &s, const char *fmt, int i0, const char *s0, const char *s1, int i1, int i2=0) |
static void | Form (XrdOucString &s, const char *fmt, int i0, const char *s0, int i1, int i2=0) |
static int | GetIDFromPath (const char *path, XrdOucString &emsg) |
static long int | GetLong (char *str) |
static int | GetNumCPUs () |
static int | GetGroupInfo (const char *grp, XrdProofGI &gi) |
static int | GetGroupInfo (int gid, XrdProofGI &gi) |
static int | GetProcesses (const char *pn, std::map< int, XrdOucString > *plist) |
static int | GetUserInfo (const char *usr, XrdProofUI &ui) |
static int | GetUserInfo (int uid, XrdProofUI &ui) |
static bool | HasToken (const char *s, const char *tokens) |
static int | KillProcess (int pid, bool forcekill, XrdProofUI ui, bool changeown) |
static int | MvDir (const char *oldpath, const char *newpath) |
static int | ParsePidPath (const char *path, XrdOucString &before, XrdOucString &after) |
static int | ParseUsrGrp (const char *path, XrdOucString &usr, XrdOucString &grp) |
static const char * | ProofRequestTypes (int type) |
static int | ReadMsg (int fd, XrdOucString &msg) |
static int | RmDir (const char *path) |
static int | SymLink (const char *path, const char *link) |
static int | Touch (const char *path, int opt=0) |
static int | VerifyProcessByID (int pid, const char *pname="proofserv") |
static int | Write (int fd, const void *buf, size_t nb) |
Static Private Attributes | |
static XrdSysRecMutex | fgFormMutex |
Definition at line 244 of file XrdProofdAux.h.
XrdProofdAux::XrdProofdAux | ( | ) | [inline] |
Definition at line 247 of file XrdProofdAux.h.
const char * XrdProofdAux::AdminMsgType | ( | int | type | ) | [static] |
int XrdProofdAux::AssertDir | ( | const char * | path, | |
XrdProofUI | ui, | |||
bool | changeown | |||
) | [static] |
Definition at line 388 of file XrdProofdAux.cxx.
References XrdProofUI::fGid, XrdProofUI::fUid, mkdir, stat, TRACE, XpdBadPGuard, and XPDLOC.
Referenced by XrdProofdManager::Config(), XrdProofdProofServMgr::Config(), XrdProofdClientMgr::Config(), XrdProofdClientMgr::CreateAdminPath(), XrdProofdProofServMgr::GetTagDirs(), XrdROOTMgr::SetLogDir(), XrdProofdProofServMgr::SetProofServEnv(), XrdProofdProofServMgr::SetProofServEnvOld(), XrdProofdProofServMgr::SetUserOwnerships(), XrdProofdManager::ValidateLocalDataSetSrc(), XrdProofdClient::XrdProofdClient(), and XrdProofdSandbox::XrdProofdSandbox().
int XrdProofdAux::ChangeMod | ( | const char * | path, | |
unsigned int | mode | |||
) | [static] |
Definition at line 530 of file XrdProofdAux.cxx.
References XrdOucString::c_str(), dir(), XrdOucString::endswith(), opendir, readdir, S_ISDIR, stat, TRACE, XpdBadPGuard, and XPDLOC.
Referenced by XrdProofdProofServMgr::SetUserOwnerships(), and XrdProofdManager::ValidateLocalDataSetSrc().
int XrdProofdAux::ChangeOwn | ( | const char * | path, | |
XrdProofUI | ui | |||
) | [static] |
Definition at line 449 of file XrdProofdAux.cxx.
References XrdOucString::c_str(), dir(), XrdOucString::endswith(), XrdProofUI::fGid, XrdProofUI::fUid, opendir, readdir, S_ISDIR, stat, TRACE, XpdBadPGuard, and XPDLOC.
Referenced by XrdProofdProofServMgr::SaveAFSkey(), XrdProofdProofServ::SetAdminPath(), XrdProofdProofServMgr::SetUserOwnerships(), and XrdProofdManager::ValidateLocalDataSetSrc().
int XrdProofdAux::ChangeToDir | ( | const char * | dir, | |
XrdProofUI | ui, | |||
bool | changeown | |||
) | [static] |
Definition at line 613 of file XrdProofdAux.cxx.
References chdir, XrdProofUI::fUid, TRACE, XpdBadPGuard, and XPDLOC.
Referenced by XrdProofdProofServMgr::SetProofServEnv(), and XrdProofdProofServMgr::SetUserEnvironment().
int XrdProofdAux::CheckIf | ( | XrdOucStream * | s, | |
const char * | h | |||
) | [static] |
Definition at line 679 of file XrdProofdAux.cxx.
References h, s, TRACE, val, and XPDLOC.
Referenced by XrdProofdNetMgr::DoDirectiveAdminReqTO(), XrdProofdManager::DoDirectiveAllow(), XrdProofdManager::DoDirectiveAllowedGroups(), XrdProofdManager::DoDirectiveAllowedUsers(), XrdProofdClientMgr::DoDirectiveClientMgr(), XrdProofdManager::DoDirectiveGroupfile(), DoDirectiveInt(), XrdProofdManager::DoDirectiveMaxOldLogs(), XrdProofdManager::DoDirectiveMultiUser(), XrdProofdProofServMgr::DoDirectiveProofServMgr(), XrdProofdManager::DoDirectiveRole(), XrdROOTMgr::DoDirectiveRootSys(), XrdProofdPriorityMgr::DoDirectiveSchedOpt(), XrdProofdProofServMgr::DoDirectiveShutdown(), and DoDirectiveString().
char * XrdProofdAux::Expand | ( | char * | p | ) | [static] |
Definition at line 83 of file XrdProofdAux.cxx.
References XrdOucString::c_str(), env, XrdProofUI::fHomeDir, free(), getenv(), GetUserInfo(), XrdOucString::length(), malloc(), p1(), and pd.
Referenced by XrdProofGroupMgr::Config(), XrdProofdNetMgr::DoDirectiveResource(), Expand(), XrdProofdManager::LoadScheduler(), XrdProofGroupMgr::ParseInfoFrom(), and XrdProofdConfig::SetCfgEDest().
void XrdProofdAux::Expand | ( | XrdOucString & | path | ) | [static] |
void XrdProofdAux::Form | ( | XrdOucString & | s, | |
const char * | fmt, | |||
int | ns, | |||
const char * | ss[5], | |||
int | ni, | |||
int | ii[5], | |||
int | np, | |||
void * | pp[5] | |||
) | [static] |
Definition at line 2199 of file XrdProofdAux.cxx.
References i, k, s, sprintf(), and STR_NPOS.
Referenced by XrdProofdAdmin::CpFile(), and Form().
void XrdProofdAux::Form | ( | XrdOucString & | s, | |
const char * | fmt, | |||
const char * | s0, | |||
const char * | s1 = 0 , |
|||
const char * | s2 = 0 , |
|||
const char * | s3 = 0 , |
|||
const char * | s4 = 0 | |||
) | [static] |
void XrdProofdAux::Form | ( | XrdOucString & | s, | |
const char * | fmt, | |||
int | i0, | |||
int | i1 = 0 , |
|||
int | i2 = 0 , |
|||
int | i3 = 0 , |
|||
int | i4 = 0 | |||
) | [static] |
void XrdProofdAux::Form | ( | XrdOucString & | s, | |
const char * | fmt, | |||
void * | p0, | |||
void * | p1 = 0 , |
|||
void * | p2 = 0 , |
|||
void * | p3 = 0 , |
|||
void * | p4 = 0 | |||
) | [static] |
void XrdProofdAux::Form | ( | XrdOucString & | s, | |
const char * | fmt, | |||
int | i0, | |||
const char * | s0, | |||
const char * | s1 = 0 , |
|||
const char * | s2 = 0 , |
|||
const char * | s3 = 0 | |||
) | [static] |
void XrdProofdAux::Form | ( | XrdOucString & | s, | |
const char * | fmt, | |||
const char * | s0, | |||
int | i0, | |||
int | i1 = 0 , |
|||
int | i2 = 0 , |
|||
int | i3 = 0 | |||
) | [static] |
void XrdProofdAux::Form | ( | XrdOucString & | s, | |
const char * | fmt, | |||
const char * | s0, | |||
const char * | s1, | |||
int | i0, | |||
int | i1, | |||
int | i2 | |||
) | [static] |
void XrdProofdAux::Form | ( | XrdOucString & | s, | |
const char * | fmt, | |||
int | i0, | |||
int | i1, | |||
const char * | s0, | |||
const char * | s1, | |||
const char * | s2 | |||
) | [static] |
void XrdProofdAux::Form | ( | XrdOucString & | s, | |
const char * | fmt, | |||
const char * | s0, | |||
const char * | s1, | |||
const char * | s2, | |||
int | i0, | |||
int | i1 = 0 | |||
) | [static] |
void XrdProofdAux::Form | ( | XrdOucString & | s, | |
const char * | fmt, | |||
int | i0, | |||
int | i1, | |||
int | i2, | |||
const char * | s0, | |||
const char * | s1 | |||
) | [static] |
void XrdProofdAux::Form | ( | XrdOucString & | s, | |
const char * | fmt, | |||
const char * | s0, | |||
const char * | s1, | |||
const char * | s2, | |||
const char * | s3, | |||
int | i1 | |||
) | [static] |
void XrdProofdAux::Form | ( | XrdOucString & | s, | |
const char * | fmt, | |||
int | i0, | |||
int | i1, | |||
int | i2, | |||
int | i3, | |||
const char * | s0 | |||
) | [static] |
void XrdProofdAux::Form | ( | XrdOucString & | s, | |
const char * | fmt, | |||
int | i0, | |||
int | i1, | |||
void * | p0 | |||
) | [static] |
void XrdProofdAux::Form | ( | XrdOucString & | s, | |
const char * | fmt, | |||
int | i0, | |||
int | i1, | |||
int | i2, | |||
void * | p0 | |||
) | [static] |
void XrdProofdAux::Form | ( | XrdOucString & | s, | |
const char * | fmt, | |||
int | i0, | |||
int | i1, | |||
int | i2, | |||
int | i3, | |||
void * | p0 | |||
) | [static] |
void XrdProofdAux::Form | ( | XrdOucString & | s, | |
const char * | fmt, | |||
int | i0, | |||
int | i1, | |||
void * | p0, | |||
int | i2, | |||
int | i3 = 0 | |||
) | [static] |
void XrdProofdAux::Form | ( | XrdOucString & | s, | |
const char * | fmt, | |||
void * | p0, | |||
int | i0, | |||
int | i1 | |||
) | [static] |
void XrdProofdAux::Form | ( | XrdOucString & | s, | |
const char * | fmt, | |||
const char * | s0, | |||
void * | p0, | |||
int | i0, | |||
int | i1 | |||
) | [static] |
void XrdProofdAux::Form | ( | XrdOucString & | s, | |
const char * | fmt, | |||
void * | p0, | |||
const char * | s0, | |||
int | i0 | |||
) | [static] |
void XrdProofdAux::Form | ( | XrdOucString & | s, | |
const char * | fmt, | |||
const char * | s0, | |||
const char * | s1, | |||
void * | p0 | |||
) | [static] |
void XrdProofdAux::Form | ( | XrdOucString & | s, | |
const char * | fmt, | |||
int | i0, | |||
const char * | s0, | |||
const char * | s1, | |||
int | i1, | |||
int | i2 = 0 | |||
) | [static] |
void XrdProofdAux::Form | ( | XrdOucString & | s, | |
const char * | fmt, | |||
int | i0, | |||
const char * | s0, | |||
int | i1, | |||
int | i2 = 0 | |||
) | [static] |
int XrdProofdAux::GetIDFromPath | ( | const char * | path, | |
XrdOucString & | emsg | |||
) | [static] |
Definition at line 1062 of file XrdProofdAux.cxx.
References emsg(), fclose(), fopen, line, and XPDFORM.
Referenced by XrdProofdClientMgr::CheckAdminPath(), XrdProofdClientMgr::CheckClients(), XrdProofdProofServMgr::CleanupLostProofServ(), and XrdProofdClientMgr::ParsePreviousClients().
long int XrdProofdAux::GetLong | ( | char * | str | ) | [static] |
Definition at line 196 of file XrdProofdAux.cxx.
References j, p, and strtol().
Referenced by XrdProofdProofServMgr::CleanupProofServ(), GetNumCPUs(), GetProcesses(), and VerifyProcessByID().
int XrdProofdAux::GetNumCPUs | ( | ) | [static] |
Definition at line 714 of file XrdProofdAux.cxx.
References XrdOucString::c_str(), emsg(), fc, fclose(), fopen, fp, GetLong(), int, line, TRACE, XPDFORM, and XPDLOC.
Referenced by XrdProofdNetMgr::XrdProofdNetMgr().
int XrdProofdAux::GetGroupInfo | ( | const char * | grp, | |
XrdProofGI & | gi | |||
) | [static] |
Definition at line 218 of file XrdProofdAux.cxx.
References buf, XrdProofGI::fGid, XrdProofGI::fGroup, gr, and int.
Referenced by XrdProofdManager::CheckUser(), and XrdProofdManager::DoDirectiveAllowedGroups().
int XrdProofdAux::GetGroupInfo | ( | int | gid, | |
XrdProofGI & | gi | |||
) | [static] |
Definition at line 252 of file XrdProofdAux.cxx.
References buf, XrdProofGI::fGid, XrdProofGI::fGroup, and gr.
int XrdProofdAux::GetProcesses | ( | const char * | pn, | |
std::map< int, XrdOucString > * | plist | |||
) | [static] |
Definition at line 871 of file XrdProofdAux.cxx.
References buf, XrdOucString::c_str(), close, closedir, DIGIT, dir(), emsg(), fclose(), fopen, fp, free(), GetLong(), int, XrdOucString::length(), line, ok, open, opendir, p, read, readdir, XrdOucString::replace(), strtol(), TRACE, and XPDLOC.
Referenced by XrdProofdProofServMgr::CleanupLostProofServ().
int XrdProofdAux::GetUserInfo | ( | const char * | usr, | |
XrdProofUI & | ui | |||
) | [static] |
Definition at line 286 of file XrdProofdAux.cxx.
References buf, XrdProofUI::fGid, XrdProofUI::fHomeDir, XrdProofUI::fUid, XrdProofUI::fUser, int, passwd::pw_dir, passwd::pw_gid, and passwd::pw_uid.
Referenced by XrdProofdProofServ::CheckSession(), XrdProofdProofServMgr::CheckTerminatedSessions(), XrdProofdManager::CheckUser(), XrdProofdProofServMgr::CleanClientSessions(), XrdProofdProofServMgr::CleanupLostProofServ(), XrdProofdProofServMgr::CleanupProofServ(), XrdProofdManager::Config(), XrdProofdProofServMgr::Config(), XrdProofdClientMgr::Config(), XrdProofdClientMgr::CreateAdminPath(), XrdProofdProofServ::CreateUNIXSock(), XrdProofdManager::DoDirectiveAllowedUsers(), Expand(), XrdProofdProofServ::SetAdminPath(), XrdROOTMgr::SetLogDir(), XrdProofdSessionEntry::SetPriority(), XrdProofdPriorityMgr::SetProcessPriority(), XrdProofdProofServMgr::SetUserOwnerships(), XrdProofdProofServ::TerminateProofServ(), XrdROOTMgr::Validate(), XrdProofdManager::ValidateLocalDataSetSrc(), XrdProofdClient::XrdProofdClient(), and XrdProofdSandbox::XrdProofdSandbox().
int XrdProofdAux::GetUserInfo | ( | int | uid, | |
XrdProofUI & | ui | |||
) | [static] |
Definition at line 322 of file XrdProofdAux.cxx.
References buf, XrdProofUI::fGid, XrdProofUI::fHomeDir, XrdProofUI::fUid, XrdProofUI::fUser, int, passwd::pw_dir, passwd::pw_gid, and passwd::pw_name.
bool XrdProofdAux::HasToken | ( | const char * | s, | |
const char * | tokens | |||
) | [static] |
Definition at line 1084 of file XrdProofdAux.cxx.
References XrdOucString::c_str().
Referenced by VerifyProcessByID().
int XrdProofdAux::KillProcess | ( | int | pid, | |
bool | forcekill, | |||
XrdProofUI | ui, | |||
bool | changeown | |||
) | [static] |
Definition at line 1237 of file XrdProofdAux.cxx.
References XrdProofUI::fUid, TRACE, XpdBadPGuard, XPDFORM, and XPDLOC.
Referenced by XrdProofdProofServ::CheckSession(), XrdProofdProofServMgr::CheckTerminatedSessions(), XrdProofdProofServMgr::CleanClientSessions(), XrdProofdProofServMgr::CleanupLostProofServ(), XrdProofdProofServMgr::CleanupProofServ(), XrdProofdProofServMgr::Create(), and XrdProofdProofServ::TerminateProofServ().
int XrdProofdAux::MvDir | ( | const char * | oldpath, | |
const char * | newpath | |||
) | [static] |
int XrdProofdAux::ParsePidPath | ( | const char * | path, | |
XrdOucString & | before, | |||
XrdOucString & | after | |||
) | [static] |
Definition at line 1511 of file XrdProofdAux.cxx.
References XrdOucString::atoi(), XrdOucString::isdigit(), XrdOucString::length(), s, TRACE, XPD_LONGOK, and XPDLOC.
Referenced by XrdProofdProofServMgr::CheckActiveSessions(), XrdProofdProofServMgr::CheckTerminatedSessions(), XrdProofdProofServMgr::CleanClientSessions(), XrdProofdProofServMgr::CleanupLostProofServ(), ParseUsrGrp(), and XrdProofdProofServMgr::PrepareSessionRecovering().
int XrdProofdAux::ParseUsrGrp | ( | const char * | path, | |
XrdOucString & | usr, | |||
XrdOucString & | grp | |||
) | [static] |
Definition at line 1560 of file XrdProofdAux.cxx.
References XrdOucString::erase(), XrdOucString::length(), ParsePidPath(), XrdOucString::rfind(), and STR_NPOS.
Referenced by XrdProofdClientMgr::CheckClients().
const char * XrdProofdAux::ProofRequestTypes | ( | int | type | ) | [static] |
Definition at line 62 of file XrdProofdAux.cxx.
Referenced by XrdProofdManager::Process(), XrdProofdProofServMgr::Process(), XrdProofdProtocol::Process(), and XrdProofdProtocol::Process2().
int XrdProofdAux::ReadMsg | ( | int | fd, | |
XrdOucString & | msg | |||
) | [static] |
Definition at line 1468 of file XrdProofdAux.cxx.
References buf, read, TRACE, XPD_MAXLEN, and XPDLOC.
Referenced by XrdProofdPipe::Recv().
int XrdProofdAux::RmDir | ( | const char * | path | ) | [static] |
Definition at line 1292 of file XrdProofdAux.cxx.
References closedir, dir(), entry, opendir, readdir, rmdir, S_ISDIR, stat, TRACE, unlink, XPDFORM, and XPDLOC.
Referenced by XrdProofdClientMgr::CheckAdminPath(), XrdProofdClientMgr::CheckClients(), MvDir(), XrdProofdClientMgr::ParsePreviousClients(), and XrdProofdClientCron().
int XrdProofdAux::SymLink | ( | const char * | path, | |
const char * | link | |||
) | [static] |
Definition at line 651 of file XrdProofdAux.cxx.
References TRACE, unlink, and XPDLOC.
Referenced by XrdProofdProofServMgr::SetProofServEnv(), and XrdProofdProofServMgr::SetProofServEnvOld().
int XrdProofdAux::Touch | ( | const char * | path, | |
int | opt = 0 | |||
) | [static] |
Definition at line 1436 of file XrdProofdAux.cxx.
References stat.
Referenced by XrdProofdProtocol::TouchAdminPath().
int XrdProofdAux::VerifyProcessByID | ( | int | pid, | |
const char * | pname = "proofserv" | |||
) | [static] |
Definition at line 1099 of file XrdProofdAux.cxx.
References XrdOucString::c_str(), close, emsg(), fclose(), fopen, fp, free(), GetLong(), HasToken(), line, open, read, XrdOucString::replace(), TRACE, XPDFORM, and XPDLOC.
Referenced by XrdProofdProofServMgr::CheckTerminatedSessions(), XrdProofdProofServMgr::CleanClientSessions(), XrdProofdProofServMgr::CleanupLostProofServ(), XrdProofdProofServMgr::CleanupProofServ(), XrdProofdProtocol::Ping(), XrdProofdProofServMgr::PrepareSessionRecovering(), XrdProofdSandbox::TrimSessionDirs(), and XrdProofdClient::VerifySession().
int XrdProofdAux::Write | ( | int | fd, | |
const void * | buf, | |||
size_t | nb | |||
) | [static] |
Definition at line 358 of file XrdProofdAux.cxx.
References write.
Referenced by XrdProofdClientMgr::FilterSecConfig(), and XrdProofdProofServMgr::SaveAFSkey().
XrdSysRecMutex XrdProofdAux::fgFormMutex [static, private] |
Definition at line 245 of file XrdProofdAux.h.