27#include "Xrd/XrdBuffer.hh"
28#include "Xrd/XrdScheduler.hh"
30#include "XrdOuc/XrdOucStream.hh"
55 XrdOucString *
ccs = (XrdOucString *)s;
57 if (
ccs->length() > 0) *
ccs +=
",";
61 TRACE(
DBG, k <<
" : "<<
cc->fCmd<<
" fmt: '"<<
cc->fFmt<<
"'");
83#if !defined(__APPLE__)
156 emsg +=
"Invalid type: ";
178 XPDERR(
"problems parsing file ");
183 msg = (
rcf) ?
"re-configuring" :
"configuring";
188 TRACE(
ALL,
"additional paths which can be browsed by all users: ");
211 if (
d->fName ==
"exportpath") {
213 }
else if (
d->fName ==
"cpcmd") {
241 val = cfg->GetWord();
263 XrdOucString
tkn(val);
264 if (
proto.length() <= 0) {
266 if (
proto.beginswith(
'-')) {
271 }
else if (
cpcmd.length() <= 0) {
273 }
else if (
tkn.beginswith(
"put:")) {
276 }
else if (
tkn.beginswith(
"fmt:")) {
286 val = cfg->GetWord();
292 }
else if (
cpcmd.length() > 0 &&
fmt.length() > 0) {
298 TRACE(
ALL,
"incomplete information: ignoring!");
326 response->Send((
void *)
msg.c_str(),
msg.length()+1);
347 response->Send((
void *)
msg.c_str(),
msg.length()+1);
364 const char *t =
p->Argp() ? (
const char *)
p->Argp()->buff :
"default";
365 int len =
p->Argp() ?
p->Request()->header.dlen :
strlen(
"default");
366 XrdOucString tag(t,
len);
371 if (tag.beginswith(
"u:")) {
373 usr.erase(
usr.rfind(
' '));
374 usr.replace(
"u:",
"");
376 tag.erase(0,tag.find(
' ') + 1);
384 if (
usr.length() > 0) {
388 grp.erase(
grp.rfind(
':'));
389 usr.erase(0,
usr.find(
':') + 1);
393 grp =
g ?
g->Name() :
"default";
395 if (
usr !=
p->Client()->User()) {
396 if (!
p->SuperUser()) {
397 usr.insert(
"not allowed to change settings for usr '", 0);
406 XrdOucString
emsg(
"user not found or not allowed: ");
418 if (!
r && tag ==
"default") {
428 TRACEP(
p,
DBG,
"default changed to "<<
c->ROOT()->Tag()<<
429 " for {client, group} = {"<<
usr<<
", "<<
grp<<
"} ("<<
c<<
")");
433 XrdOucString buf(
"u:");
434 buf +=
c->UI().fUser;
445 tag.insert(
"tag '", 0);
446 tag +=
"' not found in the list of available ROOT versions on some worker nodes";
451 tag.insert(
"tag '", 0);
452 tag +=
"' not found in the list of available ROOT versions";
472 XrdOucString
sbuf(1024);
476 char *buf = (
char *)
sbuf.c_str();
481 response->Send(buf,
len);
502 if (!
p->Client() || !(
xps =
p->Client()->GetServer(
psid))) {
507 int pid =
xps->SrvPID();
511 XrdOucString
wrks(
"");
516 if (
p->Request()->header.dlen > 0)
517 msg.assign((
const char *)
p->Argp()->buff, 0,
p->Request()->header.dlen);
526 char *buf = (
char *)
wrks.c_str();
532 response->Send(buf,
len);
554 int len =
p->Request()->header.dlen;
555 char *
grp =
new char[
len+1];
558 TRACEP(
p,
DBG,
"request to change priority for group '"<<
grp<<
"'");
561 if (
strcmp(
grp,
p->Client()->UI().fGroup.c_str())) {
562 TRACEP(
p,
XERR,
"received group does not match the user's one");
564 "SetGroupProperties: received group does not match the user's one");
578 TRACEP(
p,
XERR,
"problem sending message on the pipe");
580 "SetGroupProperties: problem sending message on the pipe");
611 std::list<XrdProofdClient *>::iterator i;
614 int len =
p->Request()->header.dlen;
622 XrdOucString
cmsg((
const char *)
p->Argp()->buff,
len);
624 if (
cmsg.beginswith(
"u:")) {
631 if (
usr.length() > 0) {
643 "SendMsgToUser: target client not found");
649 if (
cmsg.length() <= 0) {
651 TRACEP(
p,
XERR,
"no message after user specification");
653 "SendMsgToUser: no message after user specification");
658 if (!
p->SuperUser()) {
659 if (
usr.length() > 0) {
661 TRACEP(
p,
XERR,
"not allowed to send messages to usr '"<<
usr<<
"'");
663 "SendMsgToUser: not allowed to send messages to specified usr");
667 TRACEP(
p,
XERR,
"not allowed to send messages to connected users");
669 "SendMsgToUser: not allowed to send messages to connected users");
699 msg =
p->Client()->ExportSessions(
notmsg, response);
702 if (
notmsg.length() > 0) {
710 response->Send((
void *)
msg.c_str(),
msg.length()+1);
731 int len =
p->Request()->header.dlen;
733 buf.assign(
p->Argp()->buff,0,
len-1);
734 int im = buf.find(
"|master:");
735 int iu = buf.find(
"|user:");
736 int io = buf.find(
"|ord:");
744 user.assign(buf,
iu +
strlen(
"|user:"));
745 user.erase(user.find(
"|"));
751 if (
stag.beginswith(
'*'))
761 TRACEP(
p,
XERR,
"query sess logs: client for '"<<user<<
"' not found");
766 XrdOucString tag = (
stag ==
"" &&
ridx >= 0) ?
"last" :
stag;
768 TRACEP(
p,
XERR,
"query sess logs: session tag not found");
776 if (
master.length() <= 0) {
791 XrdOucString
msg(
"cannot open dir ");
800 wfile +=
"/.workers";
808 if (!
strcmp(ent->d_name,
".") || !
strcmp(ent->d_name,
".."))
continue;
809 XPDFORM(
xf,
"%s/%s",
sdir.c_str(), (
const char *) ent->d_name);
811 if (stat(
xf.c_str(), &
st) != 0)
continue;
814 if (
xo.matches(
"*-*-*-*-*.log") <= 0 &&
xo.matches(
"*-*-*-*-*.valgrind.log") <= 0)
continue;
818 xo.replace(
".log",
"");
834 if (
ord.length() > 0 && (
ord ==
xo)) {
857 XrdOucString
msg(tag);
892 if (
master.length() > 0) {
927 response->Send((
void *)
rmsg.c_str(),
rmsg.length()+1);
952 if (
p->SuperUser()) {
960 int len =
p->Request()->header.dlen;
963 buf =
p->Argp()->buff;
966 buf = (
char *)
p->Client()->User();
987 TRACEP(
p,
REQ,
"superuser, all sessions cleaned");
1000 TRACEP(
p,
DBG,
"client '"<<
usr<<
"' has no sessions - do nothing");
1004 bool hard = (
ntohl(
p->Request()->proof.int3) == 1 ||
p->ProofProtocol() < 18) ? 1 : 0;
1005 const char *
lab =
hard ?
"hard-reset" :
"soft-reset";
1009 XPDFORM(
cmsg,
"CleanupSessions: %s: signalling active sessions for termination",
lab);
1014 XPDFORM(
cmsg,
"CleanupSessions: %s: cleaning up client: requested by: %s",
lab,
p->Link()->ID);
1022 XPDFORM(
cmsg,
"CleanupSessions: %s: forwarding the reset request to next tier(s) ",
lab);
1034 while (
twait-- > 0 &&
1037 XPDFORM(
cmsg,
"CleanupSessions: %s: wait %d more seconds for completion ...",
lab,
twait);
1067 if (!
p->Client() || !(
xps =
p->Client()->GetServer(
psid))) {
1074 const char *
msg = (
const char *)
p->Argp()->buff;
1075 int len =
p->Request()->header.dlen;
1108 if (!
p->Client() || !(
xps =
p->Client()->GetServer(
psid))) {
1115 const char *
msg = (
const char *)
p->Argp()->buff;
1116 int len =
p->Request()->header.dlen;
1124 XrdOucString tag(
xps->Tag());
1149 if (!
p->Client() || !(
xps =
p->Client()->GetServer(
psid))) {
1156 const char *
msg = (
const char *)
p->Argp()->buff;
1157 int len =
p->Request()->header.dlen;
1182 if (!s || (
len =
strlen(s)) <= 0)
return 0;
1187 if (
c ==
'(' ||
c ==
')' ||
c ==
'{' ||
c ==
'}' ||
c ==
';') {
1203#if !defined(__APPLE__)
1204 const char *
cmds[] = {
"rm",
"ls",
"more",
"grep",
"tail",
"md5sum",
"stat",
"find" };
1206 const char *
cmds[] = {
"rm",
"ls",
"more",
"grep",
"tail",
"md5",
"stat",
"find" };
1208 const char *
actcmds[] = {
"remove",
"access",
"open",
"open",
"open",
"open",
"stat",
"find"};
1218 emsg =
"client instance not found";
1227 emsg =
"unknown action type: ";
1235 int dlen =
p->Request()->header.dlen;
1236 XrdOucString
msg, node, path, opt;
1237 if (dlen > 0 &&
p->Argp()->buff) {
1238 msg.assign((
const char *)
p->Argp()->buff, 0, dlen);
1242 if ((
from =
msg.tokenize(node,
from,
'|')) != -1) {
1243 if ((
from =
msg.tokenize(path,
from,
'|')) != -1) {
1246 emsg =
"'path' not found in message";
1249 emsg =
"'node' not found in message";
1251 if (
emsg.length() > 0) {
1260 emsg =
"none of the characters '(){};' are allowed in path string (";
emsg += path;
emsg +=
")";
1266 emsg =
"none of the characters '(){};' are allowed in opt string (";
emsg += opt;
emsg +=
")";
1277 if (node ==
"all") {
1279 emsg =
"action cannot be run in mode 'all' - running on master only";
1297 result.assign((
const char *)
xrsp->GetData(), 0,
xrsp->DataLen());
1309 if (node !=
"all" && !
islocal) {
1311 if (
result.length() > 0) {
1312 response->Send(
result.c_str());
1325 if (node !=
"all") {
1350 emsg +=
": cannot ";
1354 emsg +=
"': No such file or directory";
1355 }
else if (
rccp == -3) {
1357 emsg +=
": cannot stat ";
1359 emsg +=
": errno: ";
1361 }
else if (
rccp == -4) {
1365 emsg +=
": Is not a regular file";
1377 emsg =
"not allowed to rm with wild cards on path: ";
1383 if ((
int)
st.st_uid !=
tgtclnt->UI().fUid || (
int)
st.st_gid !=
tgtclnt->UI().fGid) {
1384 emsg =
"rm on path: ";
1386 emsg +=
" requires ownership; path owned by: (";
1395 const char *
sbdir[5] = {
"queries",
"packages",
"cache",
"datasets",
"data"};
1401 emsg =
"removing all sandbox directory is not allowed: ";
1410 emsg =
"removing a basic sandbox directory is not allowed: ";
1421 if (opt.length() <= 0) opt =
"-f";
1422 cmd +=
" "; cmd += opt;
1432 if (opt.length() <= 0) opt =
"-C";
1451 if (cmd.length() > 0) cmd +=
" ";
1452 if (opt.length() > 0) { cmd += opt; cmd +=
" ";}
1456 if (opt.length() > 0) { cmd +=
" "; cmd += opt; }
1471 response->Send(
emsg.c_str());
1474 response->Send(
"OK");
1494 int action,
const char *cmd, XrdOucString &
emsg)
1503 if (!cmd ||
strlen(cmd) <= 0) {
1504 emsg =
"undefined command!";
1511 emsg =
"cannot create the pipe";
1516 TRACEP(
p,
DBG,
"forking to execute in the private sandbox");
1518 if (!(pid =
fMgr->
Sched()->Fork(
"adminexeccmd"))) {
1523 emsg =
"SetUserEnvironment did not return OK";
1529 if ((stat(cmd, &
st)) != 0) {
1531 emsg +=
"stat: cannot stat `";
1533 emsg +=
"': No such file or directory";
1535 emsg +=
"stat: cannot stat ";
1537 emsg +=
": errno: ";
1544 snprintf(
msg, 256,
"%ld %ld %d %d %d %lld %ld %d", (
long)
st.st_dev,
1545 (
long)
st.st_ino,
st.st_mode, (
int)(
st.st_uid),
1546 (
int)(
st.st_gid), (kXR_int64)
st.st_size,
st.st_mtime, islink);
1572#if !defined(__APPLE__)
1575 sl.tokenize(
emsg, 0,
' ');
1589 if (buf[
len-1] ==
'\n') buf[
len-1] =
'\0';
1591 emsg =
"error sending message to requester";
1610 if (lines > 0 && !(lines % 10)) {
1612 if (
p->Link()->Peek(&
b[0], 1, 0) == 1) {
1613 p->Process(
p->Link());
1614 if (
p->IsCtrlC())
break;
1621 if (buf[
len-1] ==
'\n') buf[
len-1] =
'\0';
1623 emsg =
"error sending message to requester";
1630 emsg =
"could not close the command pipe";
1634 emsg =
"failure: return code: ";
1661 TRACEP(
p,
DBG,
"forking OK: wait for information");
1667 while ((
prc = pp.
Poll(60)) > 0) {
1670 emsg =
"error receiving message from pipe";
1679 if (buf.length() <= 0) {
1680 emsg =
"error reading string from received message";
1688 if (buf.length() <= 0) {
1689 emsg =
"error reading string from received message";
1700 emsg =
"timeout from poll";
1702 }
else if (
prc < 0) {
1717 struct stat *
st, XrdOucString &
emsg)
1720 emsg =
"CheckPath: sandbox dir undefined!";
1727 if (path.beginswith(
'/')) {
1731 if (path.beginswith(
"../")) path.erase(0,2);
1732 if (path.beginswith(
"./") || path.beginswith(
"~/")) path.erase(0,1);
1733 if (!path.beginswith(
"/")) path.insert(
'/',0);
1745 if (path.beginswith((*si).c_str())) {
1752 emsg =
"CheckPath: not allowed to run the requested action on ";
1791 emsg =
"client instance not found";
1798 int dlen =
p->Request()->header.dlen;
1800 if (dlen > 0 &&
p->Argp()->buff) {
1801 path.assign((
const char *)
p->Argp()->buff, 0, dlen);
1802 if (path.length() <= 0) {
1818 emsg =
"Cannot open `";
1820 emsg +=
"': No such file or directory";
1821 }
else if (
rccp == -3) {
1822 emsg =
"Cannot stat `";
1824 emsg +=
"': errno: ";
1826 }
else if (
rccp == -4) {
1828 emsg +=
" is not a regular file";
1838 emsg =
"cannot create the pipe for internal communications";
1844 TRACEP(
p,
DBG,
"forking to execute in the private sandbox");
1846 if (!(pid =
fMgr->
Sched()->Fork(
"admingetfile"))) {
1852 emsg =
"SetUserEnvironment did not return OK";
1859 emsg =
"cannot open file: ";
1861 emsg +=
" - errno:";
1871 response->Send((
const char *) &
sizmsg[0]);
1880 while (
rc == 0 && pos <
st.st_size) {
1881 off_t left =
st.st_size - pos;
1885 while ((
siz = read(fd, &buf[0], left)) < 0 &&
errno ==
EINTR)
1887 if (
siz < 0 ||
siz != left) {
1888 emsg =
"error reading from file: errno: ";
1896 emsg =
"error reading from file: errno: ";
1904 if (pp.
Post(0,
"") != 0) {
1925 if (pp.
Post(1,
"") != 0)
rc = 1;
1941 TRACEP(
p,
DBG,
"forking OK: execution will continue in the child process");
1946 while (
rst == 0 &&
rc >= 0) {
1947 while ((
prc = pp.
Poll(60)) > 0) {
1950 emsg =
"error receiving message from pipe";
1961 if (
emsg.length() <= 0) {
1962 emsg =
"error reading string from received message";
1966 }
else if (
rst > 0) {
1972 emsg =
"timeout from poll";
1974 }
else if (
prc < 0) {
1981 TRACEP(
p,
DBG,
"execution over: "<< ((
rc == 0) ?
"ok" :
"failed"));
2002 emsg =
"client instance not found";
2009 kXR_int64
size = -1;
2010 int dlen =
p->Request()->header.dlen;
2011 XrdOucString cmd, path,
ssiz, opt;
2012 if (dlen > 0 &&
p->Argp()->buff) {
2013 cmd.assign((
const char *)
p->Argp()->buff, 0, dlen);
2014 if (cmd.length() <= 0) {
2020 if ((
from = cmd.tokenize(path,
from,
' ')) < 0) {
2026 TRACEP(
p,
XERR,
"cannot resolve word with size!");
2038 cmd.tokenize(opt,
from,
' ');
2040 TRACEP(
p,
DBG,
"path: '"<<path<<
"'; size: "<<
size<<
" bytes; opt: '"<<opt<<
"'");
2057 emsg +=
"' exists but cannot be stat: errno: ";
2067 if (opt ==
"force") {
2072 emsg +=
"' exists; user option 'force' to override it";
2082 emsg =
"cannot create the pipe for internal communications";
2088 TRACEP(
p,
DBG,
"forking to execute in the private sandbox");
2090 if (!(pid =
fMgr->
Sched()->Fork(
"adminputfile"))) {
2095 emsg =
"SetUserEnvironment did not return OK";
2101 emsg =
"cannot open file: ";
2103 emsg +=
" - errno: ";
2111 response->Send(
"OK");
2117 emsg =
"cannot get buffer to read data out";
2127 if ((
rc =
p->GetData(
"data",
argp->buff, left))) {
2129 emsg =
"cannot read data out";
2136 char *
b =
argp->buff;
2143 emsg =
"error writing to unit: ";
2152 if (pp.
Post(0,
"") != 0) {
2174 if (pp.
Post(1,
"") != 0)
rc = 1;
2189 TRACEP(
p,
DBG,
"forking OK: execution will continue in the child process");
2194 while (
rst == 0 &&
rc >= 0) {
2195 while ((
prc = pp.
Poll(60)) > 0) {
2198 emsg =
"error receiving message from pipe";
2209 if (
emsg.length() <= 0) {
2210 emsg =
"error reading string from received message";
2214 }
else if (
rst > 0) {
2220 emsg =
"timeout from poll";
2222 }
else if (
prc < 0) {
2229 TRACEP(
p,
DBG,
"execution over: "<< ((
rc == 0) ?
"ok" :
"failed"));
2250 emsg =
"client instance not found";
2257 int dlen =
p->Request()->header.dlen;
2259 if (dlen > 0 &&
p->Argp()->buff) {
2260 buf.assign((
const char *)
p->Argp()->buff, 0, dlen);
2261 if (buf.length() <= 0) {
2285 if (
usrc.Proto.length() > 0 &&
usrc.Proto !=
"file") {
2288 TRACEP(
p,
XERR,
"protocol for source file not supported");
2296 if (
udst.Proto.length() > 0 &&
udst.Proto !=
"file") {
2299 TRACEP(
p,
XERR,
"protocol for destination file not supported");
2313 TRACEP(
p,
XERR,
"At least destination or source must be local");
2320 TRACEP(
p,
XERR,
"not allowed to create destination file with the chosen protocol");
2321 response->Send(
kXR_InvalidRequest,
"not allowed to create destination file with the chosen protocol");
2346 emsg +=
": cannot open `";
2348 emsg +=
"': No such file or directory";
2351 emsg +=
": cannot stat ";
2353 emsg +=
": errno: ";
2359 emsg +=
": Is not a regular file";
2371 emsg +=
": cannot open `";
2373 emsg +=
"': No such file or directory";
2376 emsg +=
": cannot stat ";
2378 emsg +=
": errno: ";
2384 emsg +=
": Is not a regular file";
2393 if (
fmt.length() <= 0) {
2396 if (!
fmt.beginswith(
xc->fCmd)) {
2398 fmt.insert(
xc->fCmd, 0);
2401 fmt.insert(
" %s %s", -1);
2409 TRACEP(
p,
DBG,
"Executing command: " << cmd);
2414 emsg =
"cannot create the pipe";
2421 TRACEP(
p,
DBG,
"forking to execute in the private sandbox");
2423 if (!(pid =
fMgr->
Sched()->Fork(
"admincpfile"))) {
2428 emsg =
"SetUserEnvironment did not return OK";
2449 emsg =
"error sending message to requester";
2455 if (
p->Link()->Peek(&
b[0], 1, 0) == 1) {
2456 p->Process(
p->Link());
2457 if (
p->IsCtrlC())
break;
2460 if (pp.
Post(0,
"") != 0) {
2468 emsg =
"error while trying to close the command pipe";
2472 emsg =
"return code: ";
2477 char cp[1] = {
'\n'};
2479 emsg =
"error sending progress notification to requester";
2491 if (pp.
Post(1,
"") != 0)
rc = 1;
2504 TRACEP(
p,
DBG,
"forking OK: wait for execution");
2509 while (
rst == 0 &&
rc >= 0) {
2510 while ((
prc = pp.
Poll(60)) > 0) {
2513 emsg =
"error receiving message from pipe";;
2524 if (
emsg.length() <= 0)
2525 emsg =
"error reading string from received message";
2526 }
else if (
rst == 1) {
2532 emsg =
"timeout from poll";
2534 }
else if (
prc < 0) {
2541 TRACEP(
p,
DBG,
"execution over: "<< ((
rc == 0) ?
"ok" :
"failed"));
2544 emsg.insert(
"failure: ", 0);
2548 response->Send(
"OK");
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
#define TRACE(Flag, Args)
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t src
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
R__EXTERN C unsigned int sleep(unsigned int seconds)
static int ExportCpCmd(const char *k, XpdAdminCpCmd *cc, void *s)
Decrease active session counters on worker w.
int DoDirectiveClass(XrdProofdDirective *, char *val, XrdOucStream *cfg, bool rcf)
Generic class directive processor.
#define kXPROOFSRVALIASMAX
#define XPD_SETRESP(p, x)
#define TRACEP(p, act, x)
XrdProofGroup * GetUserGroup(const char *usr, const char *grp=0)
Returns the instance of the first group to which this user belongs; if grp != 0, return the instance ...
virtual int ExportInfo(XrdOucString &)
Fill sbuf with some info about our current status.
int CleanupSessions(XrdProofdProtocol *p)
Handle request of.
int ExecCmd(XrdProofdProtocol *p, XrdProofdResponse *r, int action, const char *cmd, XrdOucString &emsg)
Low-level execution handler.
int GetWorkers(XrdProofdProtocol *p)
Handle request for getting the best set of workers.
int SetSessionTag(XrdProofdProtocol *p)
Handle request for setting the session tag.
int SetSessionAlias(XrdProofdProtocol *p)
Handle request for setting the session alias.
int SetROOTVersion(XrdProofdProtocol *p)
Handle request for changing the default ROOT version.
XrdProofdAdmin(XrdProofdManager *mgr, XrdProtocol_Config *pi, XrdSysError *e)
Constructor.
int GetFile(XrdProofdProtocol *p)
Handle request for sending a file.
int PutFile(XrdProofdProtocol *p)
Handle request for recieving a file.
int SendMsgToUser(XrdProofdProtocol *p)
Handle request for sending a message to a user.
int QuerySessions(XrdProofdProtocol *p)
Handle request for list of sessions.
int CheckForbiddenChars(const char *s)
Check is 's' contains any of the forbidden chars '(){};' Return 0 if OK (no forbidden chars),...
int Exec(XrdProofdProtocol *p)
Handle request of cleaning parts of the sandbox.
int DoDirectiveCpCmd(char *, XrdOucStream *, bool)
Process 'cpcmd' directives eg: xpd.cpcmd alien aliencp fmt:"%s %s" put:0.
int CheckPath(bool superuser, const char *sbdir, XrdOucString &fullpath, int check, bool &sandbox, struct stat *st, XrdOucString &emsg)
Handle request for sending a file.
int DoDirective(XrdProofdDirective *d, char *val, XrdOucStream *cfg, bool rcf)
Update the priorities of the active sessions.
XrdOucHash< XpdAdminCpCmd > fAllowedCpCmds
int Config(bool rcf=0)
Run configuration and parse the entered config directives.
int Process(XrdProofdProtocol *p, int type)
Process admin request.
int SetGroupProperties(XrdProofdProtocol *p)
Handle request for setting group properties.
void RegisterDirectives()
Register directives for configuration.
int CpFile(XrdProofdProtocol *p)
Handle request for copy files from / to the sandbox.
std::list< XrdOucString > fExportPaths
int QueryMssUrl(XrdProofdProtocol *p)
Handle request for the URL to the MSS attached to the cluster.
int QueryLogPaths(XrdProofdProtocol *p)
Handle request for log paths.
int QueryROOTVersions(XrdProofdProtocol *p)
Handle request for list of ROOT versions.
int DoDirectiveExportPath(char *, XrdOucStream *, bool)
Process 'exportpath' directives eg: xpd.exportpath /tmp/data /data2/data.
int ReleaseWorker(XrdProofdProtocol *p)
Handle request for releasing a worker.
int QueryWorkers(XrdProofdProtocol *p)
Handle request for getting the list of potential workers.
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,...
static const char * AdminMsgType(int type)
Translates the admin message type in a human readable string.
XrdProofdClient * GetClient(const char *usr, const char *grp=0, bool create=1)
Handle request for localizing a client instance for {usr, grp} from the list.
void Broadcast(XrdProofdClient *c, const char *msg)
Broadcast message 'msg' to the connected instances of client 'clnt' or to all connected instances if ...
void TerminateSessions(XrdProofdClient *c, const char *msg, int srvtype)
Terminate sessions of client 'clnt' or to of all clients if clnt == 0.
XrdProofdSandbox * Sandbox() const
const char * User() const
virtual int Config(bool rcf=0)
void Register(const char *dname, XrdProofdDirective *d)
int GetWorkers(XrdOucString &workers, XrdProofdProofServ *, const char *)
Get a list of workers from the available resource broker.
XrdProofdPriorityMgr * PriorityMgr() const
const char * PoolURL() const
XrdProofSched * ProofSched() const
XrdROOTMgr * ROOTMgr() const
XrdProofdNetMgr * NetMgr() const
XrdProofGroupMgr * GroupsMgr() const
XrdScheduler * Sched() const
XrdProofdClientMgr * ClientMgr() const
const char * Host() const
const char * NameSpace() const
const char * EffectiveUser() const
XrdProofdProofServMgr * SessionMgr() const
int Broadcast(int type, const char *msg, const char *usr=0, XrdProofdResponse *r=0, bool notify=0, int subtype=-1)
Broadcast request to known potential sub-nodes.
bool IsLocal(const char *host, bool checkport=0)
Check if 'host' is this local host.
XrdClientMessage * Send(const char *url, int type, const char *msg, int srvtype, XrdProofdResponse *r, bool notify=0, int subtype=-1)
Broadcast request to known potential sub-nodes.
char * ReadLogPaths(const char *url, const char *stag, int isess)
Get log paths from next tier; used in multi-master setups Returns 0 in case of error.
int Recv(XpdMsg &msg)
Recv message from the pipe.
int Poll(int to=-1)
Poll over the read pipe for to secs; return whatever poll returns.
int Post(int type, const char *msg)
Post message on the pipe.
int SetUserEnvironment(XrdProofdProtocol *p)
Set user environment: set effective user and group ID of the process to the ones of the owner of this...
static XrdBuffer * GetBuff(int quantum, XrdBuffer *argp=0)
Allocate a buffer to handle quantum bytes; if argp points to an existing buffer, its size is checked ...
static void ReleaseBuff(XrdBuffer *argp)
Release a buffer previously allocated via GetBuff.
int GuessTag(XrdOucString &tag, int ridx=1)
Guess session tag completing 'tag' (typically "-<pid>") by scanning the active session file or the se...
XrdROOT * GetVersion(const char *tag)
Return pointer to the ROOT version corresponding to 'tag' or 0 if not found.
XrdROOT * DefaultVersion() const
XrdOucString ExportVersions(XrdROOT *def)
Return a string describing the available versions, with the default version 'def' markde with a '*'.