28#include "XrdVersion.hh"
29#include "Xrd/XrdProtocol.hh"
30#include "XrdOuc/XrdOucEnv.hh"
31#include "XrdOuc/XrdOucStream.hh"
67typedef XrdProtocol *(*XrdProtocolLoader_t)(
const char *,
char *, XrdProtocol_Config *);
104#if defined(LIBC_SCCS) && !defined(lint)
105static char sccsid[] =
"@(#)getgrouplist.c 8.2 (Berkeley) 12/8/94";
107#include <sys/cdefs.h>
108__FBSDID(
"$FreeBSD: src/lib/libc/gen/getgrouplist.c,v 1.14 2005/05/03 16:20:03 delphij Exp $");
114#include <sys/types.h>
119getgrouplist(
const char *uname, gid_t agroup, gid_t *groups,
int *grpcnt)
121 const struct group *grp;
122 int i, maxgroups, ngroups, ret;
132 groups ? groups[ngroups++] = agroup : ngroups++;
134 groups ? groups[ngroups++] = agroup : ngroups++;
139 while ((grp = getgrent()) != NULL) {
141 for (i = 0; i < ngroups; i++) {
142 if (grp->
gr_gid == groups[i])
146 for (i = 0; grp->
gr_mem[i]; i++) {
147 if (!strcmp(grp->
gr_mem[i], uname)) {
148 if (ngroups >= maxgroups) {
152 groups ? groups[ngroups++] = grp->
gr_gid : ngroups++;
176 XPDLOC(PMGR,
"ManagerCron")
180 TRACE(REQ,
"undefined manager: cannot start");
188 int mid = XrdSysTimer::Midnight(now);
192 TRACE(REQ,
"midnight in " << (mid - now) <<
" secs");
196 TRACE(REQ,
"running periodical checks");
202 if ((mid - now) <= tw) {
212 XrdSysTimer::Wait(tw * 1000);
319 XPDLOC(ALL,
"Manager::LoadXrootd")
338 if (!(xrp = (*ep)(
"xrootd", parms, pi))) {
339 TRACE(XERR,
"Unable to create xrootd protocol service object via " <<
fXrootdLibPath.c_str());
343 TRACE(ALL,
"xrootd protocol service created");
354 XPDLOC(ALL,
"Manager::CheckLogFileOwnership")
357 if (getuid())
return;
360 if (fstat(STDERR_FILENO, &st) != 0) {
361 if (errno != ENOENT) {
362 TRACE(XERR,
"could not stat log file; errno: " << errno);
367 TRACE(HDBG,
"uid: " << st.st_uid <<
", gid: " << st.st_gid);
372 TRACE(XERR,
"could not get effective user identity; errno: " << errno);
377 if (st.st_uid != epwd->
pw_uid || st.st_gid != epwd->
pw_gid) {
378 if (fchown(STDERR_FILENO, epwd->
pw_uid, epwd->
pw_gid) != 0) {
379 TRACE(XERR,
"could not set stderr ownership; errno: " << errno);
395 std::list<XrdOucString *>::iterator i;
397 if (wm.matches((*i)->c_str())) {
417 if (!usr || strlen(usr) <= 0) {
418 e =
"CheckUser: 'usr' string is undefined ";
423 if (strlen(usr) == 4 && !strcmp(usr,
"root")) {
424 e =
"CheckUser: 'root' logins not accepted ";
429 if (!grp || strlen(grp) <= 0) {
430 e =
"CheckUser: 'grp' string is undefined ";
441 e =
"CheckUser: unknown ClientID: ";
448 e =
"CheckUser: problems getting user info for id: ";
458 while ((from =
fSuperUsers.tokenize(tkn, from,
',')) != -1) {
504 int ugrpok = 0, pgrpok = 0;
506 int ngrps = 10, neg, ig = 0;
507#if defined(__APPLE__)
513 if ((neg = getgrouplist(usr, ui.
fGid, grps, &ngrps)) < 0) neg = 10;
515 for (ig = 0; ig < neg; ig++) {
516 g.form(
"%d", (
int) grps[ig]);
522 e =
"Controlled access (UNIX group): user '";
524 e =
"', UNIX group '";
526 e +=
"' denied to connect";
540 e =
"Controlled access";
541 e +=
" (PROOF group): user '";
543 e +=
"', PROOF group '";
545 e +=
"' denied to connect";
550 grpok = ((ugrpok == 1 && pgrpok >= 0) || (ugrpok >= 0 && pgrpok == 1)) ? 1 : 0;
563 e =
"Controlled access: user '";
565 e +=
"', PROOF group '";
567 e +=
"' not allowed to connect";
579 if (usrok == -1 || (!grpok && usrok != 1))
return -1;
591 XPDLOC(ALL,
"Manager::LoadScheduler")
594 XrdOucString
name, lib,
m;
599 if (cfn && strlen(cfn) > 0) {
601 XrdOucStream cfg(
fEDest, getenv(
"XRDINSTANCE"), &myEnv);
604 if ((cfgFD = open(cfn, O_RDONLY, 0)) >= 0) {
607 char *val = 0, *var = 0;
608 while ((var = cfg.GetMyFirstWord())) {
609 if (!(strcmp(
"xpd.sched", var))) {
625 XPDFORM(
m,
"failure opening config file; errno: %d", errno);
631 if (
name ==
"default" || !(
name.length() > 0 && lib.length() > 0)) {
632 if ((
name.length() <= 0 && lib.length() > 0) ||
633 (
name.length() > 0 && lib.length() <= 0)) {
634 XPDFORM(
m,
"missing or incomplete info (name: %s, lib: %s)",
name.c_str(), lib.c_str());
637 TRACE(DBG,
"instantiating default scheduler");
641 if (lib.beginswith(
"~") || lib.beginswith(
"$"))
654 TRACE(XERR,
"unable to create scheduler object from " << lib);
662 TRACE(XERR,
" unable to instantiate the " << sched->
Name() <<
" scheduler using " << (cfn ? cfn :
"<nul>"));
667 TRACE(ALL,
"scheduler loaded: type: " << sched->
Name());
679 XPDLOC(ALL,
"Manager::GetWorkers")
686 TRACE(XERR,
"scheduler undefined");
691 std::list<XrdProofWorker *> wrks, uwrks;
693 TRACE(XERR,
"error getting list of workers from the scheduler");
696 std::list<XrdProofWorker *>::iterator iw, iaw;
700 TRACE(DBG,
"list size: " << wrks.size());
707 for (iw = wrks.begin(); iw != wrks.end() ; ++iw) {
711 for (iaw = uwrks.begin(); iaw != uwrks.end() ; ++iaw) {
733 w->AddProofServ(xps);
736 for (iw = uwrks.begin(); iw != uwrks.end() ; ++iw) {
739 if (
w->fType ==
'M') {
740 if (lw.length() > 0) lw.insert(
'&',0);
741 lw.insert(
w->Export(), 0);
744 if (lw.length() > 0) lw +=
'&';
753 for (iw = wrks.begin(); iw != wrks.end() ; ++iw) {
763 w->AddProofServ(xps);
769 if (rc != 2 || (
proto < 21 && rc == 0)) {
772 TRACE(DBG,
"from ExportWorkers: " << lw);
773 }
else if (
proto >= 21) {
781 if (!uwrks.empty()) {
783 while (iw != uwrks.end()) {
785 iw = uwrks.erase(iw);
808 if (ss.length() > 0) ss +=
",";
826 XrdOucString *ls = (XrdOucString *)s;
833 if (ls->length() > 0) *ls +=
",";
851 XPDLOC(ALL,
"Manager::Config")
857 XPDERR(
"problems parsing file ");
862 msg = (rcf) ?
"re-configuring" :
"configuring";
879 XPDFORM(msg,
"could not resolve effective uid %d (errno: %d)", effuid, errno);
885 char *host = XrdSysDNS::getHostName();
886 fHost = host ? host :
"";
893 const char *roles[] = {
"any",
"worker",
"submaster",
"master" };
921 pidfile +=
"/xrootd.pid";
922 FILE *fpid = fopen(pidfile.c_str(),
"w");
924 XPDFORM(msg,
"unable to open pid file: %s; errno: %d", pidfile.c_str(), errno);
928 fprintf(fpid,
"%d", getpid());
932 XPDFORM(msg,
"could not resolve effective uid %d (errno: %d)", effuid, errno);
948 if (iph != STR_NPOS) {
951 XPDERR(
"unable to assert working dir: " << wdir);
959 if (wdir.length() > 0) {
960 TRACE(ALL,
"working directories under: " << wdir);
977 TRACE(XERR,
"could not get privileges to set/change ownership of " <<
fDataDir);
980 if (chmod(
fDataDir.c_str(), 0777) != 0) {
981 XPDERR(
"problems setting permissions 0777 data dir: " <<
fDataDir);
991 std::list<XrdOucString *>::iterator i;
993 TRACE(ALL,
"masters allowed to connect: " << (*i)->c_str());
995 TRACE(ALL,
"masters allowed to connect: any");
1013 XPDERR(
"scheduler initialization failed");
1016 const char *st[] = {
"disabled",
"enabled" };
1022 TRACE(ALL,
"multi-process on nodes handled with proof-lite");
1028 std::list<XrdProofdDSInfo *>::iterator ii =
fDataSetSrcs.begin();
1031 TRACE(ALL,
">> Defined dataset: " << (*ii)->ToString());
1032 if ((*ii)->fType ==
"file") {
1034 XPDERR(
"source " << (*ii)->fUrl <<
" could not be validated");
1042 TRACE(ALL,
"Skipping validation (no \"file\" type dataset source)");
1049 TRACE(ALL,
">> Valid dataset: " << (*ii)->ToString());
1050 if ((*ii)->fLocal && (*ii)->fRW) {
1056 TRACE(ALL,
"no dataset sources defined");
1059 TRACE(ALL,
"no dataset sources defined");
1070 XPDFORM(msg,
"could not resolve effective uid %d (errno: %d)",
1082 while ((from =
fSuperUsers.tokenize(usr, from,
',')) != STR_NPOS) {
1091 XPDFORM(msg,
"running in controlled access mode: users removed because"
1092 " unknown to the system: %s", ius.c_str());
1100 XPDFORM(msg,
"running in controlled access mode: users allowed: %s", uls.
allowed.c_str());
1103 if (uls.
denied.length()) {
1104 XPDFORM(msg,
"running in controlled access mode: users denied: %s", uls.
denied.c_str());
1111 XPDFORM(msg,
"running in controlled access mode: UNIX groups allowed: %s", gls.
allowed.c_str());
1114 if (gls.
denied.length()) {
1115 XPDFORM(msg,
"running in controlled access mode: UNIX groups denied: %s", gls.
denied.c_str());
1128 while ((from = paths.tokenize(ldir, from,
':')) != STR_NPOS) {
1130 if (ldir.length() > 0) {
1135 DIR *dir = opendir(ldir.c_str());
1138 struct dirent *ent = 0;
1139 while ((ent = (
struct dirent *)readdir(dir))) {
1140 if (!strncmp(ent->d_name,
"libCore", 7)) {
1156 ctrim =
" (lib paths filter applied)";
1177 XPDERR(
"problems configuring the admin handler");
1183 XPDERR(
"problems configuring the network manager");
1189 XPDERR(
"problems configuring the priority manager");
1197 XPDERR(
"problems configuring the ROOT versions manager");
1204 XPDERR(
"problems configuring the client manager");
1210 XPDERR(
"problems configuring the session manager");
1216 XPDERR(
"problems configuring the scheduler");
1222 TRACE(ALL,
"file serving (protocol: 'root://') not available");
1229 (
void *)
this, 0,
"ProofdManager cron thread") != 0) {
1230 XPDERR(
"could not start cron thread");
1233 TRACE(ALL,
"manager cron thread started");
1247 XPDLOC(ALL,
"Manager::ValidateLocalDataSetSrc")
1249 TRACE(ALL,
"validating '" << url <<
"' ...");
1252 if (url.length() > 0) {
1254 if (url.beginswith(
"file:")) url.replace(
"file:",
"");
1255 if (url.beginswith(
"/")) {
1264 TRACE(XERR,
"Problems setting permissions 0777 on path '" << url <<
"'");
1267 TRACE(XERR,
"Cannot assert path '" << url <<
"' - ignoring");
1271 XrdOucString fnpath(url.c_str());
1272 fnpath +=
"/dataset.list";
1273 if (access(fnpath.c_str(), F_OK) != 0) {
1274 FILE *flst = fopen(fnpath.c_str(),
"w");
1276 TRACE(XERR,
"Cannot open file '" << fnpath <<
"' for the dataset list; errno: " << errno);
1279 if (fclose(flst) != 0)
1280 TRACE(XERR,
"Problems closing file '" << fnpath <<
"'; errno: " << errno);
1282 TRACE(XERR,
"Problems asserting ownership of " << fnpath);
1288 TRACE(XERR,
"Problems setting permissions to 0666 on file '" << fnpath <<
"'; errno: " << errno);
1293 fnpath.replace(
"/dataset.list",
"/lock.location");
1294 FILE *flck = fopen(fnpath.c_str(),
"a");
1296 TRACE(XERR,
"Cannot open file '" << fnpath <<
"' with the lock file path; errno: " << errno);
1299 off_t ofs = lseek(fileno(flck), 0, SEEK_CUR);
1302 XrdOucString fnlock(url);
1303 fnlock.replace(
"/",
"%");
1304 fnlock.replace(
":",
"%");
1305 fnlock.insert(
"/tmp/", 0);
1306 fprintf(flck,
"%s\n", fnlock.c_str());
1307 if (fclose(flck) != 0)
1308 TRACE(XERR,
"Problems closing file '" << fnpath <<
"'; errno: " << errno);
1311 TRACE(XERR,
"Problems asserting ownership of " << fnpath);
1313 }
else if (ofs == (off_t)(-1)) {
1314 TRACE(XERR,
"Problems getting current position on file '" << fnpath <<
"'; errno: " << errno);
1316 if (flck && fclose(flck) != 0)
1317 TRACE(XERR,
"Problems closing file '" << fnpath <<
"'; errno: " << errno);
1322 TRACE(XERR,
"Problems setting permissions to 0644 on file '" << fnpath <<
"'; errno: " << errno);
1328 TRACE(ALL,
"New dataset with no URL!");
1382 XPDLOC(ALL,
"Manager::ResolveKeywords")
1386 TRACE(HDBG,
"enter: " << s <<
" - WorkDir(): " <<
WorkDir());
1389 if (s.replace(
"<workdir>",
WorkDir()))
1392 TRACE(HDBG,
"after <workdir>: " << s);
1395 if (s.replace(
"<host>",
Host()))
1398 TRACE(HDBG,
"after <host>: " << s);
1401 if (s.find(
"<port>") != STR_NPOS) {
1404 if (s.replace(
"<port>", sport.c_str()))
1409 if (s.find(
"<effuser>") != STR_NPOS) {
1412 if (s.replace(
"<effuser>", eui.
fUser.c_str()))
1419 if (s.replace(
"<user>", pcl->
User()))
1424 if (s.replace(
"<group>", pcl->
Group()))
1429 if (s.replace(
"<homedir>", pcl->
UI().
fHomeDir.c_str()))
1433 if (pcl && (s.find(
"<uid>") != STR_NPOS)) {
1436 if (s.replace(
"<uid>", suid.c_str()))
1441 if (pcl && (s.find(
"<gid>") != STR_NPOS)) {
1444 if (s.replace(
"<gid>", sgid.c_str()))
1448 TRACE(HDBG,
"exit: " << s);
1461 char *val, XrdOucStream *cfg,
bool rcf)
1463 XPDLOC(ALL,
"Manager::DoDirective")
1469 if (
d->fName ==
"trace") {
1471 }
else if (
d->fName ==
"groupfile") {
1473 }
else if (
d->fName ==
"maxoldlogs") {
1475 }
else if (
d->fName ==
"allow") {
1477 }
else if (
d->fName ==
"allowedgroups") {
1479 }
else if (
d->fName ==
"allowedusers") {
1481 }
else if (
d->fName ==
"role") {
1483 }
else if (
d->fName ==
"multiuser") {
1485 }
else if (
d->fName ==
"port") {
1487 }
else if (
d->fName ==
"datadir") {
1489 }
else if (
d->fName ==
"datasetsrc") {
1491 }
else if (
d->fName ==
"rootd") {
1493 }
else if (
d->fName ==
"rootdallow") {
1495 }
else if (
d->fName ==
"xrd.protocol") {
1497 }
else if (
d->fName ==
"filterlibpaths") {
1499 }
else if (
d->fName ==
"xrootd") {
1502 TRACE(XERR,
"unknown directive: " <<
d->fName);
1511 XPDLOC(ALL,
"Manager::DoDirectiveTrace")
1548 while (val && val[0]) {
1550 if (val[0] ==
'-') {
1554 if (!strcmp(val,
"err")) {
1556 }
else if (!strcmp(val,
"req")) {
1558 }
else if (!strcmp(val,
"dbg")) {
1563 }
else if (!strcmp(val,
"login")) {
1565 }
else if (!strcmp(val,
"fork")) {
1567 }
else if (!strcmp(val,
"mem")) {
1569 }
else if (!strcmp(val,
"hdbg")) {
1575 }
else if (!strcmp(val,
"rsp")) {
1577 }
else if (!strcmp(val,
"aux")) {
1579 }
else if (!strcmp(val,
"cmgr")) {
1581 }
else if (!strcmp(val,
"smgr")) {
1583 }
else if (!strcmp(val,
"nmgr")) {
1585 }
else if (!strcmp(val,
"pmgr")) {
1587 }
else if (!strcmp(val,
"gmgr")) {
1589 }
else if (!strcmp(val,
"sched")) {
1591 }
else if (!strcmp(val,
"all") || !strcmp(val,
"dump")) {
1593 TRACE(ALL,
"Setting trace: " <<
on);
1598 val = cfg->GetWord();
1609 XPDLOC(ALL,
"Manager::DoDirectiveGroupfile")
1624 TRACE(XERR,
"groups manager already initialized: ignoring ");
1647 int maxoldlogs = strtol(val, 0, 10);
1689 XrdOucString s = val;
1691 XrdOucString grp, gid;
1693 while ((from = s.tokenize(grp, from,
',')) != STR_NPOS) {
1695 if (grp.beginswith(
'-')) {
1697 grp.erasefromstart(1);
1702 gid.form(
"%d", (
int) gi.
fGid);
1731 XrdOucString s = val;
1735 while ((from = s.tokenize(usr, from,
',')) != STR_NPOS) {
1737 if (usr.beginswith(
'-')) {
1739 usr.erasefromstart(1);
1765 XrdOucString tval(val);
1766 if (tval ==
"supermaster") {
1769 }
else if (tval ==
"master") {
1771 }
else if (tval ==
"submaster") {
1773 }
else if (tval ==
"worker") {
1775 }
else if (tval ==
"any") {
1791 XrdOucString port(val);
1792 if (port.beginswith(
"xproofd:")) {
1793 port.replace(
"xproofd:",
"");
1795 if (port.length() > 0 && port.isdigit()) {
1796 fPort = strtol(port.c_str(), 0, 10);
1808 XPDLOC(ALL,
"Manager::DoDirectiveMultiUser")
1815 int mu = strtol(val, 0, 10);
1819 val = cfg->GetWord();
1837 XrdOucString
type(val), url, opts, obscure;
1838 bool rw = 0, local = 0, goodsrc = 1;
1840 while ((nxt = cfg->GetWord())) {
1841 if (!strcmp(nxt,
"rw=1") || !strcmp(nxt,
"rw:1")) {
1843 }
else if (!strncmp(nxt,
"url:", 4)) {
1847 }
else if (!strncmp(nxt,
"opt:", 4)) {
1858 std::list<XrdProofdDSInfo *>::iterator ii =
fDataSetSrcs.begin();
1861 if ((*ii)->fLocal) {
1867 if (opts.length() <= 0) {
1868 opts = rw ?
"Ar:Av:" :
"-Ar:-Av:";
1871 local, rw, opts.c_str(), obscure.c_str());
1872 if (haslocal || !local) {
1896 while ((nxt = cfg->GetWord()) && (opts.length() == 0)) {
1902 if ((
iq =
fDataDir.rfind(
'?')) != STR_NPOS) {
1917 XPDLOC(ALL,
"Manager::DoDirectiveXrootd")
1922 TRACE(ALL,
"val: "<< val);
1924 if (XrdMajorVNUM(XrdVNUMBER) < 4) {
1925 TRACE(ALL,
"WARNING: built against an XRootD version without libXrdXrootd.so :");
1926 TRACE(ALL,
"WARNING: loading external " << val <<
" may lead to incompatibilities");
1942 XPDLOC(ALL,
"Manager::DoDirectiveRootd")
1944 TRACE(ALL,
"unsupported!!! ");
1957 XPDLOC(ALL,
"Manager::DoDirectiveRootdAllow")
1959 TRACE(ALL,
"unsupported!!! ");
1971 XPDLOC(ALL,
"Manager::DoDirectiveRemoveLibPaths")
1980 TRACE(ALL,
"val: "<< val);
1989 while ((nxt = cfg->GetWord())) {
1990 XrdOucString pps(nxt),
p;
1992 while ((from = pps.tokenize(
p, from,
',')) != -1) {
1993 if (
p.length() > 0) {
2009 XPDLOC(ALL,
"Manager::Process")
2014 TRACEP(
p, REQ,
"req id: " <<
p->Request()->header.requestid <<
" (" <<
2019 switch (
p->Request()->header.requestid) {
2025 TRACEP(
p, XERR,
"invalid request: " <<
p->Request()->header.requestid);
2026 response->Send(kXR_InvalidRequest,
"Invalid request; user not logged in");
2027 return p->Link()->setEtext(
"protocol sequence error 1");
2033 switch (
p->Request()->header.requestid) {
2035 int type = ntohl(
p->Request()->proof.int1);
2046 emsg +=
"Invalid request: ";
2047 emsg +=
p->Request()->header.requestid;
2052 response->Send(kXR_InvalidRequest, emsg.c_str());
#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 on
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
#define kXPD_OpModeControlled
const char *const XPD_GW_QueryEnqueued
XrdProofSched *(* XrdProofSchedLoader_t)(const char *, XrdProofdManager *, XrdProofGroupMgr *, const char *, XrdOucError *)
int DoDirectiveString(XrdProofdDirective *, char *val, XrdOucStream *cfg, bool rcf)
Process directive for a string.
int DoDirectiveClass(XrdProofdDirective *, char *val, XrdOucStream *cfg, bool rcf)
Generic class directive processor.
int DoDirectiveInt(XrdProofdDirective *, char *val, XrdOucStream *cfg, bool rcf)
Process directive for an integer.
#define XpdBadPGuard(g, u)
static int RemoveInvalidUsers(const char *k, int *, void *s)
Add the key value in the string passed via the void argument.
void * XrdProofdManagerCron(void *p)
This is an endless loop to periodically check the system.
static int FillKeyValues(const char *k, int *d, void *s)
Add the key value in the string passed via the void argument.
XrdProtocol *(* XrdProtocolLoader_t)(const char *, char *, XrdProtocol_Config *)
#define XPD_SETRESP(p, x)
#define TRACEP(p, act, x)
#define TRACESET(act, on)
R__EXTERN XrdOucTrace * XrdProofdTrace
#define XrdSysMutexHelper
void Print(const char *grp)
Return a string describing the group.
int Config(const char *fn)
(Re-)configure the group info using the file 'fn'.
const char * GetCfgFile() const
virtual int GetWorkers(XrdProofdProofServ *xps, std::list< XrdProofWorker * > *, const char *)
Get a list of workers that can be used by session 'xps'.
virtual int Config(bool rcf=0)
Configure this instance using the content of file 'cfn'.
const char * Name() const
const char * Export(const char *ord=0)
Export current content in a form understood by parsing algorithms inside the PROOF session,...
int Config(bool rcf=0)
Run configuration and parse the entered config directives.
int Process(XrdProofdProtocol *p, int type)
Process admin request.
static int ChangeOwn(const char *path, XrdProofUI ui)
Change the ownership of 'path' to the entity described by 'ui'.
static int GetUserInfo(const char *usr, XrdProofUI &ui)
Get information about user 'usr' in a thread safe way.
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 const char * ProofRequestTypes(int type)
Translates the proof request type in a human readable string.
static int GetGroupInfo(const char *grp, XrdProofGI &gi)
Get information about group with 'gid' in a thread safe way.
static int ChangeMod(const char *path, unsigned int mode)
Change the permission mode of 'path' to 'mode'.
static int CheckIf(XrdOucStream *s, const char *h)
Check existence and match condition of an 'if' directive If none (valid) is found,...
static char * Expand(char *p)
Expand path 'p' relative to: $HOME if begins with ~/ <user>'s $HOME if begins with ~<user>/ $PWD if d...
int Auth(XrdProofdProtocol *xp)
Analyse client authentication info.
int Config(bool rcf=0)
Run configuration and parse the entered config directives.
int Login(XrdProofdProtocol *xp)
Process a login request.
const char * Group() const
const char * User() const
virtual int Config(bool rcf=0)
void Register(const char *dname, XrdProofdDirective *d)
const char * CfgFile() const
int DoDirectiveRootd(char *, XrdOucStream *, bool)
Process 'rootd' directive xpd.rootd deny|allow [rootsys:<tag>] [path:abs-path/] [mode:ro|rw] [auth:no...
int GetWorkers(XrdOucString &workers, XrdProofdProofServ *, const char *)
Get a list of workers from the available resource broker.
XrdProofdPriorityMgr * fPriorityMgr
int DoDirectiveRole(char *, XrdOucStream *, bool)
Process 'role' directive.
int DoDirectiveDataSetSrc(char *, XrdOucStream *, bool)
Process 'datasetsrc' directive.
XrdProofdProofServMgr * fSessionMgr
XrdOucString fStageReqRepo
int DoDirective(XrdProofdDirective *d, char *val, XrdOucStream *cfg, bool rcf)
Update the priorities of the active sessions.
XrdOucString fSockPathDir
int Process(XrdProofdProtocol *p)
Process manager request.
XrdProofSched * LoadScheduler()
Load PROOF scheduler.
virtual ~XrdProofdManager()
Destructor.
XrdProofGroupMgr * GroupsMgr() const
XrdOucString fDataDirUrlOpts
int DoDirectiveMaxOldLogs(char *, XrdOucStream *, bool)
Process 'maxoldlogs' directive.
int DoDirectiveAllowedGroups(char *, XrdOucStream *, bool)
Process 'allowedgroups' directive.
int DoDirectiveMultiUser(char *, XrdOucStream *, bool)
Process 'multiuser' directive.
XrdProofGroupMgr * fGroupsMgr
XrdOucString fEffectiveUser
const char * Host() const
int DoDirectiveFilterLibPaths(char *, XrdOucStream *, bool)
Process 'filterlibpaths' directive xpd.filterlibpaths 1|0 [path1,path2 path3 path4 ....
int DoDirectivePort(char *, XrdOucStream *, bool)
Process 'xrd.protocol' directive to find the port.
XrdOucHash< int > fAllowedGroups
XrdProofdNetMgr * fNetMgr
int DoDirectiveDataDir(char *, XrdOucStream *, bool)
Process 'datadir' directive.
void CheckLogFileOwnership()
Make sure that the log file belongs to the original effective user.
XrdSysPlugin * fXrootdPlugin
int DoDirectiveRootdAllow(char *, XrdOucStream *, bool)
Process 'rootdallow' directive xpd.rootdallow host1,host2 host3 Host names may contain the wild card ...
XrdOucHash< int > fAllowedUsers
bool CheckMaster(const char *m)
Check if master 'm' is allowed to connect to this host.
void RegisterDirectives()
Register directives for configuration.
XrdOucHash< XrdOucString > fLibPathsToRemove
XrdProtocol * LoadXrootd(char *parms, XrdProtocol_Config *pi, XrdSysError *edest)
Load the Xrootd protocol, if required.
XrdProofdManager(char *parms, XrdProtocol_Config *pi, XrdSysError *edest)
Constructor.
XrdOucString fBareLibPath
int DoDirectiveGroupfile(char *, XrdOucStream *, bool)
Process 'groupfile' directive.
int DoDirectiveTrace(char *, XrdOucStream *, bool)
Scan the config file for tracing settings.
std::list< XrdProofdDSInfo * > fDataSetSrcs
int DoDirectiveAllowedUsers(char *, XrdOucStream *, bool)
Process 'allowedusers' directive.
std::list< XrdOucString * > fMastersAllowed
const char * WorkDir() const
int CheckUser(const char *usr, const char *grp, XrdProofUI &ui, XrdOucString &e, bool &su)
Check if the user is allowed to use the system Return 0 if OK, -1 if not.
XrdOucString fDataDirOpts
XrdProofdProofServMgr * SessionMgr() const
bool ValidateLocalDataSetSrc(XrdOucString &url, bool &local)
Validate local dataset src at URL (check the URL and make the relevant directories).
int Config(bool rcf=0)
Run configuration and parse the entered config directives.
XrdProofSched * fProofSched
XrdOucString fXrootdLibPath
int DoDirectiveXrootd(char *, XrdOucStream *, bool)
Process 'xrootd' directive xpd.xrootd [path/]libXrdXrootd.so.
XrdProofdClientMgr * fClientMgr
int DoDirectiveAllow(char *, XrdOucStream *, bool)
Process 'allow' directive.
int ResolveKeywords(XrdOucString &s, XrdProofdClient *pcl)
Resolve special keywords in 's' for client 'pcl'.
bool WorkerUsrCfg() const
int Config(bool rcf=0)
Run configuration and parse the entered config directives.
int ReadBuffer(XrdProofdProtocol *p)
Process a readbuf request.
int Config(bool rcf=0)
Run configuration and parse the entered config directives.
int Process(XrdProofdProtocol *p)
Process manager request.
int Config(bool rcf=0)
Run configuration and parse the entered config directives.
void AddWorker(const char *o, XrdProofWorker *w)
Add a worker assigned to this session with label 'o'.
void ExportWorkers(XrdOucString &wrks)
Export the assigned workers in the format understood by proofserv.
static int EUidAtStartup()
static void SetWorkdir(const char *wdir)
static void SetMaxOldSessions(int mxses)
int Config(bool rcf=0)
Run configuration and parse the entered config directives.
void SetLogDir(const char *d)
Set the log dir.
kXR_int16 SrvProtVers() const