XrdProofdAdmin.h

Go to the documentation of this file.
00001 // @(#)root/proofd:$Id: XrdProofdAdmin.h 29579 2009-07-25 12:19:25Z ganis $
00002 // Author: G. Ganis Feb 2008
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2005, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #ifndef ROOT_XrdProofdAdmin
00013 #define ROOT_XrdProofdAdmin
00014 
00015 //////////////////////////////////////////////////////////////////////////
00016 //                                                                      //
00017 // XrdProofdAdmin                                                       //
00018 //                                                                      //
00019 // Author: G. Ganis, CERN, 2008                                         //
00020 //                                                                      //
00021 // Envelop class for admin services.                                    //
00022 // Loaded as service by XrdProofdManager.                               //
00023 //                                                                      //
00024 //////////////////////////////////////////////////////////////////////////
00025 #include <sys/types.h>
00026 #include <sys/stat.h>
00027 #include <unistd.h>
00028 
00029 #include <list>
00030 #include "XrdOuc/XrdOucHash.hh"
00031 #include "XrdOuc/XrdOucString.hh"
00032 
00033 #include "XrdProofdConfig.h"
00034 
00035 class XrdProtocol_Config;
00036 class XrdSysError;
00037 class XrdProofdManager;
00038 class XrdProofdProtocol;
00039 class XrdProofdResponse;
00040 class XpdAdminCpCmd {
00041 public:
00042    XrdOucString  fCmd;
00043    XrdOucString  fFmt;
00044    bool          fCanPut;
00045    XpdAdminCpCmd(const char *cmd, const char *fmt, bool put) :
00046                                   fCmd(cmd), fFmt(fmt), fCanPut(put) { }
00047 };
00048 
00049 class XrdProofdAdmin : public XrdProofdConfig {
00050 
00051    XrdProofdManager *fMgr;
00052    std::list<XrdOucString> fExportPaths;
00053    XrdOucHash<XpdAdminCpCmd> fAllowedCpCmds; // List of copy commands
00054    XrdOucString      fCpCmds; // String with the allowed copy commands
00055 
00056    void              RegisterDirectives();
00057    int               DoDirectiveExportPath(char *, XrdOucStream *, bool);
00058    int               DoDirectiveCpCmd(char *, XrdOucStream *, bool);
00059 
00060    int               CheckForbiddenChars(const char *s);
00061    int               CheckPath(bool superuser, const char *sbdir, XrdOucString &fullpath,
00062                                int check, bool &sandbox, struct stat *st, XrdOucString &emsg);
00063    int               ExecCmd(XrdProofdProtocol *p, XrdProofdResponse *r,
00064                              int action, const char *cmd, XrdOucString &emsg);
00065    int               Send(XrdProofdResponse *r, const char *msg);
00066 
00067 public:
00068    XrdProofdAdmin(XrdProofdManager *mgr, XrdProtocol_Config *pi, XrdSysError *e);
00069    virtual ~XrdProofdAdmin() { }
00070 
00071    int               Config(bool rcf = 0);
00072    int               DoDirective(XrdProofdDirective *d,
00073                                  char *val, XrdOucStream *cfg, bool rcf);
00074 
00075    int               Process(XrdProofdProtocol *p, int type);
00076 
00077    int               QuerySessions(XrdProofdProtocol *p);
00078    int               QueryLogPaths(XrdProofdProtocol *p);
00079    int               CleanupSessions(XrdProofdProtocol *p);
00080    int               SendMsgToUser(XrdProofdProtocol *p);
00081    int               SetGroupProperties(XrdProofdProtocol *p);
00082    int               GetWorkers(XrdProofdProtocol *p);
00083    int               QueryWorkers(XrdProofdProtocol *p);
00084    int               QueryROOTVersions(XrdProofdProtocol *p);
00085    int               SetROOTVersion(XrdProofdProtocol *p);
00086    int               SetSessionAlias(XrdProofdProtocol *p);
00087    int               SetSessionTag(XrdProofdProtocol *p);
00088    int               ReleaseWorker(XrdProofdProtocol *p);
00089    int               Exec(XrdProofdProtocol *p);
00090    int               GetFile(XrdProofdProtocol *p);
00091    int               PutFile(XrdProofdProtocol *p);
00092    int               CpFile(XrdProofdProtocol *p);
00093 };
00094 
00095 #endif

Generated on Tue Jul 5 14:51:44 2011 for ROOT_528-00b_version by  doxygen 1.5.1