XrdProofdAux Class Reference

#include <XrdProofdAux.h>

List of all members.

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


Detailed Description

Definition at line 244 of file XrdProofdAux.h.


Constructor & Destructor Documentation

XrdProofdAux::XrdProofdAux (  )  [inline]

Definition at line 247 of file XrdProofdAux.h.


Member Function Documentation

const char * XrdProofdAux::AdminMsgType ( int  type  )  [static]

Definition at line 42 of file XrdProofdAux.cxx.

References kUndef, and t.

Referenced by XrdProofdAdmin::Process().

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]

Definition at line 178 of file XrdProofdAux.cxx.

References Expand(), p, and SafeFree.

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]

Definition at line 2249 of file XrdProofdAux.cxx.

References Form(), and s.

void XrdProofdAux::Form ( XrdOucString s,
const char *  fmt,
int  i0,
int  i1 = 0,
int  i2 = 0,
int  i3 = 0,
int  i4 = 0 
) [static]

Definition at line 2263 of file XrdProofdAux.cxx.

References Form(), and s.

void XrdProofdAux::Form ( XrdOucString s,
const char *  fmt,
void *  p0,
void *  p1 = 0,
void *  p2 = 0,
void *  p3 = 0,
void *  p4 = 0 
) [static]

Definition at line 2276 of file XrdProofdAux.cxx.

References Form(), and s.

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]

Definition at line 2290 of file XrdProofdAux.cxx.

References Form(), and s.

void XrdProofdAux::Form ( XrdOucString s,
const char *  fmt,
const char *  s0,
int  i0,
int  i1 = 0,
int  i2 = 0,
int  i3 = 0 
) [static]

Definition at line 2303 of file XrdProofdAux.cxx.

References Form(), and s.

void XrdProofdAux::Form ( XrdOucString s,
const char *  fmt,
const char *  s0,
const char *  s1,
int  i0,
int  i1,
int  i2 
) [static]

Definition at line 2316 of file XrdProofdAux.cxx.

References Form(), and s.

void XrdProofdAux::Form ( XrdOucString s,
const char *  fmt,
int  i0,
int  i1,
const char *  s0,
const char *  s1,
const char *  s2 
) [static]

Definition at line 2329 of file XrdProofdAux.cxx.

References Form(), and s.

void XrdProofdAux::Form ( XrdOucString s,
const char *  fmt,
const char *  s0,
const char *  s1,
const char *  s2,
int  i0,
int  i1 = 0 
) [static]

Definition at line 2343 of file XrdProofdAux.cxx.

References Form(), and s.

void XrdProofdAux::Form ( XrdOucString s,
const char *  fmt,
int  i0,
int  i1,
int  i2,
const char *  s0,
const char *  s1 
) [static]

Definition at line 2357 of file XrdProofdAux.cxx.

References Form(), and s.

void XrdProofdAux::Form ( XrdOucString s,
const char *  fmt,
const char *  s0,
const char *  s1,
const char *  s2,
const char *  s3,
int  i1 
) [static]

Definition at line 2371 of file XrdProofdAux.cxx.

References Form(), and s.

void XrdProofdAux::Form ( XrdOucString s,
const char *  fmt,
int  i0,
int  i1,
int  i2,
int  i3,
const char *  s0 
) [static]

Definition at line 2384 of file XrdProofdAux.cxx.

References Form(), and s.

void XrdProofdAux::Form ( XrdOucString s,
const char *  fmt,
int  i0,
int  i1,
void *  p0 
) [static]

Definition at line 2397 of file XrdProofdAux.cxx.

References Form(), and s.

void XrdProofdAux::Form ( XrdOucString s,
const char *  fmt,
int  i0,
int  i1,
int  i2,
void *  p0 
) [static]

Definition at line 2409 of file XrdProofdAux.cxx.

References Form(), and s.

void XrdProofdAux::Form ( XrdOucString s,
const char *  fmt,
int  i0,
int  i1,
int  i2,
int  i3,
void *  p0 
) [static]

Definition at line 2422 of file XrdProofdAux.cxx.

References Form(), and s.

void XrdProofdAux::Form ( XrdOucString s,
const char *  fmt,
int  i0,
int  i1,
void *  p0,
int  i2,
int  i3 = 0 
) [static]

Definition at line 2435 of file XrdProofdAux.cxx.

References Form(), and s.

void XrdProofdAux::Form ( XrdOucString s,
const char *  fmt,
void *  p0,
int  i0,
int  i1 
) [static]

Definition at line 2448 of file XrdProofdAux.cxx.

References Form(), and s.

void XrdProofdAux::Form ( XrdOucString s,
const char *  fmt,
const char *  s0,
void *  p0,
int  i0,
int  i1 
) [static]

Definition at line 2460 of file XrdProofdAux.cxx.

References Form(), and s.

void XrdProofdAux::Form ( XrdOucString s,
const char *  fmt,
void *  p0,
const char *  s0,
int  i0 
) [static]

Definition at line 2473 of file XrdProofdAux.cxx.

References Form(), and s.

void XrdProofdAux::Form ( XrdOucString s,
const char *  fmt,
const char *  s0,
const char *  s1,
void *  p0 
) [static]

Definition at line 2486 of file XrdProofdAux.cxx.

References Form(), and s.

void XrdProofdAux::Form ( XrdOucString s,
const char *  fmt,
int  i0,
const char *  s0,
const char *  s1,
int  i1,
int  i2 = 0 
) [static]

Definition at line 2499 of file XrdProofdAux.cxx.

References Form(), and s.

void XrdProofdAux::Form ( XrdOucString s,
const char *  fmt,
int  i0,
const char *  s0,
int  i1,
int  i2 = 0 
) [static]

Definition at line 2512 of file XrdProofdAux.cxx.

References Form(), and s.

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]

Definition at line 1353 of file XrdProofdAux.cxx.

References XrdOucString::c_str(), closedir, dir(), mkdir, opendir, readdir, rename, RmDir(), S_ISDIR, stat, TRACE, XPDFORM, and XPDLOC.

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.

References kXP_Undef, and t.

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().


Member Data Documentation

XrdSysRecMutex XrdProofdAux::fgFormMutex [static, private]

Definition at line 245 of file XrdProofdAux.h.


The documentation for this class was generated from the following files:
Generated on Tue Jul 5 16:50:41 2011 for ROOT_528-00b_version by  doxygen 1.5.1