Definition at line 244 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. | |
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'. | |
static int | AssertDir (const char *path, XrdProofUI ui, bool changeown) |
Make sure that 'path' exists and is owned by the entity described by 'ui'. | |
static int | ChangeMod (const char *path, unsigned int mode) |
Change the permission mode of 'path' to 'mode'. | |
static int | ChangeOwn (const char *path, XrdProofUI ui) |
Change the ownership of 'path' to the entity described by 'ui'. | |
static int | ChangeToDir (const char *dir, XrdProofUI ui, bool changeown) |
Change current directory to 'dir'. | |
static int | CheckIf (XrdOucStream *s, const char *h) |
Check existence and match condition of an 'if' directive If none (valid) is found, return -1. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
static int | GetGroupInfo (const char *grp, XrdProofGI &gi) |
Get information about group with 'gid' in a thread safe way. | |
static int | GetGroupInfo (int gid, XrdProofGI &gi) |
Get information about group with 'gid' in a thread safe way. | |
static int | GetIDFromPath (const char *path, XrdOucString &emsg) |
Extract an integer from a file. | |
static long int | GetLong (char *str) |
Extract first integer from string at 'str', if any. | |
static int | GetNumCPUs () |
Find out and return the number of CPUs in the local machine. | |
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. | |
static int | GetUserInfo (const char *usr, XrdProofUI &ui) |
Get information about user 'usr' in a thread safe way. | |
static int | GetUserInfo (int uid, XrdProofUI &ui) |
Get information about user with 'uid' in a thread safe way. | |
static bool | HasToken (const char *s, const char *tokens) |
Returns true is 's' contains at least one of the comma-separated tokens in 'tokens'. | |
static int | KillProcess (int pid, bool forcekill, XrdProofUI ui, bool changeown) |
Kill the process 'pid'. | |
static void | LogEmsgToFile (const char *flog, const char *emsg, const char *pfx=0) |
Logs error message 'emsg' to file 'flog' using standard technology. | |
static int | MvDir (const char *oldpath, const char *newpath) |
Move content of directory at oldpath to newpath. | |
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'. | |
static int | ParseUsrGrp (const char *path, XrdOucString &usr, XrdOucString &grp) |
Parse a path in the form of "<usr>[.<grp>][.<pid>]", filling 'usr' and 'grp'. | |
static const char * | ProofRequestTypes (int type) |
Translates the proof request type in a human readable string. | |
static int | ReadMsg (int fd, XrdOucString &msg) |
Receive 'msg' from pipe fd. | |
static int | RmDir (const char *path) |
Remove directory at path and its content. | |
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. | |
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. | |
static int | VerifyProcessByID (int pid, const char *pname="proofserv") |
Check if a process named 'pname' and process 'pid' is still in the process table. | |
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. | |
Static Private Attributes | |
static XrdSysRecMutex | fgFormMutex |
#include <XrdProofdAux.h>
|
inline |
Definition at line 247 of file XrdProofdAux.h.
|
static |
Translates the admin message type in a human readable string.
Must be consistent with the values in XProofProtocol.h
Definition at line 49 of file XrdProofdAux.cxx.
|
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 467 of file XrdProofdAux.cxx.
|
static |
Make sure that 'path' exists and is owned by the entity described by 'ui'.
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 430 of file XrdProofdAux.cxx.
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 568 of file XrdProofdAux.cxx.
|
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 511 of file XrdProofdAux.cxx.
|
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 657 of file XrdProofdAux.cxx.
|
static |
Check existence and match condition of an 'if' directive If none (valid) is found, return -1.
Else, return number of chars matching.
Definition at line 725 of file XrdProofdAux.cxx.
|
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 97 of file XrdProofdAux.cxx.
|
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 191 of file XrdProofdAux.cxx.
|
static |
Recreate the string according to 'fmt' and the 5 'void *' arguments.
Definition at line 2483 of file XrdProofdAux.cxx.
|
static |
Recreate the string according to 'fmt' and the 5 'void *' arguments.
Definition at line 2426 of file XrdProofdAux.cxx.
|
static |
Recreate the string according to 'fmt' and the 5 'void *' arguments.
Definition at line 2455 of file XrdProofdAux.cxx.
|
static |
Recreate the string according to 'fmt' and the 5 'void *' arguments.
Definition at line 2399 of file XrdProofdAux.cxx.
|
static |
Recreate the string according to 'fmt' and the 5 'void *' arguments.
Definition at line 2598 of file XrdProofdAux.cxx.
|
static |
Recreate the string according to 'fmt' and the 5 'const char *' arguments.
Definition at line 2319 of file XrdProofdAux.cxx.
|
static |
Recreate the string according to 'fmt' and the 5 'void *' arguments.
Definition at line 2441 of file XrdProofdAux.cxx.
|
static |
Recreate the string according to 'fmt' and the 5 'void *' arguments.
Definition at line 2386 of file XrdProofdAux.cxx.
|
static |
Recreate the string according to 'fmt' and the 5 'void *' arguments.
Definition at line 2373 of file XrdProofdAux.cxx.
|
static |
Recreate the string according to 'fmt' and the 5 'void *' arguments.
Definition at line 2572 of file XrdProofdAux.cxx.
|
static |
Recreate the string according to 'fmt' and the 5 'void *' arguments.
Definition at line 2611 of file XrdProofdAux.cxx.
|
static |
Recreate the string according to 'fmt' and the 5 'void *' arguments.
Definition at line 2360 of file XrdProofdAux.cxx.
|
static |
Recreate the string according to 'fmt' and the 5 'void *' arguments.
Definition at line 2624 of file XrdProofdAux.cxx.
|
static |
Recreate the string according to 'fmt' and the 5 'void *' arguments.
Definition at line 2412 of file XrdProofdAux.cxx.
|
static |
Recreate the string according to 'fmt' and the 5 'void *' arguments.
Definition at line 2469 of file XrdProofdAux.cxx.
|
static |
Recreate the string according to 'fmt' and the 5 'void *' arguments.
Definition at line 2496 of file XrdProofdAux.cxx.
|
static |
Recreate the string according to 'fmt' and the 5 'void *' arguments.
Definition at line 2534 of file XrdProofdAux.cxx.
|
static |
Recreate the string according to 'fmt' and the 5 'void *' arguments.
Definition at line 2521 of file XrdProofdAux.cxx.
Recreate the string according to 'fmt' and the 5 'void *' arguments.
Definition at line 2509 of file XrdProofdAux.cxx.
|
static |
Recreate the string according to 'fmt' and the 5 'void *' arguments.
Definition at line 2547 of file XrdProofdAux.cxx.
|
static |
Recreate the string according to 'fmt' and the 5 'int' arguments.
Definition at line 2333 of file XrdProofdAux.cxx.
|
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 2263 of file XrdProofdAux.cxx.
|
static |
Recreate the string according to 'fmt' and the 5 'void *' arguments.
Definition at line 2585 of file XrdProofdAux.cxx.
Recreate the string according to 'fmt' and the 5 'void *' arguments.
Definition at line 2560 of file XrdProofdAux.cxx.
|
static |
Recreate the string according to 'fmt' and the 5 'void *' arguments.
Definition at line 2346 of file XrdProofdAux.cxx.
|
static |
Get information about group with 'gid' in a thread safe way.
Retur 0 on success, -errno on error
Definition at line 225 of file XrdProofdAux.cxx.
|
static |
Get information about group with 'gid' in a thread safe way.
Retur 0 on success, -errno on error
Definition at line 259 of file XrdProofdAux.cxx.
|
static |
Extract an integer from a file.
Definition at line 1110 of file XrdProofdAux.cxx.
|
static |
Extract first integer from string at 'str', if any.
Definition at line 202 of file XrdProofdAux.cxx.
|
static |
Find out and return the number of CPUs in the local machine.
Return -1 in case of failure.
Definition at line 760 of file XrdProofdAux.cxx.
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 921 of file XrdProofdAux.cxx.
|
static |
Get information about user 'usr' in a thread safe way.
Return 0 on success, -errno on error
Definition at line 293 of file XrdProofdAux.cxx.
|
static |
Get information about user with 'uid' in a thread safe way.
Retur 0 on success, -errno on error
Definition at line 329 of file XrdProofdAux.cxx.
|
static |
Returns true is 's' contains at least one of the comma-separated tokens in 'tokens'.
Else returns false.
Definition at line 1135 of file XrdProofdAux.cxx.
|
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 1293 of file XrdProofdAux.cxx.
|
static |
Logs error message 'emsg' to file 'flog' using standard technology.
Definition at line 394 of file XrdProofdAux.cxx.
|
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 1409 of file XrdProofdAux.cxx.
|
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 1563 of file XrdProofdAux.cxx.
|
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 1614 of file XrdProofdAux.cxx.
|
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 70 of file XrdProofdAux.cxx.
Receive 'msg' from pipe fd.
Definition at line 1516 of file XrdProofdAux.cxx.
|
static |
Remove directory at path and its content.
Returns 0 on success, -errno of the last error on failure
Definition at line 1346 of file XrdProofdAux.cxx.
|
static |
Create a symlink 'link' to 'path' Return 0 in case of success, -1 in case of error.
Definition at line 695 of file XrdProofdAux.cxx.
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 1486 of file XrdProofdAux.cxx.
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 1153 of file XrdProofdAux.cxx.
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 365 of file XrdProofdAux.cxx.
|
staticprivate |
Definition at line 245 of file XrdProofdAux.h.