ROOT  6.06/09
Reference Guide
Public Member Functions | Static Public Member Functions | Static Private Attributes | List of all members
XrdProofdAux Class Reference

Definition at line 247 of file XrdProofdAux.h.

Public Member Functions

 XrdProofdAux ()
 

Static Public Member Functions

static const char * AdminMsgType (int type)
 Translates the admin message type in a human readable string. More...
 
static int AssertBaseDir (const char *path, XrdProofUI ui)
 Make sure that the base dir of 'path' is either owned by 'ui' or gives full permissions to 'ui'. More...
 
static int AssertDir (const char *path, XrdProofUI ui, bool changeown)
 Make sure that 'path' exists and is owned by the entity described by 'ui'. More...
 
static int ChangeMod (const char *path, unsigned int mode)
 Change the permission mode of 'path' to 'mode'. More...
 
static int ChangeOwn (const char *path, XrdProofUI ui)
 Change the ownership of 'path' to the entity described by 'ui'. More...
 
static int ChangeToDir (const char *dir, XrdProofUI ui, bool changeown)
 Change current directory to 'dir'. More...
 
static int CheckIf (XrdOucStream *s, const char *h)
 Check existence and match condition of an 'if' directive If none (valid) is found, return -1. More...
 
static char * Expand (char *p)
 Expand path 'p' relative to: $HOME if begins with ~/ <user>'s $HOME if begins with ~<user>/ $PWD if does not begin with '/' or '~' getenv(<ENVVAR>) if it begins with $<ENVVAR>) The returned array of chars is the result of reallocation of the input one. More...
 
static void Expand (XrdOucString &path)
 Expand path 'p' relative to: $HOME if begins with ~/ <user>'s $HOME if begins with ~<user>/ $PWD if does not begin with '/' or '~' getenv(<ENVVAR>) if it begins with $<ENVVAR>) The input string is updated with the result. More...
 
static void Form (XrdOucString &s, const char *fmt, int ns, const char *ss[5], int ni, int ii[6], int np, void *pp[5], int nu=0, unsigned int ui=0)
 Recreate the string according to 'fmt', the up to 5 'const char *', up to 6 'int' arguments, up to 5 'void *' and up to 1 unsigned integer. More...
 
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)
 Recreate the string according to 'fmt' and the 5 'const char *' arguments. More...
 
static void Form (XrdOucString &s, const char *fmt, int i0, int i1=0, int i2=0, int i3=0, int i4=0, int i5=0)
 Recreate the string according to 'fmt' and the 5 'int' arguments. More...
 
static void Form (XrdOucString &s, const char *fmt, void *p0, void *p1=0, void *p2=0, void *p3=0, void *p4=0)
 Recreate the string according to 'fmt' and the 5 'void *' arguments. More...
 
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)
 Recreate the string according to 'fmt' and the 5 'void *' arguments. More...
 
static void Form (XrdOucString &s, const char *fmt, const char *s0, int i0, int i1=0, int i2=0, int i3=0)
 Recreate the string according to 'fmt' and the 5 'void *' arguments. More...
 
static void Form (XrdOucString &s, const char *fmt, const char *s0, int i0, int i1, unsigned int u1)
 Recreate the string according to 'fmt' and the 5 'void *' arguments. More...
 
static void Form (XrdOucString &s, const char *fmt, const char *s0, const char *s1, int i0, int i1, int i2)
 Recreate the string according to 'fmt' and the 5 'void *' arguments. More...
 
static void Form (XrdOucString &s, const char *fmt, int i0, int i1, const char *s0, const char *s1, const char *s2)
 Recreate the string according to 'fmt' and the 5 'void *' arguments. More...
 
static void Form (XrdOucString &s, const char *fmt, const char *s0, const char *s1, const char *s2, int i0, int i1=0, const char *s3=0, const char *s4=0)
 Recreate the string according to 'fmt' and the 5 'void *' arguments. More...
 
static void Form (XrdOucString &s, const char *fmt, const char *s0, int i0, int i1, const char *s1, const char *s2, const char *s3)
 Recreate the string according to 'fmt' and the 5 'void *' arguments. More...
 
