Skip to content

Commit

Permalink
[Server] Allow TPC for objects identified by an ID.
Browse files Browse the repository at this point in the history
  • Loading branch information
abh3 committed Dec 4, 2018
1 parent a24929d commit 3f64af8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
4 changes: 3 additions & 1 deletion src/XrdOfs/XrdOfsConfig.cc
Expand Up @@ -1313,7 +1313,7 @@ int XrdOfs::xrole(XrdOucStream &Config, XrdSysError &Eroute)
[echo] [scan {stderr | stdout}]
[autorm] [pgm <path> [parms]]
[fcreds [?]<auth> =<evar>]
[fcpath <path>]
[fcpath <path>] [oids]
parms: [dn <name>] [group <grp>] [host <hn>] [vo <vo>]
Expand Down Expand Up @@ -1346,6 +1346,7 @@ int XrdOfs::xrole(XrdOucStream &Config, XrdSysError &Eroute)
=<evar> the name of the envar to be set with the path to the
credentials to be forwarded.
fcpath where creds are stored (default <adminpath>/.ofs/.tpccreds).
oids Object ID's are acceptable for the source lfn.
Output: 0 upon success or !0 upon failure.
*/
Expand Down Expand Up @@ -1380,6 +1381,7 @@ int XrdOfs::xtpc(XrdOucStream &Config, XrdSysError &Eroute)
if (!strcmp(val, "echo")) {Parms.xEcho = 1; continue;}
if (!strcmp(val, "logok")) {Parms.Logok = 1; continue;}
if (!strcmp(val, "autorm")){Parms.autoRM = 1; continue;}
if (!strcmp(val, "oids")) {Parms.oidsOK = 1; continue;}
if (!strcmp(val, "pgm"))
{if (!Config.GetRest(pgm, sizeof(pgm)))
{Eroute.Emsg("Config", "tpc command line too long"); return 1;}
Expand Down
5 changes: 4 additions & 1 deletion src/XrdOfs/XrdOfsTPC.cc
Expand Up @@ -86,6 +86,7 @@ int errMon =-3;
int fcNum = 0;
bool doEcho = false;
bool autoRM = false;
bool noids = true;
}

using namespace XrdOfsTPCParms;
Expand Down Expand Up @@ -452,6 +453,7 @@ void XrdOfsTPC::Init(XrdOfsTPC::iParm &Parms)
if (Parms.Grab < 0) errMon = Parms.Grab;
if (Parms.xEcho >= 0) doEcho = Parms.xEcho != 0;
if (Parms.autoRM >= 0) autoRM = Parms.autoRM != 0;
noids = Parms.oidsOK == 0;

// Record all delegated auths
//
Expand Down Expand Up @@ -615,7 +617,8 @@ int XrdOfsTPC::Validate(XrdOfsTPC **theTPC, XrdOfsTPC::Facts &Args)
// If the lfn, if present, it must be absolute.
//
if (!tpcLfn) tpcLfn = Args.Lfn;
else if (*tpcLfn != '/') return Death(Args,"source lfn not absolute",EINVAL);
else if (noids && *tpcLfn != '/')
return Death(Args,"source lfn not absolute",EINVAL);
else doRN = (strcmp(Args.Lfn, tpcLfn) != 0);

// Validate number of streams and adjust accordingly
Expand Down
9 changes: 5 additions & 4 deletions src/XrdOfs/XrdOfsTPC.hh
Expand Up @@ -88,13 +88,14 @@ struct iParm {char *Pgm;
int Strm;
int SMax;
int Xmax;
int Grab;
int xEcho;
int autoRM;
char Grab;
char xEcho;
char autoRM;
char oidsOK;
iParm() : Pgm(0), Ckst(0), cpath(0), fCreds(0),
Dflttl(-1), Maxttl(-1),
Logok(-1), Strm(-1), SMax(64), Xmax(-1), Grab(0),
xEcho(-1), autoRM(-1) {}
xEcho(-1), autoRM(-1), oidsOK(0) {}
};

static void Init(iParm &Parms);
Expand Down

0 comments on commit 3f64af8

Please sign in to comment.