diff --git a/build/unix/makepchinput.py b/build/unix/makepchinput.py index f83c49e85449ebc54c8b159f07aefe9dbcfcc79a..de342b2fcb450b819971babb543a60763526c194 100755 --- a/build/unix/makepchinput.py +++ b/build/unix/makepchinput.py @@ -337,13 +337,6 @@ def getDefUndefLines(dirName): '#ifdef signals\n' +\ '# undef signals\n' +\ '#endif\n' - if "%snet%sldap" %(os.sep,os.sep) in dirName: - allHeadersPartContent += '#ifdef Debug\n' +\ - '# undef Debug\n' +\ - '#endif\n' +\ - '#ifdef GSL_SUCCESS\n' +\ - '# undef GSL_SUCCESS\n' +\ - '#endif\n' return allHeadersPartContent #------------------------------------------------------------------------------- diff --git a/cmake/modules/FindLdap.cmake b/cmake/modules/FindLdap.cmake deleted file mode 100644 index 33f610696b8c95c697e6a4fbda7e1faf9d251073..0000000000000000000000000000000000000000 --- a/cmake/modules/FindLdap.cmake +++ /dev/null @@ -1,24 +0,0 @@ -# - Try to find the LDAP client libraries -# Once done this will define -# -# LDAP_FOUND - system has libldap -# LDAP_INCLUDE_DIR - the ldap include directory -# LDAP_LIBRARY libldap library -# LBER_LIBRARY liblber library -# LDAP_LIBRARIES - libldap + liblber (if found) library - - -find_path(LDAP_INCLUDE_DIR NAMES ldap.h HINTS ${LDAP_DIR}/include $ENV{LDAP_DIR}/include) -find_library(LDAP_LIBRARY NAMES ldap HINTS ${LDAP_DIR}/lib $ENV{LDAP_DIR}/lib) -find_library(LBER_LIBRARY NAMES lber HINTS ${LDAP_DIR}/lib $ENV{LDAP_DIR}/lib) - -set(LDAP_INCLUDE_DIRS ${LDAP_INCLUDE_DIR}) -set(LDAP_LIBRARIES ${LDAP_LIBRARY} ${LBER_LIBRARY}) - -# handle the QUIETLY and REQUIRED arguments and set LDAP_FOUND to TRUE if -# all listed variables are TRUE -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(LDAP DEFAULT_MSG LDAP_INCLUDE_DIR LDAP_LIBRARY) - -mark_as_advanced(LDAP_FOUND LDAP_INCLUDE_DIR LDAP_LIBRARY LBER_LIBRARY) - diff --git a/cmake/modules/RootBuildOptions.cmake b/cmake/modules/RootBuildOptions.cmake index ff6ea44592bf53f65afe1e7a72568b70b572b1e5..9aaad977c745a75212f38c9462db41bf2049c590 100644 --- a/cmake/modules/RootBuildOptions.cmake +++ b/cmake/modules/RootBuildOptions.cmake @@ -120,7 +120,6 @@ ROOT_BUILD_OPTION(gsl_shared OFF "Enable linking against shared libraries for GS ROOT_BUILD_OPTION(http ON "Enable suppport for HTTP server") ROOT_BUILD_OPTION(imt ON "Enable support for implicit multi-threading via IntelĀ® Thread Bulding Blocks (TBB)") ROOT_BUILD_OPTION(jemalloc OFF "Use jemalloc memory allocator") -ROOT_BUILD_OPTION(ldap OFF "Enable support for LDAP (Lightweight Directory Access Protocol)") ROOT_BUILD_OPTION(libcxx OFF "Build using libc++") ROOT_BUILD_OPTION(macos_native OFF "Disable looking for libraries, includes and binaries in locations other than a native installation (MacOS only)") ROOT_BUILD_OPTION(mathmore ON "Build libMathMore extended math library (requires GSL)") @@ -213,7 +212,6 @@ if(all) set(gfal_defvalue ON) set(http_defvalue ON) set(imt_defvalue ON) - set(ldap_defvalue ON) set(mathmore_defvalue ON) set(memstat_defvalue ON) set(minuit2_defvalue ON) @@ -355,14 +353,14 @@ endif() #---Removed options------------------------------------------------------------ foreach(opt afdsmgrd afs bonjour castor chirp geocad glite globus gviz hdfs ios - krb5 qt qtgsi rfio ruby sapdb srp table) + krb5 ldap qt qtgsi rfio ruby sapdb srp table) if(${opt}) message(FATAL_ERROR ">>> Option '${opt}' has been removed in ROOT v6.16.") endif() endforeach() #---Deprecated options--------------------------------------------------------- -foreach(opt ldap memstat odbc) +foreach(opt memstat odbc) if(${opt}) message(DEPRECATION ">>> Option '${opt}' is deprecated and will be removed in ROOT v6.18. Please inform rootdev@cern.ch should you still need it.") endif() diff --git a/cmake/modules/RootConfiguration.cmake b/cmake/modules/RootConfiguration.cmake index d76245839c8c1dd4f9e4e9f84e58b207a1a098ff..ab6c794d8656e4d2f18e76123ff5d37975344d07 100644 --- a/cmake/modules/RootConfiguration.cmake +++ b/cmake/modules/RootConfiguration.cmake @@ -161,11 +161,6 @@ set(gl2pslibdir ${GL2PS_LIBRARY_DIR}) set(gl2pslib ${GL2PS_LIBRARY}) set(gl2psincdir ${GL2PS_INCLUDE_DIR}) -set(buildldap ${value${ldap}}) -set(ldaplibdir ${LDAP_LIBRARY_DIR}) -set(ldaplib ${LDAP_LIBRARY}) -set(ldapincdir ${LDAP_INCLUDE_DIR}) - set(buildmysql ${value${mysql}}) set(mysqllibdir ${MYSQL_LIBRARY_DIR}) set(mysqllib ${MYSQL_LIBRARY}) diff --git a/cmake/modules/SearchInstalledSoftware.cmake b/cmake/modules/SearchInstalledSoftware.cmake index 17b846e81be59687747a8319eb17c34b15a22c10..d3e864104efde4a774f56e4abe6d908c60d6872a 100644 --- a/cmake/modules/SearchInstalledSoftware.cmake +++ b/cmake/modules/SearchInstalledSoftware.cmake @@ -894,20 +894,6 @@ if(dcache) endif() endif() -#---Check for Ldap-------------------------------------------------------------------- -if(ldap) - find_package(Ldap) - if(NOT LDAP_FOUND) - if(fail-on-missing) - message(FATAL_ERROR "ldap library not found and is required (ldap option enabled)") - else() - message(STATUS "ldap library not found. Set variable LDAP_DIR to point to your ldap installation") - message(STATUS "For the time being switching OFF 'ldap' option") - set(ldap OFF CACHE BOOL "Disabled because ldap not found (${ldap_description})" FORCE) - endif() - endif() -endif() - #---Check for ftgl if needed---------------------------------------------------------- if(opengl AND NOT builtin_ftgl) find_package(FTGL) diff --git a/cmake/modules/SetUpMacOS.cmake b/cmake/modules/SetUpMacOS.cmake index 320df05c75be4b8b81f94b5f25b505b89ccf32ae..edecbdfd08bc0d6ec3206365c896eb821d5874f9 100644 --- a/cmake/modules/SetUpMacOS.cmake +++ b/cmake/modules/SetUpMacOS.cmake @@ -42,9 +42,6 @@ if (CMAKE_SYSTEM_NAME MATCHES Darwin) if(MACOSX_VERSION VERSION_GREATER 10.8) set(MACOSX_GLU_DEPRECATED ON) endif() - if(MACOSX_VERSION VERSION_GREATER 10.9) - set(MACOSX_LDAP_DEPRECATED ON) - endif() if (CMAKE_COMPILER_IS_GNUCXX) message(STATUS "Found GNU compiler collection") diff --git a/config/Makefile.in b/config/Makefile.in index 5d0a68a2a320e1df96be482e254d5be6f59cfa50..1afbdf22069e72d667126114d022f5cb656b6880 100644 --- a/config/Makefile.in +++ b/config/Makefile.in @@ -150,11 +150,6 @@ GL2PSLIBDIR := @gl2pslibdir@ GL2PSLIB := @gl2pslib@ GL2PSINCDIR := $(filter-out /usr/include, @gl2psincdir@) -BUILDLDAP := @buildldap@ -LDAPLIBDIR := @ldaplibdir@ -LDAPCLILIB := @ldaplib@ -LDAPINCDIR := $(filter-out /usr/include, @ldapincdir@) - BUILDMYSQL := @buildmysql@ MYSQLLIBDIR := @mysqllibdir@ MYSQLCLILIB := @mysqllib@ diff --git a/documentation/doxygen/Doxyfile b/documentation/doxygen/Doxyfile index d60cdc740af076ae8074c8f960bd6904754429fd..8d804a9992b0af3d8f155fe25ab8d9c5b9c2a03d 100644 --- a/documentation/doxygen/Doxyfile +++ b/documentation/doxygen/Doxyfile @@ -845,7 +845,6 @@ INPUT = . \ ../../net/auth/ \ ../../net/davix/ \ ../../net/http/ \ - ../../net/ldap/ \ ../../net/monalisa/ \ ../../net/net/ \ ../../net/netx/ \ diff --git a/net/CMakeLists.txt b/net/CMakeLists.txt index 742183c62d7002a87560ce989bef767c2c168e56..b72d4623ad6e8431cad6940a24222176472ae1ca 100644 --- a/net/CMakeLists.txt +++ b/net/CMakeLists.txt @@ -17,10 +17,6 @@ if(monalisa) add_subdirectory(monalisa) endif() -if(ldap) - add_subdirectory(ldap) -endif() - if(davix) add_subdirectory(davix) endif() diff --git a/net/ldap/CMakeLists.txt b/net/ldap/CMakeLists.txt deleted file mode 100644 index 08262cb1424741d4a67216111aba32d7c34946e4..0000000000000000000000000000000000000000 --- a/net/ldap/CMakeLists.txt +++ /dev/null @@ -1,29 +0,0 @@ -############################################################################ -# CMakeLists.txt file for building ROOT net/ldap package -############################################################################ - -include_directories(${LDAP_INCLUDE_DIRS}) -add_definitions(-DLDAP_DEPRECATED) - -if(MACOSX_LDAP_DEPRECATED) - add_definitions(-Wno-deprecated-declarations) -endif() - -ROOT_STANDARD_LIBRARY_PACKAGE(RLDAP - HEADERS - CintLDAP.h - TLDAPAttribute.h - TLDAPEntry.h - TLDAPResult.h - TLDAPServer.h - SOURCES - src/TLDAPAttribute.cxx - src/TLDAPEntry.cxx - src/TLDAPResult.cxx - src/TLDAPServer.cxx - LIBRARIES - ${LDAP_LIBRARIES} - DEPENDENCIES - Net - Core - ) diff --git a/net/ldap/inc/CintLDAP.h b/net/ldap/inc/CintLDAP.h deleted file mode 100644 index 6319b53a47d4c1f68b567c3c30217db0c0f8cea0..0000000000000000000000000000000000000000 --- a/net/ldap/inc/CintLDAP.h +++ /dev/null @@ -1,31 +0,0 @@ -// @(#)root/ldap:$Id$ -// Author: Oleksandr Grebenyuk 21/09/2001 - -/************************************************************************* - * For the licensing terms see $ROOTSYS/LICENSE. * - * For the list of contributors see $ROOTSYS/README/CREDITS. * - *************************************************************************/ - -#ifndef ROOT_CintLDAP -#define ROOT_CintLDAP - -#ifdef __CLING__ - -// Loaded inside Cling, we need to mitigate duplication -// ourselves. - -#include <ldap.h> - -#ifndef LBER_CLASS_UNIVERSAL -#include <lber.h> // needed for older versions of ldap.h -#endif - -#else -// Regular section, the user must make sure explicitly that the -// correct set of header is included (or not). -#include <lber.h> // needed for older versions of ldap.h -#include <ldap.h> - -#endif - -#endif // ROOT_CintLDAP diff --git a/net/ldap/inc/LinkDef.h b/net/ldap/inc/LinkDef.h deleted file mode 100644 index 86a0c30ef304a7acf565c747c33c42c235c52d63..0000000000000000000000000000000000000000 --- a/net/ldap/inc/LinkDef.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifdef __CINT__ - -#pragma link off all globals; -#pragma link off all classes; -#pragma link off all functions; - -#pragma link C++ class TLDAPServer; -#pragma link C++ class TLDAPResult; -#pragma link C++ class TLDAPEntry; -#pragma link C++ class TLDAPAttribute; - -// These constants are preprocessor statements -// in ldap.h and not variables -// #pragma link C++ global LDAP_PORT; -// #pragma link C++ global LDAP_SCOPE_DEFAULT; -// #pragma link C++ global LDAP_SCOPE_BASE; -// #pragma link C++ global LDAP_SCOPE_ONELEVEL; -// #pragma link C++ global LDAP_SCOPE_SUBTREE; -// #pragma link C++ global LDAP_MOD_ADD; -// #pragma link C++ global LDAP_MOD_DELETE; -// #pragma link C++ global LDAP_MOD_REPLACE; -// #pragma link C++ global LDAP_MOD_BVALUES; -// #pragma link C++ global LDAP_SERVER_DOWN; - -#endif diff --git a/net/ldap/inc/TLDAPAttribute.h b/net/ldap/inc/TLDAPAttribute.h deleted file mode 100644 index a6ab7a33fdfab9a64e243f759761d528227c1ca8..0000000000000000000000000000000000000000 --- a/net/ldap/inc/TLDAPAttribute.h +++ /dev/null @@ -1,47 +0,0 @@ -// @(#)root/ldap:$Id$ -// Author: Evgenia Smirnova 21/09/2001 - -/************************************************************************* - * For the licensing terms see $ROOTSYS/LICENSE. * - * For the list of contributors see $ROOTSYS/README/CREDITS. * - *************************************************************************/ - -#ifndef ROOT_TLDAPAttribute -#define ROOT_TLDAPAttribute - -#include "TNamed.h" -#include "TList.h" -#include "CintLDAP.h" - -class TLDAPEntry; - - -class TLDAPAttribute : public TNamed { - -friend class TLDAPEntry; - -private: - TList *fValues; // list of values - mutable Int_t fNCount; // next value to be returned by GetValue() - - LDAPMod *GetMod(Int_t op); // for getting mod for attribute - -protected: - TLDAPAttribute& operator=(const TLDAPAttribute &); - -public: - TLDAPAttribute(const char *name); - TLDAPAttribute(const char *name, const char *value); - TLDAPAttribute(const TLDAPAttribute &attr); - virtual ~TLDAPAttribute(); - - void AddValue(const char *value); - void DeleteValue(const char *value); - const char *GetValue() const; - Int_t GetCount() const { return fValues->GetSize(); } - void Print(Option_t * = "") const; - - ClassDef(TLDAPAttribute, 0) //interface to LDAP -}; - -#endif diff --git a/net/ldap/inc/TLDAPEntry.h b/net/ldap/inc/TLDAPEntry.h deleted file mode 100644 index 949ec73b522ff6abc42337319d4d9616b2d78f99..0000000000000000000000000000000000000000 --- a/net/ldap/inc/TLDAPEntry.h +++ /dev/null @@ -1,55 +0,0 @@ -// @(#)root/ldap:$Id$ -// Author: Evgenia Smirnova 21/09/2001 - -/************************************************************************* - * For the licensing terms see $ROOTSYS/LICENSE. * - * For the list of contributors see $ROOTSYS/README/CREDITS. * - *************************************************************************/ - -#ifndef ROOT_TLDAPEntry -#define ROOT_TLDAPEntry - -#include "TObject.h" -#include "TString.h" -#include "TList.h" -#include "CintLDAP.h" - - -class TLDAPServer; -class TLDAPAttribute; - - -class TLDAPEntry: public TObject { - -friend class TLDAPServer; - -private: - TString fDn; // Distinguished name of entry - TList *fAttr; // List of attributes - mutable Int_t fNCount; // Index of attribute to be returned from GetAttribute() - - LDAPMod **GetMods(Int_t op); // Get array of LDAPMod structures of the entry - -protected: - TLDAPEntry& operator=(const TLDAPEntry&); - -public: - TLDAPEntry(const char *dn); - TLDAPEntry(const TLDAPEntry &e); - virtual ~TLDAPEntry(); - - const char *GetDn() const { return fDn; } - void SetDn(const char *dn) { fDn = dn; } - void AddAttribute(const TLDAPAttribute &attr); - TLDAPAttribute *GetAttribute() const; - TLDAPAttribute *GetAttribute(const char *name) const; - void DeleteAttribute(const char *name); - Int_t GetCount() const { return fAttr->GetSize(); } - Bool_t IsReferral() const; - TList *GetReferrals() const; - void Print(Option_t * = "") const; - - ClassDef(TLDAPEntry, 0) //describe one entry in LDAP -}; - -#endif diff --git a/net/ldap/inc/TLDAPResult.h b/net/ldap/inc/TLDAPResult.h deleted file mode 100644 index 8e5b35efa76821575b8adcbb0eb05967dd1113c5..0000000000000000000000000000000000000000 --- a/net/ldap/inc/TLDAPResult.h +++ /dev/null @@ -1,47 +0,0 @@ -// @(#)root/ldap:$Id$ -// Author: Oleksandr Grebenyuk 21/09/2001 - -/************************************************************************* - * For the licensing terms see $ROOTSYS/LICENSE. * - * For the list of contributors see $ROOTSYS/README/CREDITS. * - *************************************************************************/ - -#ifndef ROOT_TLDAPResult -#define ROOT_TLDAPResult - -#include "TObject.h" -#include "CintLDAP.h" - - -class TLDAPServer; -class TLDAPEntry; - - -class TLDAPResult : public TObject { - -friend class TLDAPServer; - -private: - LDAP *fLd; // LDAP handle of current connection - LDAPMessage *fSearchResult; // Pointer to the LDAP structure that contain search results - LDAPMessage *fCurrentEntry; // Pointer to the current entry to be returned from the next GetNext() call - - TLDAPEntry *CreateEntry(LDAPMessage *entry); - TLDAPResult() : fLd(NULL), fSearchResult(NULL), fCurrentEntry(NULL) { } - TLDAPResult(LDAP *ld, LDAPMessage *searchresult); - -protected: - TLDAPResult(const TLDAPResult&); - TLDAPResult& operator=(const TLDAPResult&); - -public: - virtual ~TLDAPResult(); - - Int_t GetCount() const; - TLDAPEntry *GetNext(); - void Print(Option_t *option="") const; - - ClassDef(TLDAPResult, 0) // LDAP search result set -}; - -#endif diff --git a/net/ldap/inc/TLDAPServer.h b/net/ldap/inc/TLDAPServer.h deleted file mode 100644 index 346e81f7f7e794fb104430d1cd60f1bd9dd67989..0000000000000000000000000000000000000000 --- a/net/ldap/inc/TLDAPServer.h +++ /dev/null @@ -1,65 +0,0 @@ -// @(#)root/ldap:$Id$ -// Author: Oleksandr Grebenyuk 21/09/2001 - -/************************************************************************* - * For the licensing terms see $ROOTSYS/LICENSE. * - * For the list of contributors see $ROOTSYS/README/CREDITS. * - *************************************************************************/ - -#ifndef ROOT_TLDAPServer -#define ROOT_TLDAPServer - -#include "TObject.h" -#include "TString.h" -#include "CintLDAP.h" - -class TList; -class TLDAPResult; -class TLDAPEntry; - - -class TLDAPServer : public TObject { - -private: - LDAP *fLd; // LDAP handle of current connection - TString fBinddn; // Bind name - TString fPassword; // Password - Bool_t fIsConnected; // Current connection state - - Int_t Bind(); - void Unbind(); - - static void DeleteMods(LDAPMod **mods); - -protected: - TLDAPServer(const TLDAPServer&); - TLDAPServer& operator=(const TLDAPServer&); - -public: - TLDAPServer(const char *host, Int_t port = LDAP_PORT, - const char *binddn = 0, const char *password = 0, - Int_t version = LDAP_VERSION2); - - virtual ~TLDAPServer(); - - Bool_t IsConnected() const { return fIsConnected; }; - TLDAPResult *Search(const char *base = "", - Int_t scope = LDAP_SCOPE_BASE, - const char *filter = 0, - TList *attrs = 0, - Bool_t attrsonly = 0); - const char *GetNamingContexts(); - const char *GetSubschemaSubentry(); - TLDAPResult *GetObjectClasses(); - TLDAPResult *GetAttributeTypes(); - - Int_t AddEntry(TLDAPEntry &entry); - Int_t ModifyEntry(TLDAPEntry &entry, Int_t mode = LDAP_MOD_REPLACE); - Int_t DeleteEntry(const char *dn); - Int_t RenameEntry(const char *dn, const char *newrdn, - Bool_t removeattr = kFALSE); - - ClassDef(TLDAPServer, 0) // Connection to LDAP server -}; - -#endif diff --git a/net/ldap/src/TLDAPAttribute.cxx b/net/ldap/src/TLDAPAttribute.cxx deleted file mode 100644 index 0fd1d50c9b37e4e52775f349703fd76fa403a547..0000000000000000000000000000000000000000 --- a/net/ldap/src/TLDAPAttribute.cxx +++ /dev/null @@ -1,150 +0,0 @@ -// @(#)root/ldap:$Id$ -// Author: Evgenia Smirnova 21/09/2001 - -/************************************************************************* - * For the licensing terms see $ROOTSYS/LICENSE. * - * For the list of contributors see $ROOTSYS/README/CREDITS. * - *************************************************************************/ - -#include "TLDAPAttribute.h" -#include "TObjString.h" -#include "Riostream.h" - - -ClassImp(TLDAPAttribute); - -//////////////////////////////////////////////////////////////////////////////// -///constructor - -TLDAPAttribute::TLDAPAttribute(const char *name) : fNCount(0) -{ - SetName(name); - fValues = new TList; - fValues->SetOwner(); -} - -//////////////////////////////////////////////////////////////////////////////// -/// Creates an Attribute with name and value. - -TLDAPAttribute::TLDAPAttribute(const char *name, const char *value) - : fNCount(0) -{ - SetName(name); - fValues = new TList; - fValues->SetOwner(); - AddValue(value); -} - -//////////////////////////////////////////////////////////////////////////////// -/// LDAP attribute copy ctor. - -TLDAPAttribute::TLDAPAttribute(const TLDAPAttribute &attr) - : TNamed(attr), fNCount(attr.fNCount) -{ - fValues = new TList; - fValues->SetOwner(); - - TIter next(attr.fValues); - while (TObjString *str = (TObjString*) next()) { - fValues->AddLast(new TObjString(str->GetName())); - } -} - -//////////////////////////////////////////////////////////////////////////////// -/// Equal operator - -TLDAPAttribute& TLDAPAttribute::operator=(const TLDAPAttribute &attr) -{ - if(this!=&attr) { - TNamed::operator=(attr); - fValues=attr.fValues; - fNCount=attr.fNCount; - } return *this; -} - -//////////////////////////////////////////////////////////////////////////////// -///destructor - -TLDAPAttribute::~TLDAPAttribute() -{ - delete fValues; -} - -//////////////////////////////////////////////////////////////////////////////// -/// Add a value to the attribute. - -void TLDAPAttribute::AddValue(const char *value) -{ - fValues->AddLast(new TObjString(value)); -} - -//////////////////////////////////////////////////////////////////////////////// -/// Delete value by name. - -void TLDAPAttribute::DeleteValue(const char *value) -{ - Int_t n = GetCount(); - for (Int_t i = 0; i < n; i++) { - TObjString *v = (TObjString*) fValues->At(i); - if (v->String().CompareTo(value) == 0) { - delete fValues->Remove(v); - if (fNCount > i) fNCount--; - return; - } - } -} - -//////////////////////////////////////////////////////////////////////////////// -/// Get next value of the attribute. Returns zero after the last value, -/// then returns the first value again. - -const char *TLDAPAttribute::GetValue() const -{ - Int_t n = GetCount(); - if (n > fNCount) { - return ((TObjString*)fValues->At(fNCount++))->GetName(); - } else { - fNCount = 0; - return 0; - } -} - -//////////////////////////////////////////////////////////////////////////////// -/// Print an attribute. - -void TLDAPAttribute::Print(Option_t *) const -{ - Int_t counter = GetCount(); - if (counter == 0) { - std::cout << GetName() << ": " << std::endl; - } else if (counter != 0) { - for (Int_t i = 0; i < counter; i++) { - std::cout << GetName() << ": " << GetValue() << std::endl; - } - } -} - -//////////////////////////////////////////////////////////////////////////////// -/// Get "LDAPMod" structure for attribute. Returned LDAPMod must be -/// deleted by the user. - -LDAPMod *TLDAPAttribute::GetMod(Int_t op) -{ - LDAPMod *tmpMod = new LDAPMod; - Int_t iCount = GetCount(); - char **values = new char* [iCount + 1]; - char *type = new char [strlen(GetName())+1]; - for (int i = 0; i < iCount; i++) { - int nch = strlen(((TObjString*)fValues->At(i))->GetName()) + 1; - values[i] = new char [nch]; - strlcpy(values[i], ((TObjString*)fValues->At(i))->GetName(),nch); - } - - values[iCount] = 0; - strlcpy(type, GetName(),strlen(GetName())+1); - tmpMod->mod_values = values; - tmpMod->mod_type = type; - tmpMod->mod_op = op; - - return tmpMod; -} diff --git a/net/ldap/src/TLDAPEntry.cxx b/net/ldap/src/TLDAPEntry.cxx deleted file mode 100644 index 275adf780f90a6da26645d6f85ccd2b011cd9aa0..0000000000000000000000000000000000000000 --- a/net/ldap/src/TLDAPEntry.cxx +++ /dev/null @@ -1,193 +0,0 @@ -// @(#)root/ldap:$Id$ -// Author: Evgenia Smirnova 21/09/2001 - -/************************************************************************* - * For the licensing terms see $ROOTSYS/LICENSE. * - * For the list of contributors see $ROOTSYS/README/CREDITS. * - *************************************************************************/ - -#include "TLDAPEntry.h" -#include "TLDAPAttribute.h" -#include "Riostream.h" - - -ClassImp(TLDAPEntry); - -//////////////////////////////////////////////////////////////////////////////// -/// Creates the new TLDAPEntry object with the specified DN (distinguished -/// name) and the empty list of attributes. -/// const char *dn: The DN of the entry. You can change it later by calling -/// the SetDn() member function - -TLDAPEntry::TLDAPEntry(const char *dn) : fNCount(0) -{ - SetDn(dn); - fAttr = new TList; - fAttr->SetOwner(); -} - -//////////////////////////////////////////////////////////////////////////////// -/// Copy ctor. - -TLDAPEntry::TLDAPEntry(const TLDAPEntry &e) : TObject(e), fNCount(e.fNCount) -{ - SetDn(e.GetDn()); - fAttr = new TList; - fAttr->SetOwner(); - - TIter next(e.fAttr); - while (TLDAPAttribute *att = (TLDAPAttribute *)next()) { - fAttr->AddLast(new TLDAPAttribute(*att)); - } -} - -//////////////////////////////////////////////////////////////////////////////// -/// Equal operator - -TLDAPEntry& TLDAPEntry::operator=(const TLDAPEntry& lde) -{ - if(this!=&lde) { - TObject::operator=(lde); - fDn=lde.fDn; - fAttr=lde.fAttr; - fNCount=lde.fNCount; - } return *this; -} - -//////////////////////////////////////////////////////////////////////////////// -/// Deletes all the attributes of the entry. - -TLDAPEntry::~TLDAPEntry() -{ - delete fAttr; -} - -//////////////////////////////////////////////////////////////////////////////// -/// Add an attribute to the entry. -/// TLDAPAtrribute attr: attribute to be added. - -void TLDAPEntry::AddAttribute(const TLDAPAttribute &attr) -{ - fAttr->AddLast(new TLDAPAttribute(attr)); -} - -//////////////////////////////////////////////////////////////////////////////// -/// Print entry in LDIF format. - -void TLDAPEntry::Print(Option_t *) const -{ - std::cout << "dn: "<< fDn << std::endl; - TLDAPAttribute *attr = GetAttribute("objectClass"); - if (attr != 0) - attr->Print(); - Int_t n = GetCount(); - for (Int_t i = 0; i < n; i++) { - attr = (TLDAPAttribute*) fAttr->At(i); - if (TString(attr->GetName()).CompareTo("objectClass", TString::kIgnoreCase) != 0) - attr->Print(); - } - std::cout << std::endl; -} - -//////////////////////////////////////////////////////////////////////////////// -/// Get next attribute of the entry. Returns zero after the last attribute, -/// then returns the first attribute again. - -TLDAPAttribute *TLDAPEntry::GetAttribute() const -{ - Int_t n = GetCount(); - if (n > fNCount) { - return (TLDAPAttribute*)fAttr->At(fNCount++); - } else { - fNCount = 0; - return 0; - } -} - -//////////////////////////////////////////////////////////////////////////////// -/// Get attribute by name. -/// Doesn't affect the order of attributes to be returned from the -/// next GetAttribute() call. Attribute name is case insensitive. - -TLDAPAttribute *TLDAPEntry::GetAttribute(const char *name) const -{ - Int_t n = GetCount(); - for (Int_t i = 0; i < n; i++) { - if (TString(((TLDAPAttribute*)fAttr->At(i))->GetName()).CompareTo(name, TString::kIgnoreCase) == 0) { - return (TLDAPAttribute*)fAttr->At(i); - } - } - return 0; -} - -//////////////////////////////////////////////////////////////////////////////// -/// Delete attribute by name. -/// Attribute name is case insensitive. - -void TLDAPEntry::DeleteAttribute(const char *name) -{ - Int_t n = GetCount(); - for (Int_t i = 0; i < n; i++) { - if (TString(((TLDAPAttribute*)fAttr->At(i))->GetName()).CompareTo(name, TString::kIgnoreCase) == 0) { - delete fAttr->Remove(fAttr->At(i)); - if (fNCount > i) fNCount--; - return; - } - } -} - -//////////////////////////////////////////////////////////////////////////////// -/// Check if entry is referal. - -Bool_t TLDAPEntry::IsReferral() const -{ - Bool_t att = kFALSE; - Bool_t obj = kFALSE; - Int_t n = GetCount(); - TString name; - for (Int_t i = 0; (i < n) && (!att || !obj); i++) { - name = TString(((TLDAPAttribute*) fAttr->At(i))->GetName()); - if (name.CompareTo("ref", TString::kIgnoreCase) == 0) { - att = kTRUE; - } else { - if (name.CompareTo("objectclass", TString::kIgnoreCase) == 0) { - TLDAPAttribute *attr = (TLDAPAttribute*)fAttr->At(i); - Int_t valcnt = attr->GetCount() + 1; - for (Int_t j = 0; (j < valcnt) && (!obj); j++) - obj |= (Bool_t)TString(attr->GetValue()).CompareTo("referral", TString::kIgnoreCase); - } - } - } - return (att && obj); -} - -//////////////////////////////////////////////////////////////////////////////// -/// Get the TList of referrals. -/// Returns an empty list if entry is not referral. -/// User is responsible for deleting returned TList. - -TList *TLDAPEntry::GetReferrals() const -{ - TList *list = new TList; - TLDAPAttribute *ref = GetAttribute("ref"); - if (ref != 0) { - Int_t n = ref->GetCount(); - for (Int_t i = 0; i < n; i++) { - list->Add(ref->fValues->At(i)); - } - } - return list; -} - -//////////////////////////////////////////////////////////////////////////////// -/// Get array of "LDAPMod" structures for entry. - -LDAPMod **TLDAPEntry::GetMods(Int_t op) -{ - Int_t n = GetCount(); - LDAPMod **mods = new LDAPMod* [n + 1]; - for (Int_t i = 0; i < n; i++) - mods[i] = ((TLDAPAttribute*)(fAttr->At(i)))->GetMod(op); - mods[n] = 0; - return mods; -} diff --git a/net/ldap/src/TLDAPResult.cxx b/net/ldap/src/TLDAPResult.cxx deleted file mode 100644 index 9e7b704bf6c26d398ff862435fc93348f4d8d9c4..0000000000000000000000000000000000000000 --- a/net/ldap/src/TLDAPResult.cxx +++ /dev/null @@ -1,137 +0,0 @@ -// @(#)root/ldap:$Id$ -// Author: Oleksandr Grebenyuk 21/09/2001 - -/************************************************************************* - * For the licensing terms see $ROOTSYS/LICENSE. * - * For the list of contributors see $ROOTSYS/README/CREDITS. * - *************************************************************************/ - -#include "TLDAPResult.h" -#include "TLDAPEntry.h" -#include "TLDAPAttribute.h" - - -ClassImp(TLDAPResult); - -//////////////////////////////////////////////////////////////////////////////// -/// TLDAPResult object is just a wrapper of the LDAPMessage structure. -/// LDAP *ld: The current session handler -/// LDAPMessage *searchresult: The LDAPMessage structure returned from -/// the ldap_search_s() call - -TLDAPResult::TLDAPResult(LDAP *ld, LDAPMessage *searchresult) - : fLd(ld), fSearchResult(searchresult), fCurrentEntry(searchresult) -{ - if (!GetCount()) - fCurrentEntry = 0; -} - -//////////////////////////////////////////////////////////////////////////////// -/// Copy constructor - -TLDAPResult::TLDAPResult(const TLDAPResult& ldr) : - TObject(ldr), - fLd(ldr.fLd), - fSearchResult(ldr.fSearchResult), - fCurrentEntry(ldr.fCurrentEntry) -{ -} - -//////////////////////////////////////////////////////////////////////////////// -/// Equal operator - -TLDAPResult& TLDAPResult::operator=(const TLDAPResult& ldr) -{ - if(this!=&ldr) { - TObject::operator=(ldr); - fLd=ldr.fLd; - fSearchResult=ldr.fSearchResult; - fCurrentEntry=ldr.fCurrentEntry; - } return *this; -} - -//////////////////////////////////////////////////////////////////////////////// -/// Deletes the LDAPMessage structure - -TLDAPResult::~TLDAPResult() -{ - if (fSearchResult) - ldap_msgfree(fSearchResult); -} - -//////////////////////////////////////////////////////////////////////////////// -/// Returns next entry from the search result. -/// After the last entry it returns a zero pointer -/// and after this it returns the first entry again. -/// The user is responsable for deleting the returned object after use. - -TLDAPEntry *TLDAPResult::GetNext() -{ - TLDAPEntry *entry = CreateEntry(fCurrentEntry); - fCurrentEntry = (fCurrentEntry != 0 ? ldap_next_entry(fLd, fCurrentEntry) : - (GetCount() != 0 ? fSearchResult : 0)); - return entry; -} - -//////////////////////////////////////////////////////////////////////////////// -/// Creates TLDAPEntry object from the data containing in the LDAPMessage -/// structure and returns pointer to it. -/// The user is responsable for deleting the returned object after use. -/// LDAPMessage *entry: Pointer to the LDAPMessage structure containing -/// the entry data. - -TLDAPEntry *TLDAPResult::CreateEntry(LDAPMessage *entry) -{ - if (entry == 0) - return 0; - - char *dn; - char *attr; - BerValue **vals; - BerElement *ptr; - - dn = ldap_get_dn(fLd, entry); - TLDAPEntry *ldapentry = new TLDAPEntry(dn); - for (attr = ldap_first_attribute(fLd, entry, &ptr); attr != 0; - attr = ldap_next_attribute(fLd, entry, ptr)) { - TLDAPAttribute attribute(attr); - vals = ldap_get_values_len(fLd, entry, attr); - if (vals) { - for (Int_t i = 0; vals[i] != 0; i++) { - attribute.AddValue(vals[i]->bv_val); - } - ldap_value_free_len(vals); - } - ldapentry->AddAttribute(attribute); - } - - return ldapentry; -} - -//////////////////////////////////////////////////////////////////////////////// -/// Returns the number of entries in the search result - -Int_t TLDAPResult::GetCount() const -{ - LDAP *ld = fLd; - LDAPMessage *result = fSearchResult; - - return ldap_count_entries(ld, result); -} - -//////////////////////////////////////////////////////////////////////////////// -/// Prints all entries. -/// Calls the Print() member function of the each entry. - -void TLDAPResult::Print(Option_t *) const -{ - TLDAPEntry *e; - Int_t count = GetCount() + 1; - for (Int_t i = 0; i < count; i++) { - e = const_cast<TLDAPResult*>(this)->GetNext(); - if (e) { - e->Print(); - delete e; - } - } -} diff --git a/net/ldap/src/TLDAPServer.cxx b/net/ldap/src/TLDAPServer.cxx deleted file mode 100644 index 0dd9f6473af391aa1c5ff827ba1a3bcd43fcac52..0000000000000000000000000000000000000000 --- a/net/ldap/src/TLDAPServer.cxx +++ /dev/null @@ -1,421 +0,0 @@ -// @(#)root/ldap:$Id$ -// Author: Oleksandr Grebenyuk 21/09/2001 - -/************************************************************************* - * For the licensing terms see $ROOTSYS/LICENSE. * - * For the list of contributors see $ROOTSYS/README/CREDITS. * - *************************************************************************/ - -#include "TLDAPServer.h" -#include "TLDAPResult.h" -#include "TLDAPEntry.h" -#include "TLDAPAttribute.h" -#include "TObjString.h" -#include "TList.h" -#include "TError.h" - - -ClassImp(TLDAPServer); - -//////////////////////////////////////////////////////////////////////////////// -/// During construction TLDAPServer object tries to connect to the -/// specified server and you should check the connection status by -/// calling the IsConnected() member function immediately after -/// creating that object. -/// const char *host: The name of host to connect. Default is "localhost". -/// Int_t port: Port number to connect. Default is LDAP_PORT (=389). -/// const char *binddn: Bind DN. -/// const char *password: Password. Usually you have to specify bind DN and -/// password to have the write permissions. Default -/// values for bind DN and password are zero, that means -/// anonymous connection. Usually it is enough to read -/// the data from the server. -/// Int_t version Set LDAP protocol version: LDAP_VERSION1, -/// LDAP_VERSION2, LDAP_VERSION3 - -TLDAPServer::TLDAPServer(const char *host, Int_t port, const char *binddn, - const char *password, Int_t version) -{ - fLd = 0; - fIsConnected = kFALSE; - fBinddn = binddn; - fPassword = password; - - fLd = ldap_init(host, port); - if (!fLd) { - Error("TLDAPServer", "error in ldap_init function"); - } else { - if (ldap_set_option(fLd, LDAP_OPT_PROTOCOL_VERSION, &version) != LDAP_OPT_SUCCESS ) { - Error("Bind", "Could not set protocol version!"); - return; - } - - Bind( ); - } -} - -//////////////////////////////////////////////////////////////////////////////// -/// Copy constructor - -TLDAPServer::TLDAPServer(const TLDAPServer& lds) : - TObject(lds), - fLd(lds.fLd), - fBinddn(lds.fBinddn), - fPassword(lds.fPassword), - fIsConnected(lds.fIsConnected) -{ -} - -//////////////////////////////////////////////////////////////////////////////// -/// Equal operator - -TLDAPServer& TLDAPServer::operator=(const TLDAPServer& lds) -{ - if(this!=&lds) { - TObject::operator=(lds); - fLd=lds.fLd; - fBinddn=lds.fBinddn; - fPassword=lds.fPassword; - fIsConnected=lds.fIsConnected; - } return *this; -} - -//////////////////////////////////////////////////////////////////////////////// -/// If the object is connected to the server, it disconnects. - -TLDAPServer::~TLDAPServer() -{ - Unbind(); -} - -//////////////////////////////////////////////////////////////////////////////// -/// Binds to the server with specified binddn and password. -/// Return value: LDAP error code, 0 if successfully bound. - -Int_t TLDAPServer::Bind() -{ - if (!IsConnected()) { - Int_t result = ldap_simple_bind_s(fLd, fBinddn.Data(), fPassword.Data()); - if (result != LDAP_SUCCESS) { - ldap_unbind(fLd); - fIsConnected = kFALSE; - switch (result) { - case LDAP_INVALID_CREDENTIALS: - Error("Bind", "invalid password"); - break; - case LDAP_INAPPROPRIATE_AUTH: - Error("Bind", "entry has no password to check"); - break; - default : - Error("Bind", "%s", ldap_err2string(result)); - break; - } - } else { - fIsConnected = kTRUE; - } - return result; - } - return 0; -} - -//////////////////////////////////////////////////////////////////////////////// -/// Unbinds from the server with specified binddn and password. - -void TLDAPServer::Unbind() -{ - if (IsConnected()) { - ldap_unbind(fLd); - fIsConnected = kFALSE; - } -} - -//////////////////////////////////////////////////////////////////////////////// -/// Performs an LDAPSearch with the attribute "namingContexts" to be -/// returned with the result. The value of this attribute is -/// extracted and returned as const char. - -const char *TLDAPServer::GetNamingContexts() -{ - TList *attrs = new TList; - attrs->SetOwner(); - attrs->AddLast(new TObjString("namingContexts")); - const char *namingcontexts = 0; - - TLDAPResult *result = Search("", LDAP_SCOPE_BASE, 0, attrs, 0); - - if (result) { - TLDAPEntry *entry = result->GetNext(); - if (entry) { - TLDAPAttribute *attribute = entry->GetAttribute(); - if (attribute) - namingcontexts = attribute->GetValue(); - delete entry; - } - delete result; - } - delete attrs; - - return namingcontexts; -} - -//////////////////////////////////////////////////////////////////////////////// -/// Performs an LDAPSearch with the attribute "subschemaSubentry" to -/// be returned with the result. The value of this attribute is -/// extracted and returned as const char. - -const char *TLDAPServer::GetSubschemaSubentry() -{ - TList *attrs = new TList; - attrs->SetOwner(); - attrs->AddLast(new TObjString("subschemaSubentry")); - const char *subschema = 0; - - TLDAPResult *result = Search("", LDAP_SCOPE_BASE, 0, attrs, 0); - - if (result) { - TLDAPEntry *entry = result->GetNext(); - if (entry) { - TLDAPAttribute *attribute = entry->GetAttribute(); - if (attribute) - subschema = attribute->GetValue(); - delete entry; - } - delete result; - } - delete attrs; - - return subschema; -} - -//////////////////////////////////////////////////////////////////////////////// -/// Calls GetSubschemaSubentry() and performs and LDAPSearch with -/// the attribute "objectClasses" to be returned with the result. -/// The returned result object must be deleted by the user. - -TLDAPResult *TLDAPServer::GetObjectClasses() -{ - const char *subschema = GetSubschemaSubentry(); - - TList *attrs = new TList; - attrs->SetOwner(); - attrs->AddLast(new TObjString("objectClasses")); - - TLDAPResult *result = Search(subschema, LDAP_SCOPE_BASE, 0, attrs, 0); - - delete attrs; - - return result; -} - -//////////////////////////////////////////////////////////////////////////////// -/// Calls GetSubschemaSubentry() and performs and LDAPSearch with the -/// attribute "attributeTypes" to be returned with the result. -/// The returned result object must be deleted by the user. - -TLDAPResult *TLDAPServer::GetAttributeTypes() -{ - const char *subschema = GetSubschemaSubentry(); - - TList *attrs = new TList; - attrs->SetOwner(); - attrs->AddLast(new TObjString("attributeTypes")); - - TLDAPResult *result = Search(subschema, LDAP_SCOPE_BASE, 0, attrs, 0); - - delete attrs; - - return result; -} - -//////////////////////////////////////////////////////////////////////////////// -/// Performs searching at the LDAP directory. -/// Return value: a TLDAPResult object or 0 in case of error. -/// Result needs to be deleted by user. -/// const char *base: Specifies the base object for the search operation -/// Int_t scope: Specifies the portion of the LDAP tree, relative to -/// the base object, to search. -/// Must be one of LDAP_SCOPE_BASE (==0), -/// LDAP_SCOPE_ONELEVEL (==1) or LDAP_SCOPE_SUBTREE (==2). -/// char *filter: The criteria during the search to determine which -/// entries to return, 0 means that the filter -/// "(objectclass=*)" will be applied -/// TList *attrs: The TList of attributes to be returned along with -/// each entry, 0 means that all available attributes -/// should be returned. -/// Int_t attrsonly: This parameter is a boolean specifying whether both -/// types and values should be returned with each -/// attribute (zero) or types only should be returned -/// (non-zero). - -TLDAPResult *TLDAPServer::Search(const char *base, Int_t scope, - const char *filter, TList *attrs, - Bool_t attrsonly) -{ - Bind(); - - Int_t errcode; - TLDAPResult *result = 0; - - if (IsConnected()) { - - LDAPMessage *searchresult; - char **attrslist = 0; - if (attrs) { - Int_t n = attrs->GetSize(); - attrslist = new char* [n + 1]; - for (Int_t i = 0; i < n; i++) - attrslist[i] = (char*) ((TObjString*)attrs->At(i))->GetName(); - attrslist[n] = 0; - } - if (filter == 0) - filter = "(objectClass=*)"; - - errcode = ldap_search_s(fLd, base, scope, filter, attrslist, - attrsonly, &searchresult); - - delete [] attrslist; - - if (errcode == LDAP_SUCCESS) { - result = new TLDAPResult(fLd, searchresult); - } else { - ldap_msgfree(searchresult); - Error("Search", "%s", ldap_err2string(errcode)); - } - - } else { - errcode = LDAP_SERVER_DOWN; - Error("Search", "%s", "server is not connected"); - } - - return result; -} - -//////////////////////////////////////////////////////////////////////////////// -/// Adds entry to the LDAP tree. -/// Be sure that you are bound with write permissions. -/// Return value: LDAP error code. - -Int_t TLDAPServer::AddEntry(TLDAPEntry &entry) -{ - Bind(); - - Int_t errcode; - if (IsConnected()) { - LDAPMod **ms = entry.GetMods(0); - errcode = ldap_add_s(fLd, entry.GetDn(), ms); - TLDAPServer::DeleteMods(ms); - if (errcode != LDAP_SUCCESS) - Error("AddEntry", "%s", ldap_err2string(errcode)); - } else { - errcode = LDAP_SERVER_DOWN; - Error("AddEntry", "server is not connected"); - } - return errcode; -} - -//////////////////////////////////////////////////////////////////////////////// -/// Modifies specified entry. -/// Be sure that you are bound with write permissions. -/// Return value: LDAP error code, 0 = success. -/// TLDAPEntry &entry: Entry to be modified. -/// Int_t mode: Modifying mode. -/// Should be one of LDAP_MOD_ADD (==0), -/// LDAP_MOD_DELETE (==1) or LDAP_MOD_REPLACE (==2) -/// Specifies what to do with all the entry's attributes -/// and its values - add to the corresponding entry on -/// the server, delete from it, or replace the -/// corresponding attributes with new values - -Int_t TLDAPServer::ModifyEntry(TLDAPEntry &entry, Int_t mode) -{ - Bind(); - - Int_t errcode; - if (IsConnected()) { - LDAPMod **ms = entry.GetMods(mode); - errcode = ldap_modify_s(fLd, entry.GetDn(), ms); - TLDAPServer::DeleteMods(ms); - if (errcode != LDAP_SUCCESS) - Error("ModifyEntry", "%s", ldap_err2string(errcode)); - } else { - errcode = LDAP_SERVER_DOWN; - Error("ModifyEntry", "server is not connected"); - } - return errcode; -} - -//////////////////////////////////////////////////////////////////////////////// -/// Deletes the entry with specified DN, the base entry must exist. -/// Be sure that you are bound with write permissions. -/// Return value: LDAP error code, 0 = succes. - -Int_t TLDAPServer::DeleteEntry(const char *dn) -{ - Bind(); - - Int_t errcode; - if (IsConnected()) { - errcode = ldap_delete_s(fLd, dn); - if (errcode != LDAP_SUCCESS) - Error("DeleteEntry", "%s", ldap_err2string(errcode)); - } else { - errcode = LDAP_SERVER_DOWN; - Error("DeleteEntry", "server is not connected"); - } - return errcode; -} - -//////////////////////////////////////////////////////////////////////////////// -/// Renames the entry with specified DN, the entry must be leaf -/// Be sure that you are bound with the write permissions -/// Return value: LDAP error code, 0 = succes -/// char *dn: Distinguished name of entry to be renamed. -/// This entry must be a leaf in the LDAP directory tree. -/// char *newrdn: The new relative distinguished name to give the entry -/// being renamed. -/// Bool_t removeattr: This parameter specifies whether or not the -/// attribute values in the old relative distinguished -/// name should be removed from the entry -/// or retained as non-distinguished attributes. - -Int_t TLDAPServer::RenameEntry(const char *dn, const char *newrdn, Bool_t removeattr) -{ - Int_t errcode; - if (IsConnected()) { - errcode = ldap_modrdn2_s(fLd, dn, newrdn, removeattr); - if (errcode != LDAP_SUCCESS) - Error( "RenameEntry", "%s", ldap_err2string(errcode)); - } else { - errcode = LDAP_SERVER_DOWN; - Error("RenameEntry", "server is not connected"); - } - return errcode; -} - -//////////////////////////////////////////////////////////////////////////////// -/// Deletes the array of LDAPMod structures and frees its memory. -/// LDAPMod **mods: Pointer to the zero-terminated array of pointers -/// to LDAPMod structures - -void TLDAPServer::DeleteMods(LDAPMod **mods) -{ -#if 1 - ldap_mods_free(mods, 1); -#else - Int_t i = 0; - LDAPMod *mod; - while ((mod = mods[i++]) != 0) { - if (mod->mod_op & LDAP_MOD_BVALUES) { - ber_bvecfree(mod->mod_bvalues); - } else { - Int_t j = 0; - char *c; - while ((c = mod->mod_values[j++]) != 0) - delete c; - } - delete mod->mod_type; - delete mod; - } - delete mods; -#endif -} diff --git a/sql/pgsql/inc/TPgSQLStatement.h b/sql/pgsql/inc/TPgSQLStatement.h index 3d8bbd1353c09a29c7d61b4a37c87f7197bfc9ee..e98505c05b5508da309af77f23c57f9b0f6b07df 100644 --- a/sql/pgsql/inc/TPgSQLStatement.h +++ b/sql/pgsql/inc/TPgSQLStatement.h @@ -16,9 +16,6 @@ #include <libpq-fe.h> #include <pg_config.h> // to get PG_VERSION_NUM -#ifdef USE_LDAP -#undef USE_LDAP -#endif #define pgsql_success(x) (((x) == PGRES_EMPTY_QUERY) \ || ((x) == PGRES_COMMAND_OK) \ diff --git a/tutorials/net/LDAPExample.C b/tutorials/net/LDAPExample.C deleted file mode 100644 index 8e20f3ff425a6ddc9f224f57ba21814f6543606f..0000000000000000000000000000000000000000 --- a/tutorials/net/LDAPExample.C +++ /dev/null @@ -1,64 +0,0 @@ -/// \file -/// \ingroup tutorial_net -/// -/// \macro_code -/// -/// \author - -void LDAPExample() -{ - gSystem->Load("libRLDAP.so"); - - TLDAPServer *server = new TLDAPServer("ldap.cern.ch"); - if (!server->IsConnected()) { - printf("Could not connect to ldap.cern.ch\n"); - delete server; - return; - } - - TLDAPResult *result = server.Search(); - - if (result == 0) { - printf("Search failed\n"); - return; - } - result->Print(); - delete result; - - const char *namingcontexts = server.GetNamingContexts(); - result = server.Search(namingcontexts, LDAP_SCOPE_ONELEVEL, 0, 0, 1); - TLDAPEntry *entry = result.GetNext(); - entry->Print(); - - TString dn = entry->GetDn(); - - delete result; - delete entry; - - cout << "The DN of the entry is " << dn << endl; - - result = server.Search(dn, LDAP_SCOPE_SUBTREE, 0, 0, 0); - - if (result == 0) { - printf("Search failed\n"); - return; - } - - result->Print(); - Int_t counter = result.GetCount(); - cout << "The result contains " << counter << " entries !!!" << endl; - - entry = result.GetNext(); - - TLDAPAttribute *attribute = entry.GetAttribute("member"); - - Int_t counter2 = attribute.GetCount(); - cout << "The attribute " << attribute.GetName() << " contains " - << counter2 << " values !!!" << endl; - const char *value = attribute.GetValue(); - cout << "The first value of the attribute is " << endl; - cout << value << endl; - - delete result; - delete entry; -} diff --git a/tutorials/net/TUriTest.C b/tutorials/net/TUriTest.C index c679872b1a8393117fb5fcf71f450c520b775dbd..3ac84b681df7ca883144467f3fab889c9d4f5101 100644 --- a/tutorials/net/TUriTest.C +++ b/tutorials/net/TUriTest.C @@ -116,7 +116,6 @@ Bool_t TestValidation() valid &= TUri("ftp://ftp.is.co.za/rfc/rfc1808.txt").IsUri(); valid &= TUri("http://www.ietf.org/rfc/rfc2396.txt").IsUri(); // IPV6 example excluded - //valid &= TUri("ldap://[2001:db8::7]/c=GB?objectClass?one").IsUri(); valid &= TUri("mailto:John.Doe@example.com").IsUri(); valid &= TUri("news:comp.infosystems.www.servers.unix").IsUri(); valid &= TUri("tel:+1-816-555-1212").IsUri();