static void Form (XrdOucString &s, const char *fmt, const char *s0, const char *s1, const char *s2, int i0, unsigned int u1)
 Recreate the string according to 'fmt' and the 5 'void *' arguments. More...
 
static void Form (XrdOucString &s, const char *fmt, int i0, int i1, int i2, const char *s0, const char *s1)
 Recreate the string according to 'fmt' and the 5 'void *' arguments. More...
 
static void Form (XrdOucString &s, const char *fmt, const char *s0, const char *s1, const char *s2, const char *s3, int i1)
 Recreate the string according to 'fmt' and the 5 'void *' arguments. More...
 
static void Form (XrdOucString &s, const char *fmt, int i0, int i1, int i2, int i3, const char *s0)
 Recreate the string according to 'fmt' and the 5 'void *' arguments. More...
 
static void Form (XrdOucString &s, const char *fmt, int i0, int i1, void *p0)
 Recreate the string according to 'fmt' and the 5 'void *' arguments. More...
 
static void Form (XrdOucString &s, const char *fmt, int i0, int i1, int i2, void *p0)
 Recreate the string according to 'fmt' and the 5 'void *' arguments. More...
 
static void Form (XrdOucString &s, const char *fmt, int i0, int i1, int i2, int i3, void *p0)
 Recreate the string according to 'fmt' and the 5 'void *' arguments. More...
 
static void Form (XrdOucString &s, const char *fmt, int i0, int i1, void *p0, int i2, int i3=0)
 Recreate the string according to 'fmt' and the 5 'void *' arguments. More...
 
static void Form (XrdOucString &s, const char *fmt, void *p0, int i0, int i1)
 Recreate the string according to 'fmt' and the 5 'void *' arguments. More...
 
static void Form (XrdOucString &s, const char *fmt, const char *s0, void *p0, int i0, int i1)
 Recreate the string according to 'fmt' and the 5 'void *' arguments. More...
 
static void Form (XrdOucString &s, const char *fmt, void *p0, const char *s0, int i0)
 Recreate the string according to 'fmt' and the 5 'void *' arguments. More...
 
static void Form (XrdOucString &s, const char *fmt, const char *s0, const char *s1, void *p0)
 Recreate the string according to 'fmt' and the 5 'void *' arguments. More...
 
static void Form (XrdOucString &s, const char *fmt, int i0, const char *s0, const char *s1, int i1, int i2=0)
 Recreate the string according to 'fmt' and the 5 'void *' arguments. More...
 
static void Form (XrdOucString &s, const char *fmt, int i0, const char *s0, int i1, int i2=0)
 Recreate the string according to 'fmt' and the 5 'void *' arguments. More...
 
static int GetIDFromPath (const char *path, XrdOucString &emsg)
 Extract an integer from a file. More...
 
static long int GetLong (char *str)
 Extract first integer from string at 'str', if any. More...
 
static int GetNumCPUs ()
 Find out and return the number of CPUs in the local machine. More...
 
static int GetGroupInfo (const char *grp, XrdProofGI &gi)
 Get information about group with 'gid' in a thread safe way. More...
 
static int GetGroupInfo (int gid, XrdProofGI &gi)
 Get information about group with 'gid' in a thread safe way. More...
 
static int GetProcesses (const char *pn, std::map< int, XrdOucString > *plist)
 Get from the process table list of PIDs for processes named "proofserv' For {linux, sun, macosx} it uses the system info; for other systems it invokes the command shell 'ps ax' via popen. More...
 
static int GetUserInfo (const char *usr, XrdProofUI &ui)
 Get information about user 'usr' in a thread safe way. More...
 
static int GetUserInfo (int uid, XrdProofUI &ui)
 Get information about user with 'uid' in a thread safe way. More...
 
static bool HasToken (const char *s, const char *tokens)
 Returns true is 's' contains at least one of the comma-separated tokens in 'tokens'. More...
 
static int KillProcess (int pid, bool forcekill, XrdProofUI ui, bool changeown)
 Kill the process 'pid'. More...
 
static void LogEmsgToFile (const char *flog, const char *emsg, const char *pfx=0)
 Logs error message 'emsg' to file 'flog' using standard technology. More...
 
