root/root-xrootd.patch
Mattias Ellert 875cd941a6 Rebuild for xrootd 3.3
- Backport gfal fixes
2013-03-08 10:47:22 +01:00

809 lines
29 KiB
Diff

diff -Nur root-5.32.04.orig/cmake/modules/FindXROOTD.cmake root-5.32.04/cmake/modules/FindXROOTD.cmake
--- root-5.32.04.orig/cmake/modules/FindXROOTD.cmake 2012-07-13 15:54:18.000000000 +0200
+++ root-5.32.04/cmake/modules/FindXROOTD.cmake 2013-03-08 07:23:10.891952543 +0100
@@ -28,32 +28,37 @@
)
if (XROOTD_INCLUDE_DIR)
- file(STRINGS ${XROOTD_INCLUDE_DIR}/XrdVersion.hh xrdvers REGEX "^#define XrdVERSION")
+ file(STRINGS ${XROOTD_INCLUDE_DIR}/XrdVersion.hh xrdvers REGEX "^#define XrdVERSION ")
string(REGEX REPLACE "#define[ ]+XrdVERSION[ ]+" "" xrdvers ${xrdvers})
string(REGEX REPLACE "[^v\\.]+" "" xrdversdots ${xrdvers})
if (${xrdversdots} STREQUAL "v..")
# Regular version string; parse it out
string(REGEX MATCH "[0-9\\.]+" xrdvers ${xrdvers})
- string(REGEX MATCH "[0-9]" xrdversmajor ${xrdvers})
- string(REPLACE "${xrdversmajor}." "" xrdversminor ${xrdvers})
- string(REGEX MATCH "[0-9]" xrdversminor ${xrdversminor})
- string(REPLACE "${xrdversmajor}.${xrdversminor}." "" xrdverspatch ${xrdvers})
- string(REGEX MATCH "[0-9]+" xrdverspatch ${xrdverspatch})
+ string(REGEX REPLACE "^([^.]*)\\.(.*)\\.(.*)" "\\1" xrdversmajor ${xrdvers})
+ string(REGEX REPLACE "^([^.]*)\\.(.*)\\.(.*)" "\\2" xrdversminor ${xrdvers})
+ string(REGEX REPLACE "^([^.]*)\\.(.*)\\.(.*)" "\\3" xrdverspatch ${xrdvers})
math(EXPR xrdversnum ${xrdversmajor}*100000000+${xrdversminor}*10000+${xrdverspatch})
else ()
# Old version string: we keep only the first numerics, i.e. the date
string(REGEX REPLACE "[v\"]" "" xrdvers ${xrdvers})
- message(STATUS "Found Xrootd version ${xrdvers}")
- string(REGEX REPLACE "[^0-9-]+" " " xrdvers ${xrdvers})
string(SUBSTRING ${xrdvers} 0 8 xrdversnum)
endif ()
+ if ( ${xrdversnum} EQUAL 300030000 )
+ SET(XROOTD_FOUND FALSE)
+ message(WARNING " >>> Cannot build with XRootD version 3.3.0: please install >=3.3.1 or <= 3.2.x")
+ else()
+ SET(XROOTD_FOUND TRUE)
+ endif ()
+endif()
+
+if(XROOTD_FOUND)
# This we used as a compiler macro variable
if(NOT XROOTD_FIND_QUIETLY )
- message(STATUS "Found Xrootd version num: ${xrdvers}")
+ message(STATUS "Found Xrootd version num: ${xrdvers} (setting -DROOTXRDVERS=${xrdversnum})")
endif()
SET(XROOTD_CFLAGS "-DROOTXRDVERS=${xrdversnum}")
- if ( ${xrdversnum} LESS 300010000 )
+ if ( ${xrdversnum} LESS 300010000 AND ${xrdversnum} LESS 20111022)
SET(XROOTD_OLDPACK TRUE)
message(STATUS "Setting OLDPACK TRUE")
else()
@@ -72,14 +77,16 @@
XrdOuc/XrdOucPthread.hh
XrdOuc/XrdOucSemWait.hh
XrdOuc/XrdOucTimer.hh
+ PATHS
${XROOTD_INCLUDE_DIR}
)
else()
- if ( ${xrdversnum} LESS 300010000 )
+ if ( ${xrdversnum} LESS 300010000 AND ${xrdversnum} LESS 20111022)
# DNS stuff was under XrdNet
find_path(XROOTD_INCLUDE_DIR
NAMES
XrdNet/XrdNetDNS.hh
+ PATHS
${XROOTD_INCLUDE_DIR}
)
else ()
@@ -87,6 +94,7 @@
find_path(XROOTD_INCLUDE_DIR
NAMES
XrdSys/XrdSysDNS.hh
+ PATHS
${XROOTD_INCLUDE_DIR}
)
endif ()
@@ -101,9 +109,20 @@
XrdSys/XrdSysPthread.hh
XrdSys/XrdSysSemWait.hh
XrdSys/XrdSysTimer.hh
+ PATHS
${XROOTD_INCLUDE_DIR}
)
endif()
+
+ if (XROOTD_INCLUDE_DIR)
+ # Check for additional headers in new directories
+ find_path(XROOTD_PRIVATE_INCLUDE_DIR
+ NAMES
+ XrdSys/XrdSysPriv.hh
+ PATHS
+ ${XROOTD_INCLUDE_DIR}/private
+ )
+ endif()
endif()
if (XROOTD_INCLUDE_DIR)
SET(XROOTD_FOUND TRUE)
@@ -152,7 +171,7 @@
if(XROOTD_LIBRARIES)
set(XROOTD_FOUND TRUE)
if(NOT XROOTD_FIND_QUIETLY )
- message(STATUS " include_dir: ${XROOTD_INCLUDE_DIR}")
+ message(STATUS " include_dir: ${XROOTD_INCLUDE_DIR} ${XROOTD_PRIVATE_INCLUDE_DIR}")
message(STATUS " libraries: ${XROOTD_LIBRARIES}")
endif()
else ()
@@ -160,7 +179,8 @@
endif ()
endif()
-mark_as_advanced(XROOTD_INCLUDE_DIR
+mark_as_advanced(XROOTD_INCLUDE_DIR
+ XROOTD_PRIVATE_INCLUDE_DIR
XROOTD_XrdMain_LIBRARY
XROOTD_XrdUtils_LIBRARY
XROOTD_XrdClient_LIBRARY
diff -Nur root-5.32.04.orig/config/Makefile.in root-5.32.04/config/Makefile.in
--- root-5.32.04.orig/config/Makefile.in 2012-07-13 15:55:01.000000000 +0200
+++ root-5.32.04/config/Makefile.in 2013-03-08 07:23:10.901952610 +0100
@@ -251,6 +251,7 @@
EXTRA_XRDFLAGS := @extraxrdflags@
XRDVERSION := @xrdversion@
HASXRDUTILS := @hasxrdutils@
+XRDINCPRIVATE := @xrdincprivate@
SRPLIBDIR := @srplibdir@
SRPLIB := @srplib@
diff -Nur root-5.32.04.orig/configure root-5.32.04/configure
--- root-5.32.04.orig/configure 2012-07-13 15:55:07.000000000 +0200
+++ root-5.32.04/configure 2013-03-08 07:23:10.895952570 +0100
@@ -4473,9 +4473,16 @@
fi
fi
fi
- echo "$xrdver"
+ # Protect against 3.3.0, first version with 'include/xrootd/private'
+ if [ $decver -eq 300030000 ] ; then
+ echo "Cannot build against version $xrdver (missing headers)"
+ enable_xrootd="no"
+ else
+ echo "$xrdver"
+ fi
fi
+xrdincprivate="no"
if test "x$enable_xrootd" = "xyes" ; then
extraxrdflags="-DROOTXRDVERS=$decver"
@@ -4514,14 +4521,27 @@
done
#
+ # Check also if 'include/private' exists: we need to signal this to the build modules
+ # for correct location of some headers available form the dlevel packages for version >= 3.3.x
+ if test "x$enable_xrootd" = "xyes"; then
+ if test -d "$xrdincdir/private"; then
+ xrdincprivate="yes"
+ fi
+ fi
+
+ #
# Check if bonjour is available for code potentially using it ...
if test "x$enable_xrootd" = "xyes"; then
xrdlibdir="$tmpxrdlibdir"
if test "x$enable_bonjour" = "xyes"; then
- check_symbol XrdOucBonjour "$libxrdoucbjr" "$xrdlibdir"
- if test $found_symbol -eq 0 ; then
- bonjourcppflags=
- fi
+ # This check is broken. The xrootd libraries are C++ hence their
+ # symbol names are mangled. The check_symbol macro is designed
+ # to check for unmangled symbol names in C libraries.
+ # check_symbol XrdOucBonjour "$libxrdoucbjr" "$xrdlibdir"
+ # if test $found_symbol -eq 0 ; then
+ # bonjourcppflags=
+ # fi
+ bonjourcppflags=
fi
fi
fi
@@ -6667,6 +6687,7 @@
-e "s|@xpmlibdir@|$xpmlibdir|" \
-e "s|@xrdlibdir@|$xrdlibdir|" \
-e "s|@xrdincdir@|$xrdincdir|" \
+ -e "s|@xrdincprivate@|$xrdincprivate|" \
-e "s|@xrdversion@|$decver|" \
-e "s|@hasxrdutils@|$hasxrdutils|" \
-e "s|@cfitsioincdir@|$cfitsioincdir|" \
diff -Nur root-5.32.04.orig/net/netx/CMakeLists.txt root-5.32.04/net/netx/CMakeLists.txt
--- root-5.32.04.orig/net/netx/CMakeLists.txt 2012-07-13 15:54:54.000000000 +0200
+++ root-5.32.04/net/netx/CMakeLists.txt 2013-03-08 07:23:10.901952610 +0100
@@ -6,7 +6,7 @@
ROOT_USE_PACKAGE(net/net)
ROOT_USE_PACKAGE(proof/proofd)
-include_directories(${XROOTD_INCLUDE_DIR})
+include_directories(${XROOTD_INCLUDE_DIR} ${XROOTD_PRIVATE_INCLUDE_DIR})
add_definitions(${XROOTD_CFLAGS})
#---------------------------------------------------------------------------
diff -Nur root-5.32.04.orig/net/netx/Module.mk root-5.32.04/net/netx/Module.mk
--- root-5.32.04.orig/net/netx/Module.mk 2012-07-13 15:54:54.000000000 +0200
+++ root-5.32.04/net/netx/Module.mk 2013-03-08 07:23:10.900952603 +0100
@@ -55,6 +55,9 @@
ifneq ($(EXTRA_XRDFLAGS),)
NETXINCEXTRA += -I$(ROOT_SRCDIR)/proof/proofd/inc
endif
+ifeq ($(XRDINCPRIVATE),yes)
+NETXINCEXTRA += -I$(XRDINCDIR)/private
+endif
# Xrootd client libs
ifeq ($(PLATFORM),win32)
diff -Nur root-5.32.04.orig/net/netx/src/TXNetFile.cxx root-5.32.04/net/netx/src/TXNetFile.cxx
--- root-5.32.04.orig/net/netx/src/TXNetFile.cxx 2012-07-13 15:54:54.000000000 +0200
+++ root-5.32.04/net/netx/src/TXNetFile.cxx 2013-03-08 07:27:48.977933665 +0100
@@ -56,6 +56,7 @@
#include "TVirtualPerfStats.h"
#include <XrdClient/XrdClient.hh>
+#include <XrdClient/XrdClientConn.hh>
#include <XrdClient/XrdClientConst.hh>
#include <XrdClient/XrdClientEnv.hh>
#include <XProtocol/XProtocol.hh>
diff -Nur root-5.32.04.orig/proof/proofd/CMakeLists.txt root-5.32.04/proof/proofd/CMakeLists.txt
--- root-5.32.04.orig/proof/proofd/CMakeLists.txt 2012-07-13 15:54:19.000000000 +0200
+++ root-5.32.04/proof/proofd/CMakeLists.txt 2013-03-08 07:23:10.899952597 +0100
@@ -7,7 +7,7 @@
ROOT_USE_PACKAGE(net/rpdutils)
ROOT_USE_PACKAGE(net/auth)
-include_directories(${XROOTD_INCLUDE_DIR})
+include_directories(${XROOTD_INCLUDE_DIR} ${XROOTD_PRIVATE_INCLUDE_DIR})
add_definitions(${XROOTD_CFLAGS})
if(WIN32)
diff -Nur root-5.32.04.orig/proof/proofd/inc/XpdObject.h root-5.32.04/proof/proofd/inc/XpdObject.h
--- root-5.32.04.orig/proof/proofd/inc/XpdObject.h 1970-01-01 01:00:00.000000000 +0100
+++ root-5.32.04/proof/proofd/inc/XpdObject.h 2013-03-08 07:23:10.898952590 +0100
@@ -0,0 +1,100 @@
+// @(#)root/proofd:$Id$
+// Author: Gerardo Ganis Feb 2013
+
+/*************************************************************************
+ * Copyright (C) 1995-2005, Rene Brun and Fons Rademakers. *
+ * All rights reserved. *
+ * *
+ * For the licensing terms see $ROOTSYS/LICENSE. *
+ * For the list of contributors see $ROOTSYS/README/CREDITS. *
+ *************************************************************************/
+
+//////////////////////////////////////////////////////////////////////////
+// //
+// XpdObject //
+// //
+// Authors: G. Ganis, CERN, 2013 //
+// //
+// Auxilliary class to stack protocols. //
+// Adapted version of XrdObject. //
+// //
+//////////////////////////////////////////////////////////////////////////
+
+#ifndef ROOT_XpdObject
+#define ROOT_XpdObject
+
+#include <string.h>
+#include <strings.h>
+#include <time.h>
+#include <sys/types.h>
+#include "Xrd/XrdJob.hh"
+#include "XrdOuc/XrdOucTrace.hh"
+#include "XrdSys/XrdSysPthread.hh"
+
+class XpdObjectQ;
+class XrdProofdProtocol;
+class XrdScheduler;
+
+class XpdObject {
+public:
+ friend class XpdObjectQ;
+
+ // Item() supplies the item value associated with itself (used with Next()).
+ XrdProofdProtocol *objectItem() { return fItem; }
+
+ // Next() supplies the next list node.
+ XpdObject *nextObject() { return fNext; }
+
+ // Set the item pointer
+ void setItem(XrdProofdProtocol *ival) { fItem = ival; }
+
+ XpdObject(XrdProofdProtocol *ival=0) { fNext = 0; fItem = ival; fQTime = 0; }
+ ~XpdObject() {}
+
+private:
+ XpdObject *fNext;
+ XrdProofdProtocol *fItem;
+ time_t fQTime; // Only used for time-managed objects
+};
+
+/******************************************************************************/
+/* x r d _ O b j e c t Q */
+/******************************************************************************/
+
+// Note to properly cleanup this type of queue you must call Set() at least
+// once to cause the time element to be sceduled.
+
+class XrdOucTrace;
+
+class XpdObjectQ : public XrdJob {
+public:
+
+ XrdProofdProtocol *Pop();
+ void Push(XpdObject *Node);
+ void Set(int inQMax, time_t agemax=1800);
+ void Set(XrdScheduler *sp, XrdOucTrace *tp, int traceChk = 0)
+ {fSched = sp; fTrace = tp; fTraceON = traceChk;}
+ void DoIt();
+
+ XpdObjectQ(const char *id, const char *desc) : XrdJob(desc)
+ {fCurage = fCount = 0; fMaxage = 0; fTraceID = id;
+ fMaxinQ = 32; fMininQ = 16; fFirst = 0; }
+
+ ~XpdObjectQ() {}
+
+private:
+
+ XrdSysMutex fQMutex;
+ XpdObject *fFirst;
+ int fCount;
+ int fCurage;
+ int fMininQ;
+ int fMaxinQ;
+ time_t fMaxage;
+ XrdOucTrace *fTrace;
+ XrdScheduler *fSched;
+ int fTraceON;
+ const char *fTraceID;
+};
+
+#endif
diff -Nur root-5.32.04.orig/proof/proofd/inc/XrdProofdProofServMgr.h root-5.32.04/proof/proofd/inc/XrdProofdProofServMgr.h
--- root-5.32.04.orig/proof/proofd/inc/XrdProofdProofServMgr.h 2012-07-13 15:54:19.000000000 +0200
+++ root-5.32.04/proof/proofd/inc/XrdProofdProofServMgr.h 2013-03-08 07:21:22.170070457 +0100
@@ -41,6 +41,9 @@
#define PSMMAXCNTS 3
#define PSMCNTOK(t) (t >= 0 && t < PSMMAXCNTS)
+// Security handle
+typedef int (*XrdSecCredsSaver_t)(XrdSecCredentials *, const char *fn, const XrdProofUI &ui);
+
// Aux structure for session set env inputs
typedef struct {
XrdProofdProofServ *fPS;
@@ -158,6 +161,8 @@
std::list<XrdProofdProofServ *> fActiveSessions; // List of active sessions (non-idle)
std::list<XpdClientSessions *> *fRecoverClients; // List of client potentially recovering
+ XrdSecCredsSaver_t fCredsSaver; // If defined, function to be used to save the credentials
+
int DoDirectiveProofServMgr(char *, XrdOucStream *, bool);
int DoDirectivePutEnv(char *, XrdOucStream *, bool);
int DoDirectivePutRc(char *, XrdOucStream *, bool);
@@ -263,8 +268,6 @@
int SetProofServEnv(XrdProofdProtocol *p, void *in);
int SetProofServEnvOld(XrdProofdProtocol *p, void *in);
-
- int SaveAFSkey(XrdSecCredentials *c, const char *fn, XrdProofUI ui);
int SetUserEnvironment(XrdProofdProtocol *p);
static int SetProofServEnv(XrdProofdManager *m, XrdROOT *r);
diff -Nur root-5.32.04.orig/proof/proofd/inc/XrdProofdProtocol.h root-5.32.04/proof/proofd/inc/XrdProofdProtocol.h
--- root-5.32.04.orig/proof/proofd/inc/XrdProofdProtocol.h 2012-07-13 15:54:19.000000000 +0200
+++ root-5.32.04/proof/proofd/inc/XrdProofdProtocol.h 2013-03-08 07:23:10.898952590 +0100
@@ -37,10 +37,10 @@
#include "XpdSysPthread.h"
#include "Xrd/XrdLink.hh"
-#include "Xrd/XrdObject.hh"
#include "Xrd/XrdProtocol.hh"
#include "XrdOuc/XrdOucString.hh"
#include "XrdSec/XrdSecInterface.hh"
+#include "XpdObject.h"
#include "XProofProtocol.h"
class XrdBuffer;
@@ -130,7 +130,7 @@
//
// Protocol variables
- XrdObject<XrdProofdProtocol> fProtLink;
+ XpdObject fProtLink;
XrdBuffer *fArgp;
XrdLink *fLink;
@@ -175,7 +175,7 @@
//
static bool fgConfigDone;
static int fgCount;
- static XrdObjectQ<XrdProofdProtocol> fgProtStack;
+ static XpdObjectQ fgProtStack;
static XrdBuffManager *fgBPool; // Buffer manager
static int fgMaxBuffsz; // Maximum buffer size we can have
static XrdSysRecMutex fgBMutex; // Buffer management mutex
diff -Nur root-5.32.04.orig/proof/proofd/Module.mk root-5.32.04/proof/proofd/Module.mk
--- root-5.32.04.orig/proof/proofd/Module.mk 2012-07-13 15:54:19.000000000 +0200
+++ root-5.32.04/proof/proofd/Module.mk 2013-03-08 07:23:10.899952597 +0100
@@ -127,6 +127,10 @@
ifeq ($(HASXRD),yes)
XPDINCEXTRA := $(XROOTDDIRI:%=-I%)
XPDINCEXTRA += $(PROOFDDIRI:%=-I%)
+ifeq ($(XRDINCPRIVATE),yes)
+XPDINCEXTRA += -I$(XRDINCDIR)/private
+endif
+
ifeq ($(HASXRDUTILS),no)
diff -Nur root-5.32.04.orig/proof/proofd/src/XpdObject.cxx root-5.32.04/proof/proofd/src/XpdObject.cxx
--- root-5.32.04.orig/proof/proofd/src/XpdObject.cxx 1970-01-01 01:00:00.000000000 +0100
+++ root-5.32.04/proof/proofd/src/XpdObject.cxx 2013-03-08 07:23:10.896952577 +0100
@@ -0,0 +1,125 @@
+// @(#)root/proofd:$Id$
+// Author: Gerardo Ganis Feb 2013
+
+/*************************************************************************
+ * Copyright (C) 1995-2005, Rene Brun and Fons Rademakers. *
+ * All rights reserved. *
+ * *
+ * For the licensing terms see $ROOTSYS/LICENSE. *
+ * For the list of contributors see $ROOTSYS/README/CREDITS. *
+ *************************************************************************/
+
+//////////////////////////////////////////////////////////////////////////
+// //
+// XpdObject //
+// //
+// Authors: G. Ganis, CERN, 2013 //
+// //
+// Auxilliary class to stack protocols. //
+// //
+//////////////////////////////////////////////////////////////////////////
+
+#include "XpdObject.h"
+#include "XrdProofdAux.h"
+#include "XrdProofdProtocol.h"
+#include "Xrd/XrdScheduler.hh"
+#include "XrdOuc/XrdOucTrace.hh"
+
+//_______________________________________________________________________
+XrdProofdProtocol *XpdObjectQ::Pop()
+{
+ // Pop up a protocol object
+
+ XpdObject *node;
+ fQMutex.Lock();
+ if ((node = fFirst)) {
+ fFirst = fFirst->fNext;
+ fCount--;
+ }
+ fQMutex.UnLock();
+ if (node) return node->fItem;
+ return (XrdProofdProtocol *)0;
+}
+
+//_______________________________________________________________________
+void XpdObjectQ::Push(XpdObject *node)
+{
+ // Push back a protocol
+
+ node->fQTime = fCurage;
+ fQMutex.Lock();
+ if (fCount >= fMaxinQ) {
+ delete node->fItem;
+ } else {
+ node->fNext = fFirst;
+ fFirst = node;
+ fCount++;
+ }
+ fQMutex.UnLock();
+}
+
+//_______________________________________________________________________
+void XpdObjectQ::Set(int inQMax, time_t agemax)
+{
+ // Lock the data area and set the values
+
+ fQMutex.Lock();
+ fMaxinQ = inQMax; fMaxage = agemax;
+ if (!(fMininQ = inQMax/2)) fMininQ = 1;
+ fQMutex.UnLock();
+
+ // Schedule ourselves using the new values
+ if (agemax > 0)
+ fSched->Schedule((XrdJob *)this, agemax + time(0));
+}
+
+//_______________________________________________________________________
+void XpdObjectQ::DoIt()
+{
+ // Process method
+
+ XpdObject *pp, *p;
+ int oldcnt, agemax;
+
+ // Lock the anchor and see if we met the threshold for deletion
+ //
+ fQMutex.Lock();
+ agemax = fMaxage;
+ if ((oldcnt = fCount) > fMininQ) {
+
+ // Prepare to scan down the queue.
+ if ((pp = fFirst)) {
+ p = pp->fNext;
+ } else { p = 0; }
+
+ // Find the first object that's been idle for too long
+ while(p && (p->fQTime >= fCurage)) { pp = p; p = p->fNext;}
+
+ // Now delete half of the idle objects. The object queue element must be
+ // part of the actual object being deleted for this to properly work.
+ if (pp) {
+ while (p) {
+ pp->fNext = p->fNext;
+ delete p->fItem;
+ fCount--;
+ p = ((pp = pp->fNext) ? pp->fNext : 0);
+ }
+ }
+ }
+
+ // Increase the age and unlock the queue
+ fCurage++;
+ fQMutex.UnLock();
+
+ // Trace as needed
+ if (fTraceON && fTrace->Tracing(fTraceON))
+ {fTrace->Beg(fTraceID);
+ cerr <<Comment <<" trim done; " <<fCount <<" of " <<oldcnt <<" kept";
+ fTrace->End();
+ }
+
+ // Reschedule ourselves if we must do so
+ if (agemax > 0)
+ fSched->Schedule((XrdJob *)this, agemax+time(0));
+}
+
diff -Nur root-5.32.04.orig/proof/proofd/src/XrdProofConn.cxx root-5.32.04/proof/proofd/src/XrdProofConn.cxx
--- root-5.32.04.orig/proof/proofd/src/XrdProofConn.cxx 2012-07-13 15:54:19.000000000 +0200
+++ root-5.32.04/proof/proofd/src/XrdProofConn.cxx 2013-03-08 07:23:10.896952577 +0100
@@ -31,7 +31,6 @@
#include "XrdClient/XrdClientConnMgr.hh"
#include "XrdClient/XrdClientConst.hh"
-#include "XrdClient/XrdClientDebug.hh"
#include "XrdClient/XrdClientEnv.hh"
#include "XrdClient/XrdClientLogConnection.hh"
#include "XrdClient/XrdClientPhyConnection.hh"
@@ -40,6 +39,7 @@
#include "XrdOuc/XrdOucErrInfo.hh"
#include "XrdOuc/XrdOucString.hh"
#include "XrdSec/XrdSecInterface.hh"
+#include "XrdSys/XrdSysLogger.hh"
#include "XrdSys/XrdSysPlatform.hh"
// Dynamic libs
diff -Nur root-5.32.04.orig/proof/proofd/src/XrdProofdProofServMgr.cxx root-5.32.04/proof/proofd/src/XrdProofdProofServMgr.cxx
--- root-5.32.04.orig/proof/proofd/src/XrdProofdProofServMgr.cxx 2012-07-13 15:54:19.000000000 +0200
+++ root-5.32.04/proof/proofd/src/XrdProofdProofServMgr.cxx 2013-03-08 07:21:22.173070483 +0100
@@ -32,8 +32,7 @@
#include "XrdOuc/XrdOucRash.hh"
#include "XrdOuc/XrdOucStream.hh"
#include "XrdSys/XrdSysPriv.hh"
-#include "XrdSut/XrdSutAux.hh"
-
+#include "XrdSys/XrdSysPlugin.hh"
#include "XrdProofdClient.h"
#include "XrdProofdClientMgr.h"
#include "XrdProofdManager.h"
@@ -286,6 +285,8 @@
fCurrentSessions = 0;
fSeqSessionN = 0;
+
+ fCredsSaver = 0;
// Defaults can be changed via 'proofservmgr'
fCheckFrequency = 30;
@@ -3067,26 +3068,20 @@
putenv(ev);
TRACE(DBG, "XrdSecCREDS set");
- // If 'pwd', save AFS key, if any
- if (!strncmp(p->AuthProt()->Entity.prot, "pwd", 3)) {
+ if (fCredsSaver) {
XrdOucString credsdir = udir;
credsdir += "/.creds";
// Make sure the directory exists
if (!XrdProofdAux::AssertDir(credsdir.c_str(), p->Client()->UI(), fMgr->ChangeOwn())) {
- if (SaveAFSkey(creds, credsdir.c_str(), p->Client()->UI()) == 0) {
- ev = new char[strlen("ROOTPROOFAFSCREDS=")+credsdir.length()+strlen("/.afs")+2];
- sprintf(ev, "ROOTPROOFAFSCREDS=%s/.afs", credsdir.c_str());
- putenv(ev);
- fprintf(fenv, "ROOTPROOFAFSCREDS has been set\n");
- TRACE(DBG, ev);
- } else {
- TRACE(DBG, "problems in saving AFS key");
+ if ((*fCredsSaver)(creds, credsdir.c_str(), p->Client()->UI()) != 0) {
+ TRACE(DBG, "problems in saving authentication creds under "<<credsdir);
}
} else {
TRACE(XERR, "unable to create creds dir: "<<credsdir);
return -1;
}
}
+ fclose(fenv);
}
}
@@ -3532,26 +3527,20 @@
PutEnv(ev, in->fOld);
TRACE(DBG, "XrdSecCREDS set");
- // If 'pwd', save AFS key, if any
- if (!strncmp(p->AuthProt()->Entity.prot, "pwd", 3)) {
+ if (fCredsSaver) {
XrdOucString credsdir = p->Client()->Sandbox()->Dir();
credsdir += "/.creds";
// Make sure the directory exists
if (!XrdProofdAux::AssertDir(credsdir.c_str(), p->Client()->UI(), fMgr->ChangeOwn())) {
- if (SaveAFSkey(creds, credsdir.c_str(), p->Client()->UI()) == 0) {
- ev = new char[strlen("ROOTPROOFAFSCREDS=")+credsdir.length()+strlen("/.afs")+2];
- sprintf(ev, "ROOTPROOFAFSCREDS=%s/.afs", credsdir.c_str());
- fprintf(fenv, "ROOTPROOFAFSCREDS has been set\n");
- TRACE(DBG, ev);
- PutEnv(ev, in->fOld);
- } else {
- TRACE(DBG, "problems in saving AFS key");
+ if ((*fCredsSaver)(creds, credsdir.c_str(), p->Client()->UI()) != 0) {
+ TRACE(DBG, "problems in saving authentication creds under "<<credsdir);
}
} else {
TRACE(XERR, "unable to create creds dir: "<<credsdir);
return -1;
}
}
+ fclose(fenv);
}
}
@@ -4514,84 +4503,6 @@
return 0;
}
-//______________________________________________________________________________
-int XrdProofdProofServMgr::SaveAFSkey(XrdSecCredentials *c,
- const char *dir, XrdProofUI ui)
-{
- // Save the AFS key, if any, for usage in proofserv in file 'dir'/.afs .
- // Return 0 on success, -1 on error.
- XPDLOC(SMGR, "ProofServMgr::SaveAFSkey")
-
- // Check file name
- if (!dir || strlen(dir) <= 0) {
- TRACE(XERR, "dir name undefined");
- return -1;
- }
-
- // Check credentials
- if (!c) {
- TRACE(XERR, "credentials undefined");
- return -1;
- }
- TRACE(REQ, "dir: "<<dir);
-
- // Decode credentials
- int lout = 0;
- char *out = new char[c->size];
- if (XrdSutFromHex(c->buffer, out, lout) != 0) {
- TRACE(XERR, "problems unparsing hex string");
- delete [] out;
- return -1;
- }
-
- // Locate the key
- char *key = out + 5;
- if (strncmp(key, "afs:", 4)) {
- TRACE(DBG, "string does not contain an AFS key");
- delete [] out;
- return 0;
- }
- key += 4;
-
- // Save to file, if not existing already
- XrdOucString fn = dir;
- fn += "/.afs";
-
- int rc = 0;
- struct stat st;
- if (stat(fn.c_str(), &st) != 0 && errno == ENOENT) {
-
- // Open the file, truncating if already existing
- int fd = open(fn.c_str(), O_WRONLY | O_CREAT | O_TRUNC, 0600);
- if (fd <= 0) {
- TRACE(XERR, "problems creating file - errno: " << errno);
- delete [] out;
- return -1;
- }
- // Write out the key
- int lkey = lout - 9;
- if (XrdProofdAux::Write(fd, key, lkey) != lkey) {
- TRACE(XERR, "problems writing to file - errno: " << errno);
- rc = -1;
- }
-
- // Cleanup
- delete [] out;
- close(fd);
- } else {
- TRACE(XERR, "cannot stat existing file "<<fn<<" - errno: " << errno);
- delete [] out;
- return -1;
- }
-
- // Make sure the file is owned by the user
- if (XrdProofdAux::ChangeOwn(fn.c_str(), ui) != 0) {
- TRACE(XERR, "can't change ownership of "<<fn);
- }
-
- return rc;
-}
-
//__________________________________________________________________________
XrdProofdProofServ *XrdProofdProofServMgr::GetActiveSession(int pid)
{
diff -Nur root-5.32.04.orig/proof/proofd/src/XrdProofdProtocol.cxx root-5.32.04/proof/proofd/src/XrdProofdProtocol.cxx
--- root-5.32.04.orig/proof/proofd/src/XrdProofdProtocol.cxx 2012-07-13 15:54:19.000000000 +0200
+++ root-5.32.04/proof/proofd/src/XrdProofdProtocol.cxx 2013-03-08 07:23:10.897952583 +0100
@@ -29,6 +29,7 @@
#include "XrdVersion.hh"
#include "Xrd/XrdBuffer.hh"
+#include "Xrd/XrdScheduler.hh"
#include "XrdProofdClient.h"
#include "XrdProofdClientMgr.h"
@@ -54,8 +55,7 @@
//
// Static area: general protocol managing section
int XrdProofdProtocol::fgCount = 0;
-XrdObjectQ<XrdProofdProtocol>
- XrdProofdProtocol::fgProtStack("ProtStack",
+XpdObjectQ XrdProofdProtocol::fgProtStack("ProtStack",
"xproofd protocol anchor");
XrdSysRecMutex XrdProofdProtocol::fgBMutex; // Buffer management mutex
XrdBuffManager *XrdProofdProtocol::fgBPool = 0;
@@ -542,8 +542,12 @@
// Schedule protocol object cleanup; the maximum number of objects
// and the max age are taken from XrdXrootdProtocol: this may need
// some optimization in the future.
+#if 1
fgProtStack.Set(pi->Sched, XrdProofdTrace, TRACE_MEM);
fgProtStack.Set((pi->ConnMax/3 ? pi->ConnMax/3 : 30), 60*60);
+#else
+ fgProtStack.Set(pi->Sched, 3600);
+#endif
// Default tracing options: always trace logins and errors for all
// domains; if the '-d' option was specified on the command line then
@@ -790,6 +794,13 @@
// Push ourselves on the stack
fgProtStack.Push(&fProtLink);
+#if 0
+ if(fgProtStack.Push(&fProtLink) != 0) {
+ XrdProofdProtocol *xp = fProtLink.objectItem();
+ fProtLink.setItem(0);
+ delete xp;
+ }
+#endif
}
//______________________________________________________________________________
diff -Nur root-5.32.04.orig/proof/proofx/CMakeLists.txt root-5.32.04/proof/proofx/CMakeLists.txt
--- root-5.32.04.orig/proof/proofx/CMakeLists.txt 2012-07-13 15:54:19.000000000 +0200
+++ root-5.32.04/proof/proofx/CMakeLists.txt 2013-03-08 07:23:10.900952603 +0100
@@ -16,7 +16,7 @@
file(GLOB sources RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cxx)
endif()
-include_directories(${XROOTD_INCLUDE_DIR})
+include_directories(${XROOTD_INCLUDE_DIR} ${XROOTD_PRIVATE_INCLUDE_DIR})
link_directories(${XROOTD_LIBRARY_DIR})
add_definitions(${XROOTD_CFLAGS})
diff -Nur root-5.32.04.orig/proof/proofx/Module.mk root-5.32.04/proof/proofx/Module.mk
--- root-5.32.04.orig/proof/proofx/Module.mk 2012-07-13 15:54:19.000000000 +0200
+++ root-5.32.04/proof/proofx/Module.mk 2013-03-08 07:23:10.899952597 +0100
@@ -63,6 +63,9 @@
PROOFXINCEXTRA := $(PROOFXDIRI:%=-I%)
PROOFXINCEXTRA += $(XROOTDDIRI:%=-I%)
PROOFXINCEXTRA += $(PROOFDDIRI:%=-I%)
+ifeq ($(XRDINCPRIVATE),yes)
+PROOFXINCEXTRA += -I$(XRDINCDIR)/private
+endif
# Xrootd client libs
ifeq ($(PLATFORM),win32)