xrootd
XrdOfsSecurity.hh
Go to the documentation of this file.
1 #ifndef ___XrdOfsSECURITY_H___
2 #define ___XrdOfsSECURITY_H___
3 /******************************************************************************/
4 /* */
5 /* X r d O f s S e c u r i t y . h h */
6 /* */
7 /* (C) 2003 by the Board of Trustees of the Leland Stanford, Jr., University */
8 /* All Rights Reserved */
9 /* Produced by Andrew Hanushevsky for Stanford University under contract */
10 /* DE-AC03-76-SFO0515 with the Deprtment of Energy */
11 /******************************************************************************/
12 
13 // $Id$
14 
16 
17 #define AUTHORIZE(usr, env, optype, action, pathp, edata) \
18  if (usr && XrdOfsFS->Authorization \
19  && !XrdOfsFS->Authorization->Access(usr, pathp, optype, env)) \
20  {XrdOfsFS->Emsg(epname, edata, EACCES, action, pathp); return SFS_ERROR;}
21 
22 #define AUTHORIZE2(usr,edata,opt1,act1,path1,env1,opt2,act2,path2,env2) \
23  {AUTHORIZE(usr, env1, opt1, act1, path1, edata); \
24  AUTHORIZE(usr, env2, opt2, act2, path2, edata); \
25  }
26 
27 #define OOIDENTENV(usr, env) \
28  if (usr) {if (usr->name) env.Put(SEC_USER, usr->name); \
29  if (usr->host) env.Put(SEC_HOST, usr->host);}
30 #endif