static int MvDir (const char *oldpath, const char *newpath)
 Move content of directory at oldpath to newpath. More...
 
static int ParsePidPath (const char *path, XrdOucString &before, XrdOucString &after)
 Parse a path in the form of "<before>[.<pid>][.<after>]", filling 'rest' and returning 'pid'. More...
 
static int ParseUsrGrp (const char *path, XrdOucString &usr, XrdOucString &grp)
 Parse a path in the form of "<usr>[.<grp>][.<pid>]", filling 'usr' and 'grp'. More...
 
static const char * ProofRequestTypes (int type)
 Translates the proof request type in a human readable string. More...
 
static int ReadMsg (int fd, XrdOucString &msg)
 Receive 'msg' from pipe fd. More...
 
static int RmDir (const char *path)
 Remove directory at path and its content. More...
 
static int SymLink (const char *path, const char *link)
 Create a symlink 'link' to 'path' Return 0 in case of success, -1 in case of error. More...
 
static int Touch (const char *path, int opt=0)
 Set access (opt == 1), modify (opt =2 ) or access&modify (opt = 0, default) times of path to current time. More...
 
static int VerifyProcessByID (int pid, const char *pname="proofserv")
 Check if a process named 'pname' and process 'pid' is still in the process table. More...
 
static int Write (int fd, const void *buf, size_t nb)
 Write nb bytes at buf to descriptor 'fd' ignoring interrupts Return the number of bytes written or -1 in case of error. More...
 

Static Private Attributes

static XrdSysRecMutex fgFormMutex
 

#include <XrdProofdAux.h>

Constructor & Destructor Documentation

XrdProofdAux::XrdProofdAux ( )
inline

Definition at line 250 of file XrdProofdAux.h.

Member Function Documentation

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

Translates the admin message type in a human readable string.

Must be consistent with the values in XProofProtocol.h

Definition at line 47 of file XrdProofdAux.cxx.

Referenced by XrdProofdAdmin::Process().

int XrdProofdAux::AssertBaseDir ( const char *  path,
XrdProofUI  ui 
)
static

Make sure that the base dir of 'path' is either owned by 'ui' or gives full permissions to 'ui'.

If 'path' is a directory, go through the paths inside it recursively. Return 0 in case of success, -1 in case of error

Definition at line 465 of file XrdProofdAux.cxx.

int XrdProofdAux::AssertDir ( const char *  path,
XrdProofUI  ui,
bool  changeown 
)
static
int XrdProofdAux::ChangeMod ( const char *  path,
unsigned int  mode 
)
static

Change the permission mode of 'path' to 'mode'.

If 'path' is a directory, go through the paths inside it recursively. Return 0 in case of success, -1 in case of error

Definition at line 566 of file XrdProofdAux.cxx.

Referenced by XrdProofdManager::Config(), XrdProofdProofServMgr::SetUserOwnerships(), and XrdProofdManager::ValidateLocalDataSetSrc().

int XrdProofdAux::ChangeOwn ( const char *  path,
XrdProofUI  ui 
)
static

Change the ownership of 'path' to the entity described by 'ui'.

If 'path' is a directory, go through the paths inside it recursively. Return 0 in case of success, -1 in case of error

Definition at line 509 of file XrdProofdAux.cxx.

Referenced by XrdProofdProofServ::SetAdminPath(), XrdProofdProofServMgr::SetUserOwnerships(), and XrdProofdManager::ValidateLocalDataSetSrc().

int XrdProofdAux::ChangeToDir ( const char *  dir,
XrdProofUI  ui,
bool  changeown 
)
static

Change current directory to 'dir'.

If changeown is TRUE it tries to acquire the privileges before. Return 0 in case of success, -1 in case of error

Definition at line 655 of file XrdProofdAux.cxx.

Referenced by XrdProofdProofServMgr::SetProofServEnv(), and XrdProofdProofServMgr::SetUserEnvironment().

int XrdProofdAux::CheckIf ( XrdOucStream *  s,
const char *  host 
)
static
char * XrdProofdAux::Expand ( char *  p)
static

