xrootd
|
00001 #ifndef ___XrdOfsSECURITY_H___ 00002 #define ___XrdOfsSECURITY_H___ 00003 /******************************************************************************/ 00004 /* */ 00005 /* X r d O f s S e c u r i t y . h h */ 00006 /* */ 00007 /* (C) 2003 by the Board of Trustees of the Leland Stanford, Jr., University */ 00008 /* All Rights Reserved */ 00009 /* Produced by Andrew Hanushevsky for Stanford University under contract */ 00010 /* DE-AC03-76-SFO0515 with the Deprtment of Energy */ 00011 /******************************************************************************/ 00012 00013 // $Id$ 00014 00015 #include "XrdAcc/XrdAccAuthorize.hh" 00016 00017 #define AUTHORIZE(usr, env, optype, action, pathp, edata) \ 00018 if (usr && XrdOfsFS.Authorization \ 00019 && !XrdOfsFS.Authorization->Access(usr, pathp, optype, env)) \ 00020 {XrdOfsFS.Emsg(epname, edata, EACCES, action, pathp); return SFS_ERROR;} 00021 00022 #define AUTHORIZE2(usr,edata,opt1,act1,path1,env1,opt2,act2,path2,env2) \ 00023 {AUTHORIZE(usr, env1, opt1, act1, path1, edata); \ 00024 AUTHORIZE(usr, env2, opt2, act2, path2, edata); \ 00025 } 00026 00027 #define OOIDENTENV(usr, env) \ 00028 if (usr) {if (usr->name) env.Put(SEC_USER, usr->name); \ 00029 if (usr->host) env.Put(SEC_HOST, usr->host);} 00030 #endif