88 if (!fabP)
return false;
105 bool GetFAVal(
XrdSfsFACtl &faCtl,
char *&bP,
int &bL,
unsigned int k)
142 bool GulpFAVal(
XrdSfsFACtl &faCtl,
char *&bP,
int &bL,
unsigned int k)
150 if (!GetFAVal(faCtl, bzP, n, k))
160 if (n < faSize/2) n = faSize;
161 if (!GetFABuff(faCtl, n))
return false;
167 if (!GetFAVal(faCtl, bP, bL, k)) faCtl.
info[k].
faRC = ERANGE;
186 for (
unsigned int i = iX; i < faCtl.
iNum; i++) faCtl.
info[i].
faRC = ENOMEM;
201 char pfnbuff[MAXPATHLEN+8];
212 static const int faNum =
sizeof(faTab)/
sizeof(
struct faArgs);
221 if (!
envP || !usxMaxNsz)
237 if (faCtl.
rqst > faNum)
238 return Emsg(epname, einfo, EINVAL,
"process fattrs", faCtl.
path);
239 accType = faTab[faCtl.
rqst].name;
247 xOpts = (ossRPList ? ossRPList->
Find(faCtl.
path) : 0);
252 {
int luFlag = faTab[faCtl.
rqst].fArg;
262 return Emsg(epname, einfo, EROFS, accType, faCtl.
path);
269 {faCtl.
envP = &FAttr_Env;
271 if (rc)
return XrdOfsFS->
Emsg(epname, einfo, rc, accType, faCtl.path);
289 return ctlFADel(faCtl, FAttr_Env, einfo);
292 return ctlFAGet(faCtl, FAttr_Env, einfo);
295 return ctlFALst(faCtl, FAttr_Env, einfo);
298 return ctlFASet(faCtl, FAttr_Env, einfo);
317 for (
unsigned int i = 0; i < faCtl.
iNum; i++)
334 int bL, rc, pfLen, iX = 0, faSize = 0, fvSize = 0;
342 if (rc < 0)
return Emsg(epname, einfo, -rc,
"list fattrs", faCtl.
path);
348 pfLen = (*faCtl.
nPfx ?
sizeof(faCtl.
nPfx) : 0);
352 {
if (!pfLen || !strncmp(faCtl.
nPfx, aEnt->
Name, pfLen))
354 faSize += aEnt->
Nlen - pfLen + 1;
355 }
else aEnt->
Nlen = 0;
366 if (!GetFABuff(faCtl, faSize))
368 return Emsg(epname, einfo, ENOMEM,
"list fattrs", faCtl.
path);
382 {strcpy(nP, aEnt->
Name+pfLen);
388 fvSize += aEnt->
Vlen;
391 nP += aEnt->
Nlen-pfLen+1;
405 if (!GetFABuff(faCtl, fvSize))
407 return SetNoMem(faCtl, 0);
417 for (
unsigned int i = 0; i < faCtl.
iNum; i++)
422 if (!GetFAVal(faCtl, bP, bL, i) && !GulpFAVal(faCtl, bP, bL, i))
424 return SetNoMem(faCtl, i);
448 if (!GetFABuff(faCtl, faSize))
return SetNoMem(faCtl, 0);
458 for (
unsigned int i = 0; i < faCtl.
iNum; i++)
460 {
if (!GetFABuff(faCtl, faSize))
return SetNoMem(faCtl, i);
465 if (!GetFAVal(faCtl, bP, bL, i) && !GulpFAVal(faCtl, bP, bL, i))
466 return SetNoMem(faCtl, i);
482 if (!isNew) faMutex.Lock();
486 for (
unsigned int i = 0; i < faCtl.
iNum; i++)
490 faCtl.
pfnP, -1, isNew);
494 if (!isNew) faMutex.UnLock();
Access_Operation
The following are supported operations.
@ AOP_Update
open() r/w or append
@ AOP_Read
open() r/o, prepare()
#define AUTHORIZE(usr, env, optype, action, pathp, edata)
char data[4]
Start of data.
int dlen
Data Length in subsequent buffer.
virtual int Locate(XrdOucErrInfo &Resp, const char *path, int flags, XrdOucEnv *Info=0)=0
int FAttr(XrdSfsFACtl *faReq, XrdOucErrInfo &eInfo, const XrdSecEntity *client=0)
int fsctl(const int cmd, const char *args, XrdOucErrInfo &out_error, const XrdSecEntity *client=0)
static int Emsg(const char *, XrdOucErrInfo &, int, const char *x, XrdOfsHandle *hP)
static int fsError(XrdOucErrInfo &myError, int rc)
virtual int FSctl(int cmd, int alen, const char *args, char **resp=0)
virtual int Lfn2Pfn(const char *Path, char *buff, int blen)
void PutInt(const char *varname, long value)
int setErrInfo(int code, const char *emsg)
const char * getErrUser()
unsigned long long Find(const char *pathname)
char Name[1]
Start of the name (size of struct is dynamic)
int Vlen
The length of the attribute value;.
virtual int List(AList **aPL, const char *Path, int fd=-1, int getSz=0)=0
virtual int Get(const char *Aname, void *Aval, int Avsz, const char *Path, int fd=-1)=0
virtual int Set(const char *Aname, const void *Aval, int Avsz, const char *Path, int fd=-1, int isNew=0)=0
int Nlen
The length of the attribute name that follows.
virtual void Free(AList *aPL)=0
virtual int Del(const char *Aname, const char *Path, int fd=-1)=0
AList * Next
-> next element.
char nPfx[2]
The namespace being used.
XrdSfsFABuff * fabP
-> Additional memory that was allocated
static const int retval
Above plus return actual attr value.
const char * pfnP
The file path to act on (physical)
const char * path
The file path to act on (logical)
unsigned char rqst
Type of file attribute request (see below)
const char * pcgi
Opaque information (null if none)
static const int accChk
Perform access check.
static const int retvsz
Above plus return size of attr value.
static const int xplode
Construct an info vec from faList.
static const int newAtr
For set the attribute must not exist.
XrdOucEnv * envP
Optional environmental information.
XrdSfsFAInfo * info
Pointer to attribute information.
unsigned char opts
Request options (see below)
unsigned short iNum
Number of info entries.
char * Name
Variable name.
int VLen
Variable value length (aligned)
char * Value
Variable value.
short NLen
Length of name not including null byte.
int faRC
Action return code for this element.