Expand path 'p' relative to: $HOME if begins with ~/ <user>'s $HOME if begins with ~<user>/ $PWD if does not begin with '/' or '~' getenv(<ENVVAR>) if it begins with $<ENVVAR>) The returned array of chars is the result of reallocation of the input one.

If something is inconsistent, for example <ENVVAR> does not exists, the original string is untouched

Definition at line 95 of file XrdProofdAux.cxx.

Referenced by XrdProofGroupMgr::Config(), XrdProofdNetMgr::DoDirectiveResource(), Expand(), XrdProofdManager::LoadScheduler(), XrdProofGroupMgr::ParseInfoFrom(), and XrdProofdConfig::SetCfgEDest().

void XrdProofdAux::Expand ( XrdOucString &  p)
static

Expand path 'p' relative to: $HOME if begins with ~/ <user>'s $HOME if begins with ~<user>/ $PWD if does not begin with '/' or '~' getenv(<ENVVAR>) if it begins with $<ENVVAR>) The input string is updated with the result.

If something is inconsistent, for example <ENVVAR> does not exists, the original string is untouched

Definition at line 189 of file XrdProofdAux.cxx.

void XrdProofdAux::Form ( XrdOucString &  s,
const char *  fmt,
int  ns,
const char *  ss[5],
int  ni,
int  ii[6],
int  np,
void pp[5],
int  nu = 0,
unsigned int  ui = 0 
)
static

Recreate the string according to 'fmt', the up to 5 'const char *', up to 6 'int' arguments, up to 5 'void *' and up to 1 unsigned integer.

Definition at line 2261 of file XrdProofdAux.cxx.

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

Recreate the string according to 'fmt' and the 5 'const char *' arguments.

Definition at line 2317 of file XrdProofdAux.cxx.

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

Recreate the string according to 'fmt' and the 5 'int' arguments.

Definition at line 2331 of file XrdProofdAux.cxx.

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

Recreate the string according to 'fmt' and the 5 'void *' arguments.

Definition at line 2344 of file XrdProofdAux.cxx.

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

Recreate the string according to 'fmt' and the 5 'void *' arguments.

Definition at line 2358 of file XrdProofdAux.cxx.

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

Recreate the string according to 'fmt' and the 5 'void *' arguments.

Definition at line 2371 of file XrdProofdAux.cxx.

void XrdProofdAux::Form ( XrdOucString &  s,
const char *  fmt,
const char *  s0,
int  i0,
int  i1,
unsigned int  u1 
)
static

Recreate the string according to 'fmt' and the 5 'void *' arguments.

Definition at line 2384 of file XrdProofdAux.cxx.

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

Recreate the string according to 'fmt' and the 5 'void *' arguments.

Definition at line 2397 of file XrdProofdAux.cxx.

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

Recreate the string according to 'fmt' and the 5 'void *' arguments.

Definition at line 2410 of file XrdProofdAux.cxx.

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

Recreate the string according to 'fmt' and the 5 'void *' arguments.

Definition at line 2424 of file XrdProofdAux.cxx.

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

Recreate the string according to 'fmt' and the 5 'void *' arguments.

Definition at line 2439 of file XrdProofdAux.cxx.

void XrdProofdAux::Form ( XrdOucString &  s,
const char *  fmt,
const char *  s0,
const char *  s1,
const char *  s2,
int  i0,
unsigned int  u1 
)
static

Recreate the string according to 'fmt' and the 5 'void *' arguments.

Definition at line 2453 of file XrdProofdAux.cxx.

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

Recreate the string according to 'fmt' and the 5 'void *' arguments.

Definition at line 2467 of file XrdProofdAux.cxx.

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

Recreate the string according to 'fmt' and the 5 'void *' arguments.

Definition at line 2481 of file XrdProofdAux.cxx.

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

Recreate the string according to 'fmt' and the 5 'void *' arguments.

Definition at line 2494 of file XrdProofdAux.cxx.

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

Recreate the string according to 'fmt' and the 5 'void *' arguments.

Definition at line 2507 of file XrdProofdAux.cxx.

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

Recreate the string according to 'fmt' and the 5 'void *' arguments.

Definition at line 2519 of file XrdProofdAux.cxx.

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

Recreate the string according to 'fmt' and the 5 'void *' arguments.

Definition at line 2532 of file XrdProofdAux.cxx.

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

Recreate the string according to 'fmt' and the 5 'void *' arguments.

Definition at line 2545 of file XrdProofdAux.cxx.

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

Recreate the string according to 'fmt' and the 5 'void *' arguments.

Definition at line 2558 of file XrdProofdAux.cxx.

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

Recreate the string according to 'fmt' and the 5 'void *' arguments.

Definition at line 2570 of file XrdProofdAux.cxx.

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

Recreate the string according to 'fmt' and the 5 'void *' arguments.

Definition at line 2583 of file XrdProofdAux.cxx.

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

Recreate the string according to 'fmt' and the 5 'void *' arguments.

Definition at line 2596 of file XrdProofdAux.cxx.

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

Recreate the string according to 'fmt' and the 5 'void *' arguments.

Definition at line 2609 of file XrdProofdAux.cxx.

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

Recreate the string according to 'fmt' and the 5 'void *' arguments.

Definition at line 2622 of file XrdProofdAux.cxx.

int XrdProofdAux::GetGroupInfo ( const char *  grp,
XrdProofGI gi 
)
static

Get information about group with 'gid' in a thread safe way.

Retur 0 on success, -errno on error

Definition at line 223 of file XrdProofdAux.cxx.

Referenced by XrdProofdManager::DoDirectiveAllowedGroups().

int XrdProofdAux::GetGroupInfo ( int  gid,
XrdProofGI gi 
)
static

Get information about group with 'gid' in a thread safe way.

Retur 0 on success, -errno on error

Definition at line 257 of file XrdProofdAux.cxx.

int XrdProofdAux::GetIDFromPath ( const char *  path,
XrdOucString &  emsg 
)
static
long int XrdProofdAux::GetLong ( char *  str)
static

Extract first integer from string at 'str', if any.

Definition at line 200 of file XrdProofdAux.cxx.

Referenced by XrdProofdProofServMgr::CleanupProofServ(), GetNumCPUs(), GetProcesses(), and VerifyProcessByID().

int XrdProofdAux::GetNumCPUs ( )
static

Find out and return the number of CPUs in the local machine.

Return -1 in case of failure.

Definition at line 758 of file XrdProofdAux.cxx.

Referenced by XrdProofdNetMgr::XrdProofdNetMgr().

int XrdProofdAux::GetProcesses ( const char *  pn,
std::map< int, XrdOucString > *  pmap 
)
static

Get from the process table list of PIDs for processes named "proofserv' For {linux, sun, macosx} it uses the system info; for other systems it invokes the command shell 'ps ax' via popen.

Return the number of processes found, or -1 if some error occured.

Definition at line 919 of file XrdProofdAux.cxx.

Referenced by XrdProofdProofServMgr::CleanupLostProofServ().

int XrdProofdAux::GetUserInfo ( const char *  usr,
XrdProofUI ui 
)
static
int XrdProofdAux::GetUserInfo ( int  uid,
XrdProofUI ui 
)
static

Get information about user with 'uid' in a thread safe way.

Retur 0 on success, -errno on error

Definition at line 327 of file XrdProofdAux.cxx.

bool XrdProofdAux::HasToken ( const char *  s,
const char *  tokens 
)
static

Returns true is 's' contains at least one of the comma-separated tokens in 'tokens'.

Else returns false.

Definition at line 1133 of file XrdProofdAux.cxx.

Referenced by VerifyProcessByID().

int XrdProofdAux::KillProcess ( int  pid,
bool  forcekill,
XrdProofUI  ui,
bool  changeown 
)
static

Kill the process 'pid'.

A SIGTERM is sent, unless 'kill' is TRUE, in which case a SIGKILL is used. If add is TRUE (default) the pid is added to the list of processes requested to terminate. Return 0 on success, -1 if not allowed or other errors occured.

Definition at line 1291 of file XrdProofdAux.cxx.

Referenced by XrdProofdProofServ::CheckSession(), XrdProofdProofServMgr::CheckTerminatedSessions(), XrdProofdProofServMgr::CleanClientSessions(), XrdProofdProofServMgr::CleanupLostProofServ(), XrdProofdProofServMgr::CleanupProofServ(), XrdProofdProofServMgr::Create(), and XrdProofdProofServ::TerminateProofServ().

void XrdProofdAux::LogEmsgToFile ( const char *  flog,
const char *  emsg,
const char *  pfx = 0 
)
static

Logs error message 'emsg' to file 'flog' using standard technology.

Definition at line 392 of file XrdProofdAux.cxx.

Referenced by XrdProofdProofServMgr::Create().

int XrdProofdAux::MvDir ( const char *  oldpath,
const char *  newpath 
)
static

Move content of directory at oldpath to newpath.

The destination path 'newpath' must exist. Returns 0 on success, -errno of the last error on failure

Definition at line 1407 of file XrdProofdAux.cxx.

int XrdProofdAux::ParsePidPath ( const char *  path,
XrdOucString &  before,
XrdOucString &  after 
)
static

Parse a path in the form of "<before>[.<pid>][.<after>]", filling 'rest' and returning 'pid'.

Return 0 if pid is not defined; 'before' is filled with the string preceding <pid>, <after> with the string following <pid>.

Definition at line 1561 of file XrdProofdAux.cxx.

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

Parse a path in the form of "<usr>[.<grp>][.<pid>]", filling 'usr' and 'grp'.

Returns -1 on failure, 0 if the pid is not defined or the pid.

Definition at line 1612 of file XrdProofdAux.cxx.

Referenced by XrdProofdClientMgr::CheckClients().

const char * XrdProofdAux::ProofRequestTypes ( int  type)
static

Translates the proof request type in a human readable string.

Must be consistent with the values in XProofProtocol.h. The reserved ones are for un

Definition at line 68 of file XrdProofdAux.cxx.

Referenced by XrdProofdProtocol::Process(), XrdProofdManager::Process(), XrdProofdProofServMgr::Process(), and XrdProofdProtocol::Process2().

int XrdProofdAux::ReadMsg ( int  fd,
XrdOucString &  msg 
)
static

Receive 'msg' from pipe fd.

Definition at line 1514 of file XrdProofdAux.cxx.

Referenced by XrdProofdPipe::Recv().

int XrdProofdAux::RmDir ( const char *  path)
static

Remove directory at path and its content.

Returns 0 on success, -errno of the last error on failure

Definition at line 1344 of file XrdProofdAux.cxx.

Referenced by XrdProofdClientMgr::CheckAdminPath(), XrdProofdClientMgr::CheckClients(), MvDir(), and XrdProofdClientMgr::ParsePreviousClients().

int XrdProofdAux::SymLink ( const char *  path,
const char *  link 
)
static

Create a symlink 'link' to 'path' Return 0 in case of success, -1 in case of error.

Definition at line 693 of file XrdProofdAux.cxx.

Referenced by XrdProofdProofServMgr::CreateProofServRootRc(), XrdProofdProofServMgr::SetProofServEnv(), and XrdProofdProofServMgr::SetProofServEnvOld().

int XrdProofdAux::Touch ( const char *  path,
int  opt = 0 
)
static

Set access (opt == 1), modify (opt =2 ) or access&modify (opt = 0, default) times of path to current time.

Returns 0 on success, -errno on failure

Definition at line 1484 of file XrdProofdAux.cxx.

Referenced by XrdProofdProtocol::TouchAdminPath().

int XrdProofdAux::VerifyProcessByID ( int  pid,
const char *  pname = "proofserv" 
)
static

Check if a process named 'pname' and process 'pid' is still in the process table.

For {linux, sun, macosx} it uses the system info; for other systems it invokes the command shell 'ps ax' via popen. Return 1 if running, 0 if not running, -1 if the check could not be run.

Definition at line 1151 of file XrdProofdAux.cxx.

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

Write nb bytes at buf to descriptor 'fd' ignoring interrupts Return the number of bytes written or -1 in case of error.

Definition at line 363 of file XrdProofdAux.cxx.

Referenced by XrdProofdClientMgr::FilterSecConfig().

Member Data Documentation

XrdSysRecMutex XrdProofdAux::fgFormMutex
staticprivate

Definition at line 248 of file XrdProofdAux.h.


The documentation for this class was generated from the following files: