Browse Source

Downgrading python-ldap to version 2.3.13

RHEL5 does not come with the necessary version of OpenLDAP to support using
2.4.6, so we need to use an older version of the python library.
Jon Natkins 13 years ago
parent
commit
2c3ee3dad3
100 changed files with 2814 additions and 1365 deletions
  1. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/.cvsignore
  2. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Build/build-openbsd/Makefile
  3. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Build/build-openbsd/pkg/COMMENT
  4. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Build/build-openbsd/pkg/DESCR
  5. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Build/build-openbsd/pkg/PLIST
  6. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Build/setup.cfg.mingw
  7. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Build/setup.cfg.suse-linux
  8. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Build/setup.cfg.win32
  9. 1 125
      desktop/core/ext-py/python-ldap-2.3.13/CHANGES
  10. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Demo/.cvsignore
  11. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Demo/Lib/.cvsignore
  12. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Demo/Lib/ldap/.cvsignore
  13. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Demo/Lib/ldap/async/.cvsignore
  14. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Demo/Lib/ldap/async/deltree.py
  15. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Demo/Lib/ldap/async/ldifwriter.py
  16. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Demo/Lib/ldap/async/sizelimit.py
  17. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Demo/Lib/ldapurl/.cvsignore
  18. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Demo/Lib/ldapurl/urlsearch.py
  19. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Demo/Lib/ldif/.cvsignore
  20. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Demo/Lib/ldif/ldifcopy.py
  21. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Demo/initialize.py
  22. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Demo/ldapcontrols.py
  23. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Demo/matchedvalues.py
  24. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Demo/ms_ad_bind.py
  25. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Demo/options.py
  26. 11 18
      desktop/core/ext-py/python-ldap-2.3.13/Demo/page_control.py
  27. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Demo/passwd_ext_op.py
  28. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Demo/pickle_ldapobject.py
  29. 3 0
      desktop/core/ext-py/python-ldap-2.3.13/Demo/pyasn1/README
  30. 58 0
      desktop/core/ext-py/python-ldap-2.3.13/Demo/pyasn1/prereadcontrol.py
  31. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Demo/reconnect.py
  32. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Demo/rename.py
  33. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Demo/resiter.py
  34. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Demo/sasl_bind.py
  35. 10 12
      desktop/core/ext-py/python-ldap-2.3.13/Demo/schema.py
  36. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Demo/schema_tree.py
  37. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Demo/simple.py
  38. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Demo/simplebrowse.py
  39. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Doc/.cvsignore
  40. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Doc/Makefile
  41. 3 5
      desktop/core/ext-py/python-ldap-2.3.13/Doc/conf.py
  42. 12 12
      desktop/core/ext-py/python-ldap-2.3.13/Doc/index.rst
  43. 4 25
      desktop/core/ext-py/python-ldap-2.3.13/Doc/installing.rst
  44. 9 30
      desktop/core/ext-py/python-ldap-2.3.13/Doc/ldap-async.rst
  45. 83 0
      desktop/core/ext-py/python-ldap-2.3.13/Doc/ldap-controls.rst
  46. 4 7
      desktop/core/ext-py/python-ldap-2.3.13/Doc/ldap-dn.rst
  47. 3 3
      desktop/core/ext-py/python-ldap-2.3.13/Doc/ldap-filter.rst
  48. 43 0
      desktop/core/ext-py/python-ldap-2.3.13/Doc/ldap-modlist.rst
  49. 10 21
      desktop/core/ext-py/python-ldap-2.3.13/Doc/ldap-resiter.rst
  50. 21 0
      desktop/core/ext-py/python-ldap-2.3.13/Doc/ldap-schema.rst
  51. 1221 0
      desktop/core/ext-py/python-ldap-2.3.13/Doc/ldap.rst
  52. 28 34
      desktop/core/ext-py/python-ldap-2.3.13/Doc/ldapurl.rst
  53. 5 25
      desktop/core/ext-py/python-ldap-2.3.13/Doc/ldif.rst
  54. 5 6
      desktop/core/ext-py/python-ldap-2.3.13/INSTALL
  55. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/LICENCE
  56. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Lib/.cvsignore
  57. 40 36
      desktop/core/ext-py/python-ldap-2.3.13/Lib/dsml.py
  58. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Lib/ldap/.cvsignore
  59. 3 5
      desktop/core/ext-py/python-ldap-2.3.13/Lib/ldap/__init__.py
  60. 39 29
      desktop/core/ext-py/python-ldap-2.3.13/Lib/ldap/async.py
  61. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Lib/ldap/cidict.py
  62. 133 0
      desktop/core/ext-py/python-ldap-2.3.13/Lib/ldap/controls.py
  63. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Lib/ldap/dn.py
  64. 2 2
      desktop/core/ext-py/python-ldap-2.3.13/Lib/ldap/filter.py
  65. 9 8
      desktop/core/ext-py/python-ldap-2.3.13/Lib/ldap/functions.py
  66. 82 124
      desktop/core/ext-py/python-ldap-2.3.13/Lib/ldap/ldapobject.py
  67. 7 18
      desktop/core/ext-py/python-ldap-2.3.13/Lib/ldap/modlist.py
  68. 7 3
      desktop/core/ext-py/python-ldap-2.3.13/Lib/ldap/resiter.py
  69. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Lib/ldap/sasl.py
  70. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Lib/ldap/schema/.cvsignore
  71. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Lib/ldap/schema/__init__.py
  72. 81 209
      desktop/core/ext-py/python-ldap-2.3.13/Lib/ldap/schema/models.py
  73. 97 162
      desktop/core/ext-py/python-ldap-2.3.13/Lib/ldap/schema/subentry.py
  74. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Lib/ldap/schema/tokenizer.py
  75. 4 13
      desktop/core/ext-py/python-ldap-2.3.13/Lib/ldapurl.py
  76. 2 2
      desktop/core/ext-py/python-ldap-2.3.13/Lib/ldif.py
  77. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/MANIFEST.in
  78. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Modules/.cvsignore
  79. 230 309
      desktop/core/ext-py/python-ldap-2.3.13/Modules/LDAPObject.c
  80. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Modules/LDAPObject.h
  81. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Modules/berval.c
  82. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Modules/berval.h
  83. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Modules/common.c
  84. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Modules/common.h
  85. 305 0
      desktop/core/ext-py/python-ldap-2.3.13/Modules/constants.c
  86. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Modules/constants.h
  87. 220 0
      desktop/core/ext-py/python-ldap-2.3.13/Modules/errors.c
  88. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Modules/errors.h
  89. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Modules/functions.c
  90. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Modules/functions.h
  91. 9 11
      desktop/core/ext-py/python-ldap-2.3.13/Modules/ldapcontrol.c
  92. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Modules/ldapcontrol.h
  93. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Modules/ldapmodule.c
  94. 7 105
      desktop/core/ext-py/python-ldap-2.3.13/Modules/message.c
  95. 2 2
      desktop/core/ext-py/python-ldap-2.3.13/Modules/message.h
  96. 1 4
      desktop/core/ext-py/python-ldap-2.3.13/Modules/options.c
  97. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Modules/options.h
  98. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Modules/schema.c
  99. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Modules/schema.h
  100. 0 0
      desktop/core/ext-py/python-ldap-2.3.13/Modules/version.c

+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/.cvsignore → desktop/core/ext-py/python-ldap-2.3.13/.cvsignore


+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Build/build-openbsd/Makefile → desktop/core/ext-py/python-ldap-2.3.13/Build/build-openbsd/Makefile


+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Build/build-openbsd/pkg/COMMENT → desktop/core/ext-py/python-ldap-2.3.13/Build/build-openbsd/pkg/COMMENT


+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Build/build-openbsd/pkg/DESCR → desktop/core/ext-py/python-ldap-2.3.13/Build/build-openbsd/pkg/DESCR


+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Build/build-openbsd/pkg/PLIST → desktop/core/ext-py/python-ldap-2.3.13/Build/build-openbsd/pkg/PLIST


+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Build/setup.cfg.mingw → desktop/core/ext-py/python-ldap-2.3.13/Build/setup.cfg.mingw


+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Build/setup.cfg.suse-linux → desktop/core/ext-py/python-ldap-2.3.13/Build/setup.cfg.suse-linux


+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Build/setup.cfg.win32 → desktop/core/ext-py/python-ldap-2.3.13/Build/setup.cfg.win32


+ 1 - 125
desktop/core/ext-py/python-ldap-2.4.6/CHANGES → desktop/core/ext-py/python-ldap-2.3.13/CHANGES

@@ -1,127 +1,3 @@
-----------------------------------------------------------------
-Released 2.4.6 2011-11-27
-
-Changes since 2.4.5:
-
-Lib/
-* ldap.controls.ppolicy:
-  Another fix for decoding the password policy response control
-
-----------------------------------------------------------------
-Released 2.4.5 2011-11-25
-
-Changes since 2.4.4:
-
-Installation:
-* defines for SASL and SSL in setup.cfg to be more friendly to
-  Python setup tools (easy_install)
-  
-Lib/
-* Fixed typo in ldap.functions._ldap_function_call() which
-  always released ldap._ldap_module_lock instead of local lock
-* ldap.controls.ppolicy:
-  Fixed decoding the password policy response control
-
-Demo/
-* Demo script for ldap.controls.ppolicy
-
-----------------------------------------------------------------
-Released 2.4.4 2011-10-26
-
-Changes since 2.4.3:
-
-Modules/
-* Format intermediate messages as 3-tuples instead of
-  4-tuples to match the format of other response messages.
-  (thanks to Chris Mikkelson)
-* Fixes for memory leaks (thanks to Chris Mikkelson)
-
-Lib/
-* New experimental(!) sub-module ldap.syncrepl implementing syncrepl
-  consumer (see RFC 4533, thanks to Chris Mikkelson)
-
-Doc/
-* Cleaned up rst files
-* Added missing classes
-
-----------------------------------------------------------------
-Released 2.4.3 2011-07-23
-
-Changes since 2.4.2:
-
-Lib/
-* Mostly corrected/updated __doc__ strings
-
-Doc/
-* Corrected rst files
-* Added missing modules, functions, classes, methods, parameters etc.
-  at least as auto-generated doc
-
-----------------------------------------------------------------
-Released 2.4.2 2011-07-21
-
-Changes since 2.4.1:
-
-Lib/
-
-Logging:
-* pprint.pformat() is now used when writing method/function
-  arguments to the trace log
-
-ldap.schema.subentry:
-* SubSchema.__init__() now has new key-word argument check_uniqueness
-  which enables checking whether OIDs are unique in the subschema subentry
-* Code-cleaning: consequent use of method SubSchema.getoid() instead of
-  accessing SubSchema.name2oid directly.
-* SubSchema.getoid() and SubSchema.getoid() now have key-word argument
-  raise_keyerror=0 and raise KeyError with appropriate description.
-
-----------------------------------------------------------------
-Released 2.4.1 2011-07-05
-
-Changes since 2.4.0:
-
-Modules:
-* New LDAP option OPT_X_TLS_PACKAGE available in OpenLDAP 2.4.26+
-  to determine the name of the SSL/TLS package OpenLDAP was
-  built with
-
-Lib/
-* ldap.modlist.modifyModlist(): New key-word argument
-  case_ignore_attr_types used to define attribute types for which
-  comparison of old and new values should be case-insensitive
-* Minor changes to which data is sent to debug output for various
-  trace levels
-* Now tag [1] is used in ldap.extop.dds.RefreshResponse in
-  compliance with RFC 2589 (fix available for OpenLDAP ITS#6886)
-* New sub-module ldap.controls.sessiontrack implements request control
-  as described in draft-wahl-ldap-session (needs pyasn1_modules)
-  
-----------------------------------------------------------------
-Released 2.4.0 2011-06-02
-
-Changes since 2.3.13:
-
-* OpenLDAP 2.4.11+ required to build
-* Support for extracting LDAPv3 extended controls in
-  LDAP_RES_SEARCH_ENTRY responses
-  (see SF#2829057, thanks to Rich)
-* Generic support for LDAPv3 extended operations (thanks to Rich)
-
-Lib/
-* new class API in ldap.controls, not backwards-compatible!
-* new sub-modules for ldap.controls, some require pyasn1 and pyasn1_modules
-* New methods LDAPObject.result4() and LDAPObject.extop_result()
-* New (optional) class ldap.controls.AssertionControl
-* New helper module ldap.logger contains file-like object which
-  sends trace messages to logging.log()
-* Removed non-functional method LDAPObject.set_cache_options()
-* Removed unused dictionary ldap.controls.knownLDAPControls
-
-Modules/
-* ldapcontrol.c: Fixed encode_assertion_control() and function is no longer
-  hidden behind ifdef-statement
-
 ----------------------------------------------------------------
 ----------------------------------------------------------------
 Released 2.3.13 2011-02-19
 Released 2.3.13 2011-02-19
 
 
@@ -964,4 +840,4 @@ Released 2.0.0pre02 2002-02-01
 ----------------------------------------------------------------
 ----------------------------------------------------------------
 Released 1.10alpha3 2000-09-19
 Released 1.10alpha3 2000-09-19
 
 
-$Id: CHANGES,v 1.273 2011/11/27 15:26:06 stroeder Exp $
+$Id: CHANGES,v 1.242 2011/02/19 14:35:17 stroeder Exp $

+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Demo/.cvsignore → desktop/core/ext-py/python-ldap-2.3.13/Demo/.cvsignore


+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Demo/Lib/.cvsignore → desktop/core/ext-py/python-ldap-2.3.13/Demo/Lib/.cvsignore


+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Demo/Lib/ldap/.cvsignore → desktop/core/ext-py/python-ldap-2.3.13/Demo/Lib/ldap/.cvsignore


+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Demo/Lib/ldap/async/.cvsignore → desktop/core/ext-py/python-ldap-2.3.13/Demo/Lib/ldap/async/.cvsignore


+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Demo/Lib/ldap/async/deltree.py → desktop/core/ext-py/python-ldap-2.3.13/Demo/Lib/ldap/async/deltree.py


+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Demo/Lib/ldap/async/ldifwriter.py → desktop/core/ext-py/python-ldap-2.3.13/Demo/Lib/ldap/async/ldifwriter.py


+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Demo/Lib/ldap/async/sizelimit.py → desktop/core/ext-py/python-ldap-2.3.13/Demo/Lib/ldap/async/sizelimit.py


+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Demo/Lib/ldapurl/.cvsignore → desktop/core/ext-py/python-ldap-2.3.13/Demo/Lib/ldapurl/.cvsignore


+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Demo/Lib/ldapurl/urlsearch.py → desktop/core/ext-py/python-ldap-2.3.13/Demo/Lib/ldapurl/urlsearch.py


+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Demo/Lib/ldif/.cvsignore → desktop/core/ext-py/python-ldap-2.3.13/Demo/Lib/ldif/.cvsignore


+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Demo/Lib/ldif/ldifcopy.py → desktop/core/ext-py/python-ldap-2.3.13/Demo/Lib/ldif/ldifcopy.py


+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Demo/initialize.py → desktop/core/ext-py/python-ldap-2.3.13/Demo/initialize.py


+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Demo/ldapcontrols.py → desktop/core/ext-py/python-ldap-2.3.13/Demo/ldapcontrols.py


+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Demo/matchedvalues.py → desktop/core/ext-py/python-ldap-2.3.13/Demo/matchedvalues.py


+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Demo/ms_ad_bind.py → desktop/core/ext-py/python-ldap-2.3.13/Demo/ms_ad_bind.py


+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Demo/options.py → desktop/core/ext-py/python-ldap-2.3.13/Demo/options.py


+ 11 - 18
desktop/core/ext-py/python-ldap-2.4.6/Demo/page_control.py → desktop/core/ext-py/python-ldap-2.3.13/Demo/page_control.py

@@ -14,11 +14,9 @@ l = ldap.initialize(url,trace_level=1)
 l.protocol_version = 3
 l.protocol_version = 3
 l.simple_bind_s("", "")
 l.simple_bind_s("", "")
 
 
-req_ctrl = SimplePagedResultsControl(True,size=page_size,cookie='')
-
-known_ldap_resp_ctrls = {
-  SimplePagedResultsControl.controlType:SimplePagedResultsControl,
-}
+lc = SimplePagedResultsControl(
+  ldap.LDAP_CONTROL_PAGE_OID,True,(page_size,'')
+)
 
 
 # Send search request
 # Send search request
 msgid = l.search_ext(
 msgid = l.search_ext(
@@ -26,39 +24,34 @@ msgid = l.search_ext(
   ldap.SCOPE_SUBTREE,
   ldap.SCOPE_SUBTREE,
   search_flt,
   search_flt,
   attrlist=searchreq_attrlist,
   attrlist=searchreq_attrlist,
-  serverctrls=[req_ctrl]
+  serverctrls=[lc]
 )
 )
 
 
 pages = 0
 pages = 0
 while True:
 while True:
     pages += 1
     pages += 1
-    print "Getting page %d" % (pages)
-    rtype, rdata, rmsgid, serverctrls = l.result3(msgid,resp_ctrl_classes=known_ldap_resp_ctrls)
+    print "Getting page %d" % (pages,)
+    rtype, rdata, rmsgid, serverctrls = l.result3(msgid)
     print '%d results' % len(rdata)
     print '%d results' % len(rdata)
-    print 'serverctrls=',pprint.pprint(serverctrls)
 #    pprint.pprint(rdata)
 #    pprint.pprint(rdata)
     pctrls = [
     pctrls = [
       c
       c
       for c in serverctrls
       for c in serverctrls
-      if c.controlType == SimplePagedResultsControl.controlType
+      if c.controlType == ldap.LDAP_CONTROL_PAGE_OID
     ]
     ]
     if pctrls:
     if pctrls:
-        print 'pctrls[0].size',repr(pctrls[0].size)
-        print 'pctrls[0].cookie',repr(pctrls[0].cookie)
-        if pctrls[0].cookie:
-            # Copy cookie from response control to request control
-            req_ctrl.cookie = pctrls[0].cookie
+        est, cookie = pctrls[0].controlValue
+        if cookie:
+            lc.controlValue = (page_size, cookie)
             msgid = l.search_ext(
             msgid = l.search_ext(
               base,
               base,
               ldap.SCOPE_SUBTREE,
               ldap.SCOPE_SUBTREE,
               search_flt,
               search_flt,
               attrlist=searchreq_attrlist,
               attrlist=searchreq_attrlist,
-              serverctrls=[req_ctrl]
+              serverctrls=[lc]
             )
             )
         else:
         else:
             break
             break
     else:
     else:
         print "Warning:  Server ignores RFC 2696 control."
         print "Warning:  Server ignores RFC 2696 control."
         break
         break
-
-l.unbind_s()

+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Demo/passwd_ext_op.py → desktop/core/ext-py/python-ldap-2.3.13/Demo/passwd_ext_op.py


+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Demo/pickle_ldapobject.py → desktop/core/ext-py/python-ldap-2.3.13/Demo/pickle_ldapobject.py


+ 3 - 0
desktop/core/ext-py/python-ldap-2.3.13/Demo/pyasn1/README

@@ -0,0 +1,3 @@
+The sample scripts herein require module pyasn1.
+
+See http://pyasn1.sourceforge.net/

+ 58 - 0
desktop/core/ext-py/python-ldap-2.3.13/Demo/pyasn1/prereadcontrol.py

@@ -0,0 +1,58 @@
+#!/usr/bin/env python
+"""
+This sample script demonstrates the use of the pre-read control (see RFC 4527).
+
+Originally contributed by Andreas Hasenack <ahasenack@terra.com.br>
+
+Requires module pyasn1 (see http://pyasn1.sourceforge.net/)
+"""
+
+import ldap
+from pyasn1.type import univ
+from pyasn1.codec.der import encoder
+from ldap.controls import LDAPControl
+
+class LDAPString(univ.OctetString): pass
+
+class AttributeSelection(univ.SequenceOf):
+    componentType = LDAPString("")
+
+class PreReadControl(LDAPControl):
+  """
+  Pre-Read LDAP Control
+
+  see RFC 4527
+  """
+
+  controlType = ldap.LDAP_CONTROL_PRE_READ
+
+  def __init__(self, criticality, controlValue=None,encodedControlValue=None):
+    LDAPControl.__init__(self, self.controlType, criticality, controlValue, encodedControlValue)
+
+  def encodeControlValue(self, value):
+    attributeSelection = AttributeSelection()
+    for i in range(len(value)):
+      attributeSelection.setComponentByPosition(i, value[i])
+    res = encoder.encode(attributeSelection)
+    return res
+
+  def decodeControlValue(self, value):
+    # XXX
+    return repr(value)
+
+
+uri = "ldap://localhost:389"
+base = "dc=example,dc=com"
+scope = ldap.SCOPE_SUBTREE
+filter = "(objectClass=sambaUnixIdPool)"
+
+ld = ldap.initialize(uri)
+ld.protocol_version = ldap.VERSION3
+ld.bind_s("uid=LDAP Admin,ou=System Accounts,dc=example,dc=com", "ldapadmin")
+
+pr = PreReadControl(criticality=True, controlValue=['uidNumber','gidNumber'])
+modlist = [(ldap.MOD_INCREMENT, "uidNumber", "1"),(ldap.MOD_INCREMENT, "gidNumber", "1")]
+msg = ld.modify_ext("cn=unixIdPool,dc=example,dc=com", modlist, serverctrls = [pr])
+
+res = ld.result3(msgid = msg, timeout = -1)
+print "res:", res

+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Demo/reconnect.py → desktop/core/ext-py/python-ldap-2.3.13/Demo/reconnect.py


+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Demo/rename.py → desktop/core/ext-py/python-ldap-2.3.13/Demo/rename.py


+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Demo/resiter.py → desktop/core/ext-py/python-ldap-2.3.13/Demo/resiter.py


+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Demo/sasl_bind.py → desktop/core/ext-py/python-ldap-2.3.13/Demo/sasl_bind.py


+ 10 - 12
desktop/core/ext-py/python-ldap-2.4.6/Demo/schema.py → desktop/core/ext-py/python-ldap-2.3.13/Demo/schema.py

@@ -8,14 +8,12 @@ ldap._trace_level = 0
 
 
 subschemasubentry_dn,schema = ldap.schema.urlfetch(sys.argv[-1])
 subschemasubentry_dn,schema = ldap.schema.urlfetch(sys.argv[-1])
 
 
+schema_reverse = ldap.schema.SubSchema(schema.ldap_entry())
+
 if subschemasubentry_dn is None:
 if subschemasubentry_dn is None:
   print 'No sub schema sub entry found!'
   print 'No sub schema sub entry found!'
   sys.exit(1)
   sys.exit(1)
 
 
-if schema.non_unique_oids:
-  print '*** Schema errors ***'
-  print 'non-unique OIDs:\n','\r\n'.join(schema.non_unique_oids)
-
 print '*** Schema from',repr(subschemasubentry_dn)
 print '*** Schema from',repr(subschemasubentry_dn)
 
 
 # Display schema
 # Display schema
@@ -23,15 +21,11 @@ for attr_type,schema_class in ldap.schema.SCHEMA_CLASS_MAPPING.items():
   print '*'*20,attr_type,'*'*20
   print '*'*20,attr_type,'*'*20
   for element_id in schema.listall(schema_class):
   for element_id in schema.listall(schema_class):
     se_orig = schema.get_obj(schema_class,element_id)
     se_orig = schema.get_obj(schema_class,element_id)
+    se_reverse = schema_reverse.get_obj(schema_class,element_id)
+#    assert str(se_orig)==str(se_reverse)
     print attr_type,str(se_orig)
     print attr_type,str(se_orig)
 print '*** Testing object class inetOrgPerson ***'
 print '*** Testing object class inetOrgPerson ***'
 
 
-drink = schema.get_obj(ldap.schema.AttributeType,'favouriteDrink')
-if not drink is None:
-  print '*** drink ***'
-  print 'drink.names',repr(drink.names)
-  print 'drink.collective',repr(drink.collective)
-
 inetOrgPerson = schema.get_obj(ldap.schema.ObjectClass,'inetOrgPerson')
 inetOrgPerson = schema.get_obj(ldap.schema.ObjectClass,'inetOrgPerson')
 if not inetOrgPerson is None:
 if not inetOrgPerson is None:
   print inetOrgPerson.must,inetOrgPerson.may
   print inetOrgPerson.must,inetOrgPerson.may
@@ -51,6 +45,12 @@ try:
 except KeyError,e:
 except KeyError,e:
   print '***KeyError',str(e)
   print '***KeyError',str(e)
 
 
+drink = schema.get_obj(ldap.schema.AttributeType,'favouriteDrink')
+if not drink is None:
+  print '*** drink ***'
+  print 'drink.names',repr(drink.names)
+  print 'drink.collective',repr(drink.collective)
+
 
 
 schema.ldap_entry()
 schema.ldap_entry()
 
 
@@ -59,5 +59,3 @@ print str(schema.get_obj(ldap.schema.MatchingRuleUse,'2.5.13.0'))
 
 
 print str(schema.get_obj(ldap.schema.AttributeType,'name'))
 print str(schema.get_obj(ldap.schema.AttributeType,'name'))
 print str(schema.get_inheritedobj(ldap.schema.AttributeType,'cn',['syntax','equality','substr','ordering']))
 print str(schema.get_inheritedobj(ldap.schema.AttributeType,'cn',['syntax','equality','substr','ordering']))
-
-must_attr,may_attr = schema.attribute_types(['person','organizationalPerson','inetOrgPerson'],raise_keyerror=0)

+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Demo/schema_tree.py → desktop/core/ext-py/python-ldap-2.3.13/Demo/schema_tree.py


+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Demo/simple.py → desktop/core/ext-py/python-ldap-2.3.13/Demo/simple.py


+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Demo/simplebrowse.py → desktop/core/ext-py/python-ldap-2.3.13/Demo/simplebrowse.py


+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Doc/.cvsignore → desktop/core/ext-py/python-ldap-2.3.13/Doc/.cvsignore


+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Doc/Makefile → desktop/core/ext-py/python-ldap-2.3.13/Doc/Makefile


+ 3 - 5
desktop/core/ext-py/python-ldap-2.4.6/Doc/conf.py → desktop/core/ext-py/python-ldap-2.3.13/Doc/conf.py

@@ -10,8 +10,6 @@
 #
 #
 # All configuration values have a default value; values that are commented out
 # All configuration values have a default value; values that are commented out
 # serve to show the default value.
 # serve to show the default value.
-#
-# $Id: conf.py,v 1.17 2011/10/14 11:48:31 stroeder Exp $
 
 
 import sys
 import sys
 
 
@@ -36,15 +34,15 @@ master_doc = 'index'
 
 
 # General substitutions.
 # General substitutions.
 project = 'python-ldap'
 project = 'python-ldap'
-copyright = '2008-2011, python-ldap project team'
+copyright = '2008, python-ldap project team'
 
 
 # The default replacements for |version| and |release|, also used in various
 # The default replacements for |version| and |release|, also used in various
 # other places throughout the built documents.
 # other places throughout the built documents.
 #
 #
 # The short X.Y version.
 # The short X.Y version.
-version = '2.4'
+version = '2.3'
 # The full version, including alpha/beta/rc tags.
 # The full version, including alpha/beta/rc tags.
-release = '2.4.4.0'
+release = '2.3.12.0'
 
 
 # There are two options for replacing |today|: either, you set today to some
 # There are two options for replacing |today|: either, you set today to some
 # non-false value, then it is used:
 # non-false value, then it is used:

+ 12 - 12
desktop/core/ext-py/python-ldap-2.4.6/Doc/index.rst → desktop/core/ext-py/python-ldap-2.3.13/Doc/index.rst

@@ -1,39 +1,38 @@
+.. python-ldap documentation master file, created by sphinx-quickstart on Sat Mar 29 15:08:17 2008.
+   You can adapt this file completely to your liking, but it should at least
+   contain the root `toctree` directive.
+
 ##########################
 ##########################
-python-ldap Documentation
+python-ldap Documentation  
 ##########################
 ##########################
 
 
-.. % $Id: index.rst,v 1.8 2011/10/26 19:42:45 stroeder Exp $
+.. % $Id: index.rst,v 1.4 2009/10/24 19:31:57 stroeder Exp $
 
 
 .. topic:: Abstract
 .. topic:: Abstract
 
 
-   This document describes the package python-ldap with its various modules.
-
-   Depending on what you want to do this manual assumes basic to expert
-   knowledge about the Python language and the LDAP standard (LDAPv3).
+   This document describes the package python-ldap with its various modules.  This
+   manual assumes basic knowledge about the Python language and the LDAP standard.
 
 
 
 
 ********
 ********
 Contents
 Contents
 ********
 ********
 
 
+
 .. toctree::
 .. toctree::
-   :maxdepth: 3
+   :maxdepth: 3 
 
 
    installing.rst
    installing.rst
    ldap.rst
    ldap.rst
    ldap-async.rst
    ldap-async.rst
+   ldap-resiter.rst
    ldap-controls.rst
    ldap-controls.rst
    ldap-dn.rst
    ldap-dn.rst
-   ldap-extop.rst
    ldap-filter.rst
    ldap-filter.rst
    ldap-modlist.rst
    ldap-modlist.rst
-   ldap-resiter.rst
    ldap-schema.rst
    ldap-schema.rst
-   ldap-syncrepl.rst
    ldif.rst
    ldif.rst
    ldapurl.rst
    ldapurl.rst
-   dsml.rst
-
 
 
 ******************
 ******************
 Indices and tables
 Indices and tables
@@ -42,3 +41,4 @@ Indices and tables
 * :ref:`genindex`
 * :ref:`genindex`
 * :ref:`modindex`
 * :ref:`modindex`
 * :ref:`search`
 * :ref:`search`
+

+ 4 - 25
desktop/core/ext-py/python-ldap-2.4.6/Doc/installing.rst → desktop/core/ext-py/python-ldap-2.3.13/Doc/installing.rst

@@ -1,22 +1,9 @@
-.. % $Id: installing.rst,v 1.15 2011/07/24 19:00:53 stroeder Exp $
+.. % $Id: ldap-dn.tex,v 1.8 2008/03/26 12:10:12 stroeder Exp 
 
 
 ***********************
 ***********************
 Building and installing
 Building and installing
 ***********************
 ***********************
 
 
-python-ldap is built and installed using the Python DistUtils installed
-along with your Python installation:
-
-::
-
-  python setup.py build
-  python setup.py install
-
-If you have more than one Python interpreter installed locally you should
-use the same one you plan to use python-ldap with.
-
-See further instructions for using DistUtils here: http://docs.python.org/install/index.html
-
 Prerequisites
 Prerequisites
 =============
 =============
 
 
@@ -24,18 +11,12 @@ The following software packages are required to be installed
 on the local system when building python-ldap:
 on the local system when building python-ldap:
 
 
 - Python version 2.3 or later including its development files: http://www.python.org/
 - Python version 2.3 or later including its development files: http://www.python.org/
-- OpenLDAP client libs version 2.4.11 or later: http://www.openldap.org/
+- OpenLDAP client libs version 2.3 or later: http://www.openldap.org/
   It is not possible and not supported to build with prior versions.
   It is not possible and not supported to build with prior versions.
 - OpenSSL (optional): http://www.openssl.org/
 - OpenSSL (optional): http://www.openssl.org/
-- cyrus-sasl (optional): http://www.cyrussasl.org
+- cyrus-sasl (optional): http://asg.web.cmu.edu/sasl/sasl-library.html
 - Kerberos libs, MIT or heimdal (optional)
 - Kerberos libs, MIT or heimdal (optional)
 
 
-Furthermore some sub-modules of :py:mod:`ldap.controls` and :py:mod:`ldap.extop`
-require :py:mod:`pyasn1` and :py:mod:`pyasn1_modules` to be installed.
-
-  http://pyasn1.sf.net
-
-
 setup.cfg
 setup.cfg
 =========
 =========
 
 
@@ -96,9 +77,7 @@ Example
 The following example is for a full-featured build (including SSL and SASL support)
 The following example is for a full-featured build (including SSL and SASL support)
 of python-ldap with OpenLDAP installed in a different prefix directory
 of python-ldap with OpenLDAP installed in a different prefix directory
 (here /opt/openldap-2.3) and SASL header files found in /usr/include/sasl.
 (here /opt/openldap-2.3) and SASL header files found in /usr/include/sasl.
-Debugging symbols are preserved with compile option -g.
-
-::
+Debugging symbols are preserved with compile option -g. ::
 
 
   [_ldap]
   [_ldap]
   library_dirs = /opt/openldap-2.3/lib
   library_dirs = /opt/openldap-2.3/lib

+ 9 - 30
desktop/core/ext-py/python-ldap-2.4.6/Doc/ldap-async.rst → desktop/core/ext-py/python-ldap-2.3.13/Doc/ldap-async.rst

@@ -1,47 +1,26 @@
-.. % $Id: ldap-async.rst,v 1.4 2011/07/28 08:52:01 stroeder Exp $
+.. % $Id: ldap-async.rst,v 1.2 2009/04/17 12:14:52 stroeder Exp $
 
 
 
 
-**************************************************************
-:py:mod:`ldap.async` Stream-processing of large search results
-**************************************************************
+:mod:`ldap.async` Framework for stream-processing of large search results
+==============================================================================
 
 
-.. py:module:: ldap.async
+.. module:: ldap.async
    :synopsis: Framework for stream-processing of large search results.
    :synopsis: Framework for stream-processing of large search results.
+.. moduleauthor:: python-ldap project (see http://www.python-ldap.org/)
 
 
-With newer Python versions one might want to consider using
-:py:mod:`ldap.resiter` instead.
 
 
+.. % Author of the module code;
 
 
-Classes
-=======
-
-.. autoclass:: ldap.async.AsyncSearchHandler
-   :members:
-
-.. autoclass:: ldap.async.List
-   :members:
-
-.. autoclass:: ldap.async.Dict
-   :members:
-
-.. autoclass:: ldap.async.IndexedDict
-   :members:
-
-.. autoclass:: ldap.async.LDIFWriter
-   :members:
-
-.. autoclass:: ldap.async.DSMLWriter
-   :members:
 
 
 .. _ldap.async-example:
 .. _ldap.async-example:
 
 
-Examples
-========
+Examples for ldap.async
+------------------------
 
 
 .. _ldap.async-example.List:
 .. _ldap.async-example.List:
 
 
 Using ldap.async.List
 Using ldap.async.List
-^^^^^^^^^^^^^^^^^^^^^
+^^^^^^^^^^^^^^^^^^^^^^
 
 
 This example demonstrates how to use class ldap.async.List for
 This example demonstrates how to use class ldap.async.List for
 retrieving partial search results even though the exception
 retrieving partial search results even though the exception

+ 83 - 0
desktop/core/ext-py/python-ldap-2.3.13/Doc/ldap-controls.rst

@@ -0,0 +1,83 @@
+.. % $Id: ldap-controls.rst,v 1.2 2009/04/17 12:14:52 stroeder Exp $
+
+
+:mod:`ldap.controls` High-level access to LDAP controls
+============================================================
+
+.. module:: ldap.controls
+   :synopsis: High-level access to LDAP controls.
+.. moduleauthor:: python-ldap project (see http://www.python-ldap.org/)
+
+
+The :mod:`ldap.controls` module defines the following classes:
+
+.. % Author of the module code;
+
+
+.. class:: LDAPControl(controlType, criticality [, controlValue=:const:`None` [, encodedControlValue=:const:`None`]])
+
+   Base class for all LDAP controls. This class should not be used directly,
+   instead one of the following subclasses should be used as appropriate.
+
+
+   .. method:: LDAPControl.encodeControlValue(value)
+
+      Dummy method to be overridden by subclasses.
+
+
+   .. method:: LDAPControl.decodeControlValue(value)
+
+      Dummy method to be overridden by subclasses.
+
+
+   .. method:: LDAPControl.getEncodedTuple()
+
+      Return a readily encoded 3-tuple which can be directly  passed to C module
+      _ldap. This method is called by  function :func:`ldap.EncodeControlTuples`.
+
+
+.. class:: BooleanControl(controlType, criticality [, controlValue=:const:`None` [, encodedControlValue=:const:`None`]])
+
+   Base class for simple controls with booelan control value.    In this base class
+   *controlValue* has to be passed as  boolean type (:const:`True`/:const:`False`
+   or :const:`1`/:const:`0`).
+
+
+.. class:: SimplePagedResultsControl(controlType, criticality [, controlValue=:const:`None` [, encodedControlValue=:const:`None`]])
+
+   The class provides the LDAP Control Extension for Simple Paged Results
+   Manipulation. *controlType* is ignored  in favor of
+   :const:`ldap.LDAP_CONTROL_PAGE_OID`.
+
+
+   .. seealso::
+
+      :rfc:`2696` - LDAP Control Extension for Simple Paged Results Manipulation
+
+.. class:: MatchedValuesControl(criticality [, controlValue=:const:`None`])
+
+   This class provides the LDAP Matched Values control. *controlValue* is an LDAP
+   filter.
+
+
+   .. seealso::
+
+      :rfc:`3876` - Returning Matched Values with the Lightweight Directory Access Protocol version 3 (LDAPv3)
+
+The :mod:`ldap.controls` module defines the following functions:
+
+
+.. function:: EncodeControlTuples(ldapControls)
+
+   Returns list of readily encoded 3-tuples which can be directly  passed to C
+   module _ldap.
+
+   .. % -> list
+
+
+.. function:: DecodeControlTuples(ldapControlTuples)
+
+   Decodes a list of readily encoded 3-tuples as returned by the C module _ldap.
+
+   .. % -> list
+

+ 4 - 7
desktop/core/ext-py/python-ldap-2.4.6/Doc/ldap-dn.rst → desktop/core/ext-py/python-ldap-2.3.13/Doc/ldap-dn.rst

@@ -1,10 +1,10 @@
-.. % $Id: ldap-dn.rst,v 1.6 2011/07/22 07:43:45 stroeder Exp $
+.. % $Id: ldap-dn.rst,v 1.4 2010/05/16 11:22:08 stroeder Exp $
 
 
 
 
-:py:mod:`ldap.dn` LDAP Distinguished Name handling
+:mod:`ldap.dn` LDAP Distinguished Name handling
 ====================================================
 ====================================================
 
 
-.. py:module:: ldap.dn
+.. module:: ldap.dn
    :synopsis: LDAP Distinguished Name handling.
    :synopsis: LDAP Distinguished Name handling.
 .. moduleauthor:: python-ldap project (see http://www.python-ldap.org/)
 .. moduleauthor:: python-ldap project (see http://www.python-ldap.org/)
 
 
@@ -17,10 +17,7 @@
    For LDAPv3 DN syntax see:
    For LDAPv3 DN syntax see:
 
 
    :rfc:`4514` - Lightweight Directory Access Protocol (LDAP): String Representation of Distinguished Names
    :rfc:`4514` - Lightweight Directory Access Protocol (LDAP): String Representation of Distinguished Names
-
-.. seealso::
-
-   For deprecated LDAPv2 DN syntax (obsoleted by LDAPv3) see:
+   For LDAPv2 DN syntax (obsoleted by LDAPv3) see:
 
 
    :rfc:`1779` - A String Representation of Distinguished Names
    :rfc:`1779` - A String Representation of Distinguished Names
 
 

+ 3 - 3
desktop/core/ext-py/python-ldap-2.4.6/Doc/ldap-filter.rst → desktop/core/ext-py/python-ldap-2.3.13/Doc/ldap-filter.rst

@@ -1,10 +1,10 @@
-.. % $Id: ldap-filter.rst,v 1.4 2011/07/21 20:33:26 stroeder Exp $
+.. % $Id: ldap-filter.rst,v 1.3 2009/04/17 12:14:52 stroeder Exp $
 
 
 
 
-:py:mod:`ldap.filter` LDAP filter handling
+:mod:`ldap.filter` LDAP filter handling
 ============================================
 ============================================
 
 
-.. py:module:: ldap.filter
+.. module:: ldap.filter
    :synopsis: LDAP filter handling.
    :synopsis: LDAP filter handling.
 .. moduleauthor:: python-ldap project (see http://www.python-ldap.org/)
 .. moduleauthor:: python-ldap project (see http://www.python-ldap.org/)
 
 

+ 43 - 0
desktop/core/ext-py/python-ldap-2.3.13/Doc/ldap-modlist.rst

@@ -0,0 +1,43 @@
+.. % $Id: ldap-modlist.rst,v 1.2 2009/04/17 12:14:52 stroeder Exp $
+
+
+:mod:`ldap.modlist` Generate modify lists
+==============================================
+
+.. module:: ldap.modlist
+   :synopsis: Generate modify lists.
+.. moduleauthor:: python-ldap project (see http://www.python-ldap.org/)
+
+
+The :mod:`ldap.modlist` module defines the following functions:
+
+.. % Author of the module code;
+
+
+.. function:: addModlist(entry [, ignore_attr_types=[]])
+
+   This function builds a list suitable for passing it  directly as argument
+   *modlist* to method :meth:`add` or  its synchronous counterpart :meth:`add_s`.
+   *entry* is a dictionary like returned when  receiving search results.
+
+   .. % -> list
+
+
+.. function:: modifyModlist( old_entry, new_entry [, ignore_attr_types=[] [, ignore_oldexistent=0]])
+
+   This function builds a list suitable for passing it directly as argument
+   *modlist* to method :meth:`modify` or its synchronous counterpart
+   :meth:`modify_s`.  Roughly when applying the resulting modify list to an entry
+   holding  the data *old_entry* it will be modified in such a way that the  entry
+   holds *new_entry* after the modify operation. It is handy in  situations when it
+   is impossible to track user changes to an entry's  data or for synchronizing
+   operations. *old_entry* and *new_entry* are dictionaries  like returned when
+   receiving search results. *ignore_attr_types* is a list of attribute type
+   names which  shall be ignored completely. These attribute types will not appear
+   in the result. If *ignore_oldexistent* is non-zero attribute type names which
+   are in *old_entry* but are not found in *new_entry* at all  are not deleted.
+   This is handy for situations where your application  sets attribute value to "
+   for deleting an attribute.  In most cases leave zero.
+
+   .. % -> list
+

+ 10 - 21
desktop/core/ext-py/python-ldap-2.4.6/Doc/ldap-resiter.rst → desktop/core/ext-py/python-ldap-2.3.13/Doc/ldap-resiter.rst

@@ -1,40 +1,29 @@
-.. % $Id: ldap-resiter.rst,v 1.5 2011/08/27 15:43:06 stroeder Exp $
+.. % $Id: ldap-resiter.rst,v 1.2 2009/10/24 19:32:12 stroeder Exp $
 
 
 
 
-:py:mod:`ldap.resiter` Generator for stream-processing of large search results
+:mod:`ldap.resiter` Generator for stream-processing of large search results
 ==============================================================================
 ==============================================================================
 
 
-.. py:module:: ldap.resiter
+.. module:: ldap.resiter
    :synopsis: Generator for stream-processing of large search results.
    :synopsis: Generator for stream-processing of large search results.
 .. moduleauthor:: python-ldap project (see http://www.python-ldap.org/)
 .. moduleauthor:: python-ldap project (see http://www.python-ldap.org/)
 
 
 
 
-.. _ldap.resiter-classes:
-
-.. py:class:: ResultProcessor
-
-This is a mix-in class to be used with class :py:class:`ldap.LDAPObject` or
-derived classes which has these methods:
-
-  .. automethod:: ldap.resiter.ResultProcessor.allresults
+.. % Author of the module code;
 
 
 
 
 .. _ldap.resiter-example:
 .. _ldap.resiter-example:
 
 
-
-Examples
-========
+Examples for ldap.resiter
+-------------------------
 
 
 .. _ldap.resiter.ResultProcessor-example:
 .. _ldap.resiter.ResultProcessor-example:
 
 
-Using ldap.resiter.ResultProcessor
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Using ldap.resiter
+^^^^^^^^^^^^^^^^^^
 
 
 This example demonstrates how to use mix-in class ldap.resiter.ResultProcessor for
 This example demonstrates how to use mix-in class ldap.resiter.ResultProcessor for
-retrieving results formerly requested with :py:meth:`ldap.LDAPObject.search()` and
-processing them in a for-loop.
-
-::
+retrieving results and processing them in a for-loop. ::
 
 
   import sys,ldap,ldap.resiter
   import sys,ldap,ldap.resiter
 
 
@@ -46,7 +35,7 @@ processing them in a for-loop.
   # Asynchronous search method
   # Asynchronous search method
   msg_id = l.search('dc=stroeder,dc=com',ldap.SCOPE_SUBTREE,'(objectClass=*)')
   msg_id = l.search('dc=stroeder,dc=com',ldap.SCOPE_SUBTREE,'(objectClass=*)')
 
 
-  for res_type,res_data,res_msgid,res_controls in l.allresults(msg_id):
+  for res_type,res_data,res_msgid,res_controls in self.source.allresults(msg_id):
     for dn,entry in res_data:
     for dn,entry in res_data:
       # process dn and entry
       # process dn and entry
       print dn,entry['objectClass']
       print dn,entry['objectClass']

+ 21 - 0
desktop/core/ext-py/python-ldap-2.3.13/Doc/ldap-schema.rst

@@ -0,0 +1,21 @@
+.. % $Id: ldap-schema.rst,v 1.2 2009/04/17 12:14:52 stroeder Exp $
+
+
+:mod:`ldap.schema` Processing LDAPv3 sub schema sub entry
+==============================================================
+
+.. module:: ldap.schema
+   :synopsis: Processing LDAPv3 sub schema sub entry
+.. moduleauthor:: python-ldap project (see http://www.python-ldap.org/)
+
+
+.. % Author of the module code;
+
+.. _ldap.schema-example:
+
+Examples for ldap.schema
+^^^^^^^^^^^^^^^^^^^^^^^^
+
+::
+
+   import ldap.schema

+ 1221 - 0
desktop/core/ext-py/python-ldap-2.3.13/Doc/ldap.rst

@@ -0,0 +1,1221 @@
+.. % $Id: ldap.rst,v 1.18 2011/02/19 13:05:16 stroeder Exp $
+
+*****************************************
+:mod:`ldap` LDAP library interface module
+*****************************************
+
+.. module:: ldap
+   :platform: UNIX,Windows
+   :synopsis: Access to an underlying LDAP C library.
+.. moduleauthor:: python-ldap project (see http://www.python-ldap.org/)
+
+
+This module provides access to the LDAP  (Lightweight Directory Access Protocol)
+C API implemented  in OpenLDAP 2.3 or newer.  It is similar to the C API, with
+the notable differences  that lists are manipulated via Python  list operations
+and errors appear as exceptions.    For far more detailed information on the C
+interface,   please see the (expired) draft-ietf-ldapext-ldap-c-api-04.    This
+documentation is current for the Python LDAP module, version  |release|.  Source
+and binaries are available from http://www.python-ldap.org/.
+
+.. % not standard, in C
+.. % Author of the module code;
+.. % Leave at least one blank line after this, to simplify ad-hoc tools
+.. % that are sometimes used to massage these files.
+.. % ==== 2. ====
+.. % Give a short overview of what the module does.
+.. % If it is platform specific, mention this.
+.. % Mention other important restrictions or general operating principles.
+.. % ==== 3. ====
+.. % List the public functions defined by the module.  Begin with a
+.. % standard phrase.  You may also list the exceptions and other data
+.. % items defined in the module, insofar as they are important for the
+.. % user.
+
+
+Functions
+=========
+
+The :mod:`ldap` module defines the following functions:
+
+.. function:: initialize(uri [, trace_level=0 [, trace_file=sys.stdout [, trace_stack_limit=None]]])
+
+   Opens a new connection with an LDAP server, and return an LDAP object
+   (see :ref:`ldap-objects`) used to perform operations on that server.  Parameter
+   *uri* has to be a valid LDAP URL.
+   The optional arguments are for generating debug log information:
+   *trace_level* specifies the amount of information being logged,
+   *trace_file* specifies a file-like object as target of the debug log and
+   *trace_stack_limit* specifies the stack limit of tracebacks in debug log.
+   Possible values for *trace_level* are
+   :const:`0` for no logging,
+   :const:`1` for only logging the method calls with arguments,
+   :const:`2` for logging the method calls with arguments and the complete results and 
+   :const:`3` for also logging the traceback of method calls.
+
+   .. seealso::
+
+      :rfc:`4516` - Lightweight Directory Access Protocol (LDAP): Uniform Resource Locator
+
+   .. % -> LDAPObject
+
+.. function:: open(host [, port=PORT])
+
+   Opens a new connection with an LDAP server, and return an LDAP object  (see
+   :ref:`ldap-objects`) used to perform operations on that server.  *host* is a
+   string containing solely the host name. *port*  is an integer specifying the
+   port where the LDAP server is  listening (default is 389).  Note: Using this
+   function is deprecated.
+
+   .. % -> LDAPObject
+
+.. % %------------------------------------------------------------
+.. % % get_option
+
+
+.. function:: get_option(option)
+
+   This function returns the value of the global option  specified by *option*.
+
+   .. % -> None
+
+.. % %------------------------------------------------------------
+.. % % set_option
+
+
+.. function:: set_option(option, invalue)
+
+   This function sets the value of the global option  specified by *option* to
+   *invalue*.
+
+   .. % -> None
+
+.. _ldap-constants:
+
+Constants
+=========
+
+The module defines various constants. Note that some constants depend
+on the build options and which underlying libs were used or even on
+the version of the libs. So before using those constants the application has
+to explicitly check whether they are available.
+
+General
+-------
+
+.. data:: PORT
+
+   The assigned TCP port number (389) that LDAP servers listen on.
+
+.. data:: SASL_AVAIL
+
+   Integer where a non-zero value indicates that python-ldap was built with
+   support for SASL (Cyrus-SASL).
+
+.. data:: TLS_AVAIL
+
+   Integer where a non-zero value indicates that python-ldap was built with
+   support for SSL/TLS (OpenSSL or similar libs).
+
+
+.. _ldap-options:
+
+Options
+-------
+
+.. seealso::
+
+   :manpage:`ldap.conf{5}` and :manpage:`ldap_get_options{3}`
+
+
+For use with functions and method set_option() and get_option() the
+following option identifiers are defined as constants:
+
+.. data:: OPT_API_FEATURE_INFO
+
+.. data:: OPT_API_INFO
+
+.. data:: OPT_CLIENT_CONTROLS
+
+.. data:: OPT_DEBUG_LEVEL
+
+   Sets the debug level within the underlying LDAP C lib.
+
+.. data:: OPT_DEFBASE
+
+.. data:: OPT_DEREF
+
+   Specifies how alias derefencing is done within the underlying LDAP C lib.
+
+.. data:: OPT_ERROR_STRING
+
+.. data:: OPT_DIAGNOSTIC_MESSAGE
+
+.. data:: OPT_HOST_NAME
+
+.. data:: OPT_MATCHED_DN
+
+.. data:: OPT_NETWORK_TIMEOUT
+
+.. data:: OPT_PROTOCOL_VERSION
+
+   Sets the LDAP protocol version used for a connection. This is mapped to
+   object attribute `ldap.LDAPObject.protocol_version`
+
+.. data:: OPT_REFERRALS
+
+   int specifying whether referrals should be automatically chased within
+   the underlying LDAP C lib.
+
+.. data:: OPT_REFHOPLIMIT
+
+.. data:: OPT_RESTART
+
+.. data:: OPT_SERVER_CONTROLS
+
+.. data:: OPT_SIZELIMIT
+
+.. data:: OPT_SUCCESS
+
+.. data:: OPT_TIMELIMIT
+
+.. data:: OPT_TIMEOUT
+
+.. data:: OPT_URI
+
+.. _ldap-sasl-options:
+
+SASL options
+::::::::::::
+
+.. data:: OPT_X_SASL_AUTHCID
+
+.. data:: OPT_X_SASL_AUTHZID
+
+.. data:: OPT_X_SASL_MECH
+
+.. data:: OPT_X_SASL_NOCANON
+
+   If set to zero SASL host name canonicalization is disabled.
+
+.. data:: OPT_X_SASL_REALM
+
+.. data:: OPT_X_SASL_SECPROPS
+
+.. data:: OPT_X_SASL_SSF
+
+.. data:: OPT_X_SASL_SSF_EXTERNAL
+
+.. data:: OPT_X_SASL_SSF_MAX
+
+.. data:: OPT_X_SASL_SSF_MIN
+
+.. _ldap-tls-options:
+
+TLS options
+:::::::::::
+
+.. data:: OPT_X_TLS
+
+.. data:: OPT_X_TLS_ALLOW
+
+.. data:: OPT_X_TLS_CACERTDIR
+
+.. data:: OPT_X_TLS_CACERTFILE
+
+.. data:: OPT_X_TLS_CERTFILE
+
+.. data:: OPT_X_TLS_CIPHER_SUITE
+
+.. data:: OPT_X_TLS_CTX
+
+.. data:: OPT_X_TLS_DEMAND
+
+.. data:: OPT_X_TLS_HARD
+
+.. data:: OPT_X_TLS_KEYFILE
+
+.. data:: OPT_X_TLS_NEVER
+
+.. data:: OPT_X_TLS_RANDOM_FILE
+
+.. data:: OPT_X_TLS_REQUIRE_CERT
+
+.. data:: OPT_X_TLS_TRY
+
+.. _ldap-keepalive-options:
+
+Keepalive options
+:::::::::::::::::
+
+.. data:: OPT_X_KEEPALIVE_IDLE
+
+.. data:: OPT_X_KEEPALIVE_PROBES
+
+.. data:: OPT_X_KEEPALIVE_INTERVAL
+
+.. _ldap-dn-flags:
+
+DN format flags
+----------------
+
+This constants are used for DN-parsing functions found in
+sub-module :mod:`ldap.dn`.
+
+.. seealso::
+
+   :manpage:`ldap_str2dn{3}`
+
+
+.. data:: DN_FORMAT_LDAP
+
+.. data:: DN_FORMAT_LDAPV3
+
+.. data:: DN_FORMAT_LDAPV2
+
+.. data:: DN_FORMAT_DCE
+
+.. data:: DN_FORMAT_UFN
+
+.. data:: DN_FORMAT_AD_CANONICAL
+
+.. data:: DN_FORMAT_MASK
+
+.. data:: DN_PRETTY
+
+.. data:: DN_SKIP
+
+.. data:: DN_P_NOLEADTRAILSPACES
+
+.. data:: DN_P_NOSPACEAFTERRDN
+
+.. data:: DN_PEDANTIC
+
+
+
+.. _ldap-exceptions:
+
+Exceptions
+==========
+
+The module defines the following exceptions:
+
+.. exception:: LDAPError
+
+   This is the base class of all execeptions raised by the module :mod:`ldap`.
+   Unlike the C interface, errors are not returned as result codes, but
+   are instead turned into exceptions, raised as soon an the error condition 
+   is detected.
+
+   The exceptions are accompanied by a dictionary possibly
+   containing an string value for the key :const:`desc`
+   (giving an English description of the error class)
+   and/or a string value for the key :const:`info`
+   (giving a string containing more information that the server may have sent).
+
+   A third possible field of this dictionary is :const:`matched` and
+   is set to a truncated form of the name provided or alias dereferenced
+   for the lowest entry (object or alias) that was matched.
+
+
+.. exception:: ADMINLIMIT_EXCEEDED
+
+.. exception:: AFFECTS_MULTIPLE_DSAS
+
+.. exception:: ALIAS_DEREF_PROBLEM
+
+   A problem was encountered when dereferencing an alias.
+   (Sets the :const:`matched` field.)
+
+.. exception:: ALIAS_PROBLEM
+
+   An alias in the directory points to a nonexistent entry.
+   (Sets the :const:`matched` field.)
+
+.. exception:: ALREADY_EXISTS
+
+   The entry already exists. E.g. the *dn* specified with :meth:`add()`
+   already exists in the DIT.
+
+.. exception:: AUTH_UNKNOWN
+
+   The authentication method specified to :meth:`bind()` is not known.
+
+.. exception:: BUSY
+
+   The DSA is busy.
+
+.. exception:: CLIENT_LOOP
+
+.. exception:: COMPARE_FALSE
+
+   A compare operation returned false.
+   (This exception should never be seen because :meth:`compare()` returns
+   a boolean result.)
+
+.. exception:: COMPARE_TRUE
+
+   A compare operation returned true.
+   (This exception should never be seen because :meth:`compare()` returns
+   a boolean result.)
+
+.. exception:: CONFIDENTIALITY_REQUIRED
+
+   Indicates that the session is not protected by a protocol such
+   as Transport Layer Security (TLS), which provides session
+   confidentiality.
+
+.. exception:: CONNECT_ERROR
+
+.. exception:: CONSTRAINT_VIOLATION
+
+   An attribute value specified or an operation started violates some
+   server-side constraint
+   (e.g., a postalAddress has too many lines or a line that is too long
+   or a password is expired).
+
+.. exception:: CONTROL_NOT_FOUND
+
+.. exception:: DECODING_ERROR
+
+   An error was encountered decoding a result from the LDAP server.
+
+.. exception:: ENCODING_ERROR
+
+   An error was encountered encoding parameters to send to the LDAP server.
+
+.. exception:: FILTER_ERROR
+
+   An invalid filter was supplied to :meth:`search()`
+   (e.g. unbalanced parentheses).
+
+.. exception:: INAPPROPRIATE_AUTH
+
+   Inappropriate authentication was specified (e.g. :const:`AUTH_SIMPLE`
+   was specified and the entry does not have a userPassword attribute).
+
+.. exception:: INAPPROPRIATE_MATCHING
+
+   Filter type not supported for the specified attribute.
+
+.. exception:: INSUFFICIENT_ACCESS
+
+   The user has insufficient access to perform the operation.
+
+.. exception:: INVALID_CREDENTIALS
+
+   Invalid credentials were presented during :meth:`bind()` or
+   :meth:`simple_bind()`.
+   (e.g., the wrong password).
+
+.. exception:: INVALID_DN_SYNTAX
+
+   A syntactically invalid DN was specified. (Sets the :const:`matched` field.)
+
+.. exception:: INVALID_SYNTAX
+
+   An attribute value specified by the client did not comply to the
+   syntax defined in the server-side schema.
+
+.. exception:: IS_LEAF
+
+   The object specified is a leaf of the diretcory tree.
+   Sets the :const:`matched` field of the exception dictionary value.
+
+.. exception:: LOCAL_ERROR
+
+   Some local error occurred. This is usually due to failed memory allocation.
+
+.. exception:: LOOP_DETECT
+
+   A loop was detected.
+
+.. exception:: MORE_RESULTS_TO_RETURN
+
+.. exception:: NAMING_VIOLATION
+
+   A naming violation occurred. This is raised e.g. if the LDAP server
+   has constraints about the tree naming.
+
+.. exception:: NO_OBJECT_CLASS_MODS
+
+   Modifying the objectClass attribute as requested is not allowed
+   (e.g. modifying structural object class of existing entry).
+
+.. exception:: NOT_ALLOWED_ON_NONLEAF
+
+   The operation is not allowed on a non-leaf object.
+
+.. exception:: NOT_ALLOWED_ON_RDN
+
+   The operation is not allowed on an RDN.
+
+.. exception:: NOT_SUPPORTED
+
+.. exception:: NO_MEMORY
+
+.. exception:: NO_OBJECT_CLASS_MODS
+
+   Object class modifications are not allowed.
+
+.. exception:: NO_RESULTS_RETURNED
+
+.. exception:: NO_SUCH_ATTRIBUTE
+
+   The attribute type specified does not exist in the entry.
+
+.. exception:: NO_SUCH_OBJECT
+
+   The specified object does not exist in the directory.
+   Sets the :const:`matched` field of the exception dictionary value.
+
+.. exception:: OBJECT_CLASS_VIOLATION
+
+   An object class violation occurred when the LDAP server checked
+   the data sent by the client against the server-side schema
+   (e.g. a "must" attribute was missing in the entry data).
+
+.. exception:: OPERATIONS_ERROR
+
+   An operations error occurred.
+
+.. exception:: OTHER
+
+   An unclassified error occurred.
+
+.. exception:: PARAM_ERROR
+
+   An ldap routine was called with a bad parameter.
+
+.. exception:: PARTIAL_RESULTS
+
+   Partial results only returned. This exception is raised if
+   a referral is received when using LDAPv2.
+   (This exception should never be seen with LDAPv3.)
+
+.. exception:: PROTOCOL_ERROR
+
+   A violation of the LDAP protocol was detected.
+
+.. exception:: RESULTS_TOO_LARGE
+
+   The result does not fit into a UDP packet. This happens only when using
+   UDP-based CLDAP (connection-less LDAP) which is not supported anyway.
+
+.. exception:: SASL_BIND_IN_PROGRESS
+
+.. exception:: SERVER_DOWN
+
+   The  LDAP  library  can't  contact the LDAP server.
+
+.. exception:: SIZELIMIT_EXCEEDED
+
+   An LDAP size limit was exceeded.
+   This could be due to a ``sizelimit`` configuration on the LDAP server.
+
+.. exception:: STRONG_AUTH_NOT_SUPPORTED
+
+   The LDAP server does not support strong authentication.
+
+.. exception:: STRONG_AUTH_REQUIRED
+
+   Strong authentication is required  for the operation.
+
+.. exception:: TIMELIMIT_EXCEEDED
+
+   An LDAP time limit was exceeded.
+
+.. exception:: TIMEOUT
+
+   A timelimit was exceeded while waiting for a result from the server.
+
+.. exception:: TYPE_OR_VALUE_EXISTS
+
+   An  attribute  type or attribute value specified already 
+   exists in the entry.
+
+.. exception:: UNAVAILABLE
+
+   The DSA is unavailable.
+
+.. exception:: UNAVAILABLE_CRITICAL_EXTENSION
+
+   Indicates that the LDAP server was unable to satisfy a request
+   because one or more critical extensions were not available. Either
+   the server does not support the control or the control is not appropriate
+   for the operation type.
+
+.. exception:: UNDEFINED_TYPE
+
+   An attribute type used is not defined in the server-side schema.
+
+.. exception:: UNWILLING_TO_PERFORM
+
+   The  DSA is  unwilling to perform the operation.
+
+.. exception:: USER_CANCELLED
+
+   The operation was cancelled via the :meth:`abandon()` method.
+
+The above exceptions are raised when a result code from an underlying API
+call does not indicate success.
+
+
+.. _ldap-objects:
+
+LDAPObject class
+================
+
+.. % This label is generally useful for referencing this section, but is
+.. % also used to give a filename when generating HTML.
+
+.. %\noindent
+
+Instances of :class:`ldap.LDAPObject` are returned by :func:`initialize()`
+and :func:`open()` (deprecated). The connection is automatically unbound
+and closed  when the LDAP object is deleted.
+
+Arguments for LDAPv3 controls
+-----------------------------
+
+The :mod:`ldap.controls` module can be used for constructing and
+decoding LDAPv3 controls. These arguments are available in the methods
+with names ending in :const:`_ext` or :const:`_ext_s`:
+
+*serverctrls*
+  is a list of :class:`LDAPControl` instances sent to the server along
+  with the LDAP request (see module :mod:`ldap.controls`). These are
+  controls which alter the behaviour of the server when processing the
+  request if the control is supported by the server. The effect of controls
+  might differ depending on the type of LDAP request or controls might not
+  be applicable with certain LDAP requests at all.
+
+*clientctrls*
+  is a list of :class:`LDAPControl` instances passed to the
+  client API and alter the behaviour of the client when processing the
+  request.
+
+
+Sending LDAP requests
+---------------------
+
+Most methods on LDAP objects initiate an asynchronous request to the
+LDAP server and return a message id that can be used later to retrieve
+the result with :meth:`result()`.
+
+Methods with names ending in :const:`_s` are the synchronous form 
+and wait for and return with the server's result, or with
+:const:`None` if no data is expected.
+
+LDAPObject instances have the following methods:
+
+.. %%------------------------------------------------------------
+.. %% abandon
+.. method:: LDAPObject.abandon(msgid)
+
+.. method:: LDAPObject.abandon_ext(msgid [, serverctrls=None [, clientctrls=None]])
+
+   Abandons an LDAP operation in progress without waiting for a LDAP response.
+   The *msgid* argument should be the message ID of an outstanding LDAP
+   operation as returned by the asynchronous methods :meth:`search()`, :meth:`modify()`, etc. 
+   The caller can expect that the result of an abandoned operation will not be
+   returned from a future call to :meth:`result()`.
+
+   *serverctrls* and *clientctrls* like described above.
+
+
+.. %%------------------------------------------------------------
+.. %% add
+.. method:: LDAPObject.add(dn, modlist)
+
+   .. % -> int
+
+.. method:: LDAPObject.add_s(dn, modlist)
+
+   .. % -> None
+
+.. method:: LDAPObject.add_ext(dn, modlist [, serverctrls=None [, clientctrls=None]]) 
+
+   .. % -> int
+
+.. method:: LDAPObject.add_ext_s(dn, modlist [, serverctrls=None [, clientctrls=None]])
+
+   ..  % -> None
+
+   Performs an LDAP add operation. The *dn* argument is the distinguished
+   name (DN) of the entry to add, and *modlist* is a list of attributes to be
+   added. The modlist is similar the one passed to :meth:`modify()`, except that the
+   operation integer is omitted from the tuples in modlist. You might want to
+   look into sub-module \refmodule{ldap.modlist} for generating the modlist.
+
+   The asynchronous methods :meth:`add()` and :meth:`add_ext()`
+   return the message ID of the initiated request.
+   
+   *serverctrls* and *clientctrls* like described above.
+
+.. %%------------------------------------------------------------
+.. %% bind
+.. method:: LDAPObject.bind(who, cred, method)
+
+   .. % -> int
+
+.. method:: LDAPObject.bind_s(who, cred, method)
+
+   .. % -> None
+
+.. method:: LDAPObject.simple_bind([who='' [, cred='']])
+
+   .. % -> int
+
+.. method:: LDAPObject.simple_bind_s([who='' [, cred='']])
+
+   ..  % -> None
+
+   After an LDAP object is created, and before any other operations can be
+   attempted over the connection, a bind operation must be performed.
+
+   This method attempts to bind with the LDAP server using 
+   either simple authentication, or Kerberos (if available).
+   The first and most general method, :meth:`bind()`,
+   takes a third parameter, *method* which can currently solely
+   be :const:`AUTH_SIMPLE`.
+   
+
+.. %%------------------------------------------------------------
+.. %% sasl_interactive_bind_s
+.. method:: LDAPObject.sasl_interactive_bind_s(who, auth)
+
+   .. % -> None
+
+   This call is used to bind to the directory with a SASL bind request.
+
+
+.. %%------------------------------------------------------------
+.. %% cancel
+.. method:: LDAPObject.cancel( cancelid, [, serverctrls=None [, clientctrls=None]])
+
+   Send cancels extended operation for an LDAP operation specified by *cancelid*.
+   The *cancelid* should be the message id of an outstanding LDAP operation as returned
+   by the asynchronous methods search(), modify() etc.  The caller
+   can expect that the result of an abandoned operation will not be
+   returned from a future call to :meth:`result()`.
+   In opposite to :meth:`abandon()` this extended operation gets an result from
+   the server and thus should be preferred if the server supports it.
+
+   *serverctrls* and *clientctrls* like described above.
+
+   :rfc:`3909` - Lightweight Directory Access Protocol (LDAP): Cancel Operation
+
+
+.. %%------------------------------------------------------------
+.. %% compare
+.. method:: LDAPObject.compare(dn, attr, value)
+
+   .. % -> int
+
+.. method:: LDAPObject.compare_s(dn, attr, value)
+
+   .. % -> tuple
+
+.. method:: LDAPObject.compare_ext(dn, attr, value [, serverctrls=None [, clientctrls=None]])
+
+   .. % -> int
+
+.. method:: LDAPObject.compare_ext_s(dn, attr, value [, serverctrls=None [, clientctrls=None]])
+
+   .. % -> tuple
+
+   Perform an LDAP comparison between the attribute named *attr* of 
+   entry *dn*, and the value *value*. The synchronous forms
+   returns :const:`0` for false, or :const:`1` for true.
+   The asynchronous forms returns the message ID of the initiated request, 
+   and the result of the asynchronous compare can be obtained using 
+   :meth:`result()`.  
+
+   Note that the asynchronous technique yields the answer
+   by raising the exception objects :exc:`ldap.COMPARE_TRUE` or
+   :exc:`ldap.COMPARE_FALSE`.
+
+   *serverctrls* and *clientctrls* like described above.
+
+   .. note::
+   
+      A design fault in the LDAP API prevents *value* 
+      from containing nul characters.
+
+.. %%------------------------------------------------------------
+.. %% delete
+.. method:: LDAPObject.delete(dn)
+
+   .. % -> int
+
+.. method::  LDAPObject.delete_s(dn)
+
+   .. % -> None
+
+.. method:: LDAPObject.delete_ext(dn [, serverctrls=None [, clientctrls=None]])
+
+   .. % -> int
+
+.. method:: LDAPObject.delete_ext_s(dn [, serverctrls=None [, clientctrls=None]])
+
+   .. % -> None
+
+   Performs an LDAP delete operation on *dn*. The asynchronous form
+   returns the message id of the initiated request, and the result can be obtained
+   from a subsequent call to :meth:`result()`.
+
+   *serverctrls* and *clientctrls* like described above.
+
+.. %%------------------------------------------------------------
+.. %% modify
+.. method:: LDAPObject.modify(dn, modlist)
+
+   .. % -> int
+
+.. method:: LDAPObject.modify_s(dn, modlist)
+
+   .. % -> None
+
+.. method:: LDAPObject.modify_ext(dn, modlist [, serverctrls=None [, clientctrls=None]])
+
+   .. % -> int
+
+.. method:: LDAPObject.modify_ext_s(dn, modlist [, serverctrls=None [, clientctrls=None]])
+
+   .. % -> None
+
+   Performs an LDAP modify operation on an entry's attributes. 
+   The *dn* argument is the distinguished name (DN) of the entry to modify,
+   and *modlist* is a list of modifications to make to that entry.
+
+   Each element in the list *modlist* should be a tuple of the form 
+   *(mod_op,mod_type,mod_vals)*,
+   where *mod_op* indicates the operation (one of :const:`MOD_ADD`, 
+   :const:`MOD_DELETE`, or :const:`MOD_REPLACE`),
+   *mod_type* is a string indicating the attribute type name, and 
+   *mod_vals* is either a string value or a list of string values to add, 
+   delete or replace respectively.  For the delete operation, *mod_vals*
+   may be :const:`None` indicating that all attributes are to be deleted.
+
+   *serverctrls* and *clientctrls* like described above.
+
+   The asynchronous methods :meth:`modify()` and :meth:`modify_ext()`
+   return the message ID of the initiated request.
+
+   You might want to look into sub-module :mod:`ldap.modlist` for
+   generating *modlist*.
+
+
+.. %%------------------------------------------------------------
+.. %% modrdn
+.. method:: LDAPObject.modrdn(dn, newrdn [, delold=1])
+
+   .. %-> int
+
+
+.. method::  LDAPObject.modrdn_s(dn, newrdn [, delold=1])
+
+   .. % -> None
+
+   Perform a ``modify RDN`` operation, (i.e. a renaming operation).
+   These routines take *dn* (the DN of the entry whose RDN is to be changed,
+   and *newrdn*, the new RDN to give to the entry. The optional parameter
+   *delold* is used to specify whether the old RDN should be kept as an
+   attribute of the entry or not.
+   The asynchronous version returns the initiated message id.
+
+   This operation is emulated by :meth:`rename()` and :meth:`rename_s()` methods
+   since the modrdn2* routines in the C library are deprecated.
+
+
+.. %%------------------------------------------------------------
+.. %% passwd
+.. method:: LDAPObject.passwd(user, oldpw, newpw [, serverctrls=None [, clientctrls=None]])
+
+   .. %-> int
+
+.. method:: LDAPObject.passwd_s(user, oldpw, newpw [, serverctrls=None [, clientctrls=None]])
+
+   .. % -> None
+
+   Perform a ``LDAP Password Modify Extended Operation`` operation
+   on the entry specified by *user*.
+   The old password in *oldpw* is replaced with the new
+   password in *newpw* by a LDAP server supporting this operation.
+
+   *serverctrls* and *clientctrls* like described above.
+
+   The asynchronous version returns the initiated message id.
+
+   .. seealso::
+
+      :rfc:`3062` - LDAP Password Modify Extended Operation
+
+
+
+.. %%------------------------------------------------------------
+.. %% rename
+.. method:: LDAPObject.rename(dn, newrdn [, newsuperior=None [, delold=1 [, serverctrls=None [, clientctrls=None]]]])
+
+   ..  %-> int
+
+.. method:: LDAPObject.rename_s(dn, newrdn [, newsuperior=None [, delold=1 [, serverctrls=None [, clientctrls=None]]]])
+
+   ..  % -> None
+
+   Perform a ``Rename`` operation, (i.e. a renaming operation).
+   These routines take *dn* (the DN of the entry whose RDN is to be changed,
+   and *newrdn*, the new RDN to give to the entry.
+   The optional parameter *newsuperior* is used to specify
+   a new parent DN for moving an entry in the tree
+   (not all LDAP servers support this).
+   The optional parameter *delold* is used to specify
+   whether the old RDN should be kept as an attribute of the entry or not.
+
+   *serverctrls* and *clientctrls* like described above.
+
+.. %%------------------------------------------------------------
+.. %% result
+.. method:: LDAPObject.result([msgid=RES_ANY [, all=1 [, timeout=-1]]])
+
+   .. % -> 2-tuple
+
+   This method is used to wait for and return the result of an operation
+   previously initiated by one of the LDAP *asynchronous* operations
+   (eg :meth:`search()`, :meth:`modify()`, etc.) 
+
+   The *msgid* parameter is the integer identifier returned by that method. 
+   The identifier is guaranteed to be unique across an LDAP session,
+   and tells the :meth:`result()` method to request the result of that
+   specific operation.
+
+   If a result is desired from any one of the in-progress operations,
+   *msgid* should be specified as the constant :const:`RES_ANY`
+   and the method :meth:`result2()` should be used instead.
+
+   The *all* parameter only has meaning for :meth:`search()` responses
+   and is used to select whether a single entry of the search
+   response should be returned, or to wait for all the results
+   of the search before returning.
+
+   A search response is made up of zero or more search entries
+   followed by a search result. If *all* is 0, search entries will
+   be returned one at a time as they come in, via separate calls
+   to :meth:`result()`. If all is 1, the search response will be returned
+   in its entirety, i.e. after all entries and the final search
+   result have been received.
+
+   For *all* set to 0, result tuples
+   trickle in (with the same message id), and with the result types
+   :const:`RES_SEARCH_ENTRY` and :const:`RES_SEARCH_REFERENCE`,
+   until the final result which has a result type of :const:`RES_SEARCH_RESULT`
+   and a (usually) empty data field.  When all is set to 1, only one result is returned,
+   with a result type of RES_SEARCH_RESULT, and all the result tuples
+   listed in the data field.
+
+   The *timeout* parameter is a limit on the number of seconds that the
+   method will wait for a response from the server. 
+   If *timeout* is negative (which is the default),
+   the method will wait indefinitely for a response.
+   The timeout can be expressed as a floating-point value, and
+   a value of :const:`0` effects a poll.
+   If a timeout does occur, a :exc:`ldap.TIMEOUT` exception is raised,
+   unless polling, in which case ``(None, None)`` is returned.
+
+   The :meth:`result()` method returns a tuple of the form 
+   ``(result-type, result-data)``.
+   The first element, ``result-type`` is a string, being one of
+   these module constants:
+   :const:`RES_BIND`, :const:`RES_SEARCH_ENTRY`,
+   :const:`RES_SEARCH_REFERENCE`, :const:`RES_SEARCH_RESULT`, 
+   :const:`RES_MODIFY`, :const:`RES_ADD`, :const:`RES_DELETE`, 
+   :const:`RES_MODRDN`, or :const:`RES_COMPARE`.
+
+   If *all* is :const:`0`, one response at a time is returned on
+   each call to :meth:`result()`, with termination indicated by 
+   ``result-data`` being an empty list.
+
+   See :meth:`search()` for a description of the search result's 
+   ``result-data``, otherwise the ``result-data`` is normally meaningless.
+
+
+
+.. %%------------------------------------------------------------
+.. %% result2
+.. method:: LDAPObject.result2([msgid=RES_ANY [, all=1 [, timeout=-1]]])
+
+   .. % -> 3-tuple
+
+   This method behaves almost exactly like :meth:`result()`. But
+   it returns a 3-tuple also containing the message id of the
+   outstanding LDAP operation a particular result message belongs
+   to. This is especially handy if one needs to dispatch results
+   obtained with ``msgid=``:const:`RES_ANY` to several consumer
+   threads which invoked a particular LDAP operation.
+
+
+.. %%------------------------------------------------------------
+.. %% result3
+.. method:: LDAPObject.result3([msgid=RES_ANY [, all=1 [, timeout=-1]]])
+
+   .. % -> 4-tuple
+
+   This method behaves almost exactly like :meth:`result2()`. But it
+   returns an extra item in the tuple, the decoded server controls.
+
+
+.. %%------------------------------------------------------------
+.. %% search
+.. method:: LDAPObject.search(base, scope [,filterstr='(objectClass=*)' [, attrlist=None [, attrsonly=0]]])
+   
+   ..  %->int
+
+.. method:: LDAPObject.search_s(base, scope [,filterstr='(objectClass=*)' [, attrlist=None [, attrsonly=0]]])
+
+   .. %->list|None
+
+.. method:: LDAPObject.search_st(base, scope [,filterstr='(objectClass=*)' [, attrlist=None [, attrsonly=0 [, timeout=-1]]]])
+
+.. method:: LDAPObject.search_ext(base, scope [,filterstr='(objectClass=*)' [, attrlist=None [, attrsonly=0 [, serverctrls=None [, clientctrls=None [, timeout=-1 [, sizelimit=0]]]]]]])
+
+   ..  %->int
+
+.. method:: LDAPObject.search_ext_s(base, scope [,filterstr='(objectClass=*)' [, attrlist=None [, attrsonly=0 [, serverctrls=None [, clientctrls=None [, timeout=-1 [, sizelimit=0]]]]]]])
+
+   .. %->list|None
+
+   Perform an LDAP search operation, with *base* as the DN of the entry
+   at which to start the search, *scope* being one of 
+   :const:`SCOPE_BASE` (to search the object itself), 
+   :const:`SCOPE_ONELEVEL` (to search the object's immediate children), or
+   :const:`SCOPE_SUBTREE` (to search the object and all its descendants).
+
+   The *filterstr* argument is a string representation of the filter to apply in
+   the search.
+
+   .. seealso:: 
+
+      :rfc:`4515` - Lightweight Directory Access Protocol (LDAP): String Representation of Search Filters.
+
+
+   Each result tuple is of the form ``(dn, attrs)``, 
+   where *dn* is a string containing the DN (distinguished name) of the
+   entry, and *attrs* is a dictionary containing the attributes associated
+   with the entry. The keys of *attrs* are strings, and the associated
+   values are lists of strings.
+
+   The DN in *dn* is automatically extracted using the underlying libldap
+   function :cfunc:`ldap_get_dn()`, which may raise an exception if the
+   DN is malformed.
+
+   If *attrsonly* is non-zero, the values of *attrs* will be meaningless
+   (they are not transmitted in the result).
+
+   The retrieved attributes can be limited with the *attrlist* parameter.
+   If *attrlist* is :const:`None`, all the attributes of each entry are returned.
+
+   *serverctrls* and *clientctrls* like described above.
+
+   The synchronous form with timeout, :meth:`search_st()` or :meth:`search_ext_s()`,
+   will block for at most *timeout* seconds (or indefinitely if *timeout*
+   is negative). A :exc:`ldap.TIMEOUT` exception is raised if no result is received
+   within the specified time.
+
+   The amount of search results retrieved can be limited with the
+   *sizelimit* parameter when using :meth:`search_ext()`
+   or :meth:`search_ext_s()` (client-side search limit). If non-zero
+   not more than *sizelimit* results are returned by the server.
+
+
+
+.. %%------------------------------------------------------------
+.. %% start_tls_s
+.. method:: LDAPObject.start_tls_s()
+
+   .. % -> None    
+
+    Negotiate TLS with server. The ``version`` attribute must have been
+    set to :const:`VERSION3` (which it is by default) before calling this method.
+    If TLS could not be started an exception will be raised.
+
+   .. seealso::
+
+      :rfc:`2830` - Lightweight Directory Access Protocol (v3): Extension for Transport Layer Security
+
+
+
+.. %%------------------------------------------------------------
+.. %% unbind
+.. method:: LDAPObject.unbind()
+
+   .. % -> int
+
+.. method:: LDAPObject.unbind_s()
+
+   .. % -> None
+
+.. method:: LDAPObject.unbind_ext([, serverctrls=None [, clientctrls=None]])
+
+   .. % -> int
+
+.. method:: LDAPObject.unbind_ext_s([, serverctrls=None [, clientctrls=None]])
+
+   .. % -> None
+
+   This call is used to unbind from the directory, terminate the
+   current association, and free resources. Once called, the connection to the
+   LDAP server is closed and the LDAP object is marked invalid.
+   Further invocation of methods on the object will yield exceptions.
+
+   *serverctrls* and *clientctrls* like described above.
+
+   These methods are all synchronous in nature.
+
+
+.. %%------------------------------------------------------------
+.. %% whoami_s
+.. method:: LDAPObject.whoami_s()
+
+   .. % -> string
+
+   This synchronous method implements the LDAP "Who Am I?"
+   extended operation.
+
+   It is useful for finding out to find out which identity
+   is assumed by the LDAP server after a SASL bind.
+
+   .. seealso::
+
+      :rfc:`4532` - Lightweight Directory Access Protocol (LDAP) "Who am I?" Operation
+
+
+Connection-specific LDAP options
+--------------------------------
+
+.. %%------------------------------------------------------------
+.. %% get_option
+.. method:: LDAPObject.get_option(option)
+
+   .. % -> None
+
+   This method returns the value of the LDAPObject option
+   specified by *option*.
+
+
+.. %%------------------------------------------------------------
+.. %% set_option
+.. method:: LDAPObject.set_option(option, invalue)
+
+   .. % -> None
+
+   This method sets the value of the LDAPObject option
+   specified by *option* to *invalue*.
+
+
+Object attributes
+-----------------
+
+If the underlying library provides enough information,
+each LDAP object will also have the following attributes.
+These attributes are mutable unless described as read-only.
+
+.. %%------------------------------------------------------------
+.. %% deref
+.. attribute:: LDAPObject.deref
+
+   .. % -> int
+
+   Controls whether aliases are automatically dereferenced.
+   This must be one of :const:`DEREF_NEVER`, :const:`DEREF_SEARCHING`, :const:`DEREF_FINDING`,
+   or :const:`DEREF_ALWAYS`.
+   This option is mapped to option constant :const:`OPT_DEREF`
+   and used in the underlying OpenLDAP lib.
+
+
+.. %%------------------------------------------------------------
+.. %% network_timeout
+.. attribute:: LDAPObject.network_timeout
+
+   .. % -> int
+
+   Limit on waiting for a network response, in seconds. 
+   Defaults to :const:`NO_LIMIT`.
+   This option is mapped to option constant :const:`OPT_NETWORK_TIMEOUT`
+   and used in the underlying OpenLDAP lib.
+
+
+.. %%------------------------------------------------------------
+.. %% protocol_version
+.. attribute:: LDAPObject.protocol_version
+
+   .. % -> int
+
+   Version of LDAP in use (either :const:`VERSION2` for LDAPv2
+   or :const:`VERSION3` for LDAPv3).
+   This option is mapped to option constant :const:`OPT_PROTOCOL_VERSION`
+   and used in the underlying OpenLDAP lib.
+
+   .. note::
+
+      It is highly recommended to set the protocol version after establishing
+      a LDAP connection with :func:`initialize()` and before submitting
+      the first request.
+      
+
+.. %%------------------------------------------------------------
+.. %% sizelimit
+.. attribute:: LDAPObject.sizelimit
+
+   .. % -> int
+
+   Limit on size of message to receive from server. 
+   Defaults to :const:`NO_LIMIT`.
+   This option is mapped to option constant :const:`OPT_SIZELIMIT`
+   and used in the underlying OpenLDAP lib. Its use is deprecated
+   in favour of *sizelimit* parameter when using :meth:`search_ext()`.
+
+
+.. %%------------------------------------------------------------
+.. %% timelimit
+.. attribute:: LDAPObject.timelimit
+
+   .. % -> int
+
+   Limit on waiting for any response, in seconds. 
+   Defaults to :const:`NO_LIMIT`.
+   This option is mapped to option constant :const:`OPT_TIMELIMIT`
+   and used in the underlying OpenLDAP lib. Its use is deprecated
+   in favour of using *timeout*.
+
+
+.. %%------------------------------------------------------------
+.. %% timeout
+.. attribute:: LDAPObject.timeout
+
+   .. % -> int
+
+   Limit on waiting for any response, in seconds. 
+   Defaults to :const:`NO_LIMIT`.
+   This option is used in the wrapper module.
+
+
+.. _ldap-example:
+
+Example
+=======
+
+The following example demonstrates how to open a connection to an
+LDAP server using the :mod:`ldap` module and invoke a synchronous
+subtree search.
+
+>>> import ldap
+>>> l = ldap.initialize('ldap://localhost:1390')
+>>> l.search_s('ou=Testing,dc=stroeder,dc=de',ldap.SCOPE_SUBTREE,'(cn=fred*)',['cn','mail'])
+[('cn=Fred Feuerstein,ou=Testing,dc=stroeder,dc=de', {'cn': ['Fred Feuerstein']})]
+>>> r = l.search_s('ou=Testing,dc=stroeder,dc=de',ldap.SCOPE_SUBTREE,'(objectClass=*)',['cn','mail'])
+>>> for dn,entry in r:
+>>>   print 'Processing',repr(dn)
+>>>   handle_ldap_entry(entry)
+
+

+ 28 - 34
desktop/core/ext-py/python-ldap-2.4.6/Doc/ldapurl.rst → desktop/core/ext-py/python-ldap-2.3.13/Doc/ldapurl.rst

@@ -1,10 +1,10 @@
-.. % $Id: ldapurl.rst,v 1.9 2011/07/22 13:27:01 stroeder Exp $
+.. % $Id: ldapurl.rst,v 1.5 2010/02/05 13:13:19 stroeder Exp $
 
 
-###################################
-:py:mod:`ldapurl` LDAP URL handling
-###################################
+################################
+:mod:`ldapurl` LDAP URL handling
+################################
 
 
-.. py:module:: ldapurl
+.. module:: ldapurl
    :synopsis: Parses and generates LDAP URLs
    :synopsis: Parses and generates LDAP URLs
 .. moduleauthor:: python-ldap project (see http://www.python-ldap.org/)
 .. moduleauthor:: python-ldap project (see http://www.python-ldap.org/)
 
 
@@ -19,75 +19,69 @@ module has been solely tested on Python 2.x and above.
    :rfc:`4516` - The LDAP URL Format
    :rfc:`4516` - The LDAP URL Format
 
 
 
 
-Constants
-=========
-
 The :mod:`ldapurl` module exports the following constants:
 The :mod:`ldapurl` module exports the following constants:
 
 
-.. py:data:: SEARCH_SCOPE
+.. data:: SEARCH_SCOPE
 
 
    This dictionary maps a search scope string identifier  to the corresponding
    This dictionary maps a search scope string identifier  to the corresponding
    integer value used with search operations  in :mod:`ldap`.
    integer value used with search operations  in :mod:`ldap`.
 
 
 
 
-.. py:data:: SEARCH_SCOPE_STR
+.. data:: SEARCH_SCOPE_STR
 
 
    This dictionary is the inverse to :const:`SEARCH_SCOPE`. It  maps a search scope
    This dictionary is the inverse to :const:`SEARCH_SCOPE`. It  maps a search scope
    integer value to the corresponding string identifier  used in a LDAP URL string
    integer value to the corresponding string identifier  used in a LDAP URL string
    representation.
    representation.
 
 
 
 
-.. py:data:: LDAP_SCOPE_BASE
-
-
-.. py:data:: LDAP_SCOPE_ONELEVEL
+.. data:: LDAP_SCOPE_BASE
 
 
 
 
-.. py:data:: LDAP_SCOPE_SUBTREE
+.. data:: LDAP_SCOPE_ONELEVEL
 
 
 
 
-Functions
-=========
+.. data:: LDAP_SCOPE_SUBTREE
 
 
-.. autofunction:: ldapurl.isLDAPUrl
 
 
 
 
-.. autofunction:: ldapurl.ldapUrlEscape
+.. _ldapurl-ldapurl:
 
 
+LDAPUrl Objects
+^^^^^^^^^^^^^^^^
 
 
-Classes
-=======
+A :class:`LDAPUrl` object represents a complete LDAP URL.
 
 
-.. _ldapurl-ldapurl:
+All class methods:
 
 
-LDAP URLs
-^^^^^^^^^
+Class attributes:
 
 
-A :py:class:`LDAPUrl` object represents a complete LDAP URL.
+Instance attributes:
 
 
+.. Here the actual docstring could be used provided it is fixed according rst rules
 .. autoclass:: ldapurl.LDAPUrl 
 .. autoclass:: ldapurl.LDAPUrl 
 
 
 
 
-LDAP URL extensions
-^^^^^^^^^^^^^^^^^^^
+.. _ldapurl-ldapurlextension:
 
 
-A :py:class:`LDAPUrlExtension` object represents a single LDAP URL extension
-whereas :py:class:`LDAPUrlExtensions` represents a list of LDAP URL extensions.
+LDAPUrlExtension Objects
+^^^^^^^^^^^^^^^^^^^^^^^^
 
 
+A :class:`LDAPUrlExtension` object represents a single LDAP URL extension.
 
 
-.. _ldapurl-ldapurlextension:
+All class methods:
 
 
-.. autoclass:: ldapurl.LDAPUrlExtension
+Class attributes:
 
 
-.. _ldapurl-ldapurlextensions:
+Instance attributes:
 
 
-.. autoclass:: ldapurl.LDAPUrlExtensions
+.. Here the actual docstring could be used provided it is fixed according rst rules
+.. autoclass:: ldapurl.LDAPUrlExtension
 
 
 
 
 .. _ldapurl-example:
 .. _ldapurl-example:
 
 
 Example
 Example
-^^^^^^^
+^^^^^^^^
 
 
 Important security advice:
 Important security advice:
 For security reasons you shouldn't specify passwords in LDAP URLs
 For security reasons you shouldn't specify passwords in LDAP URLs

+ 5 - 25
desktop/core/ext-py/python-ldap-2.4.6/Doc/ldif.rst → desktop/core/ext-py/python-ldap-2.3.13/Doc/ldif.rst

@@ -1,17 +1,17 @@
-.. % $Id: ldif.rst,v 1.8 2011/09/14 18:29:18 stroeder Exp $
+.. % $Id: ldif.rst,v 1.6 2011/02/19 13:04:41 stroeder Exp $
 
 
 #####################################
 #####################################
 :mod:`ldif` LDIF parser and generator
 :mod:`ldif` LDIF parser and generator
 #####################################
 #####################################
 
 
-.. py:module:: ldif
+.. module:: ldif
    :synopsis: Parses and generates LDIF files
    :synopsis: Parses and generates LDIF files
 .. moduleauthor:: python-ldap project (see http://www.python-ldap.org/)
 .. moduleauthor:: python-ldap project (see http://www.python-ldap.org/)
 
 
 
 
 This module parses and generates LDAP data in the format LDIF.    It is
 This module parses and generates LDAP data in the format LDIF.    It is
-implemented in pure Python and does not rely on any non-standard modules.
-Therefore it can be used stand-alone without the rest of the python-ldap
+implemented in pure Python and does not rely on any  non-standard modules.
+Therefore it can be used stand-alone without  the rest of the python-ldap
 package.
 package.
 
 
 .. seealso::
 .. seealso::
@@ -19,30 +19,10 @@ package.
    :rfc:`2849` - The LDAP Data Interchange Format (LDIF) - Technical Specification
    :rfc:`2849` - The LDAP Data Interchange Format (LDIF) - Technical Specification
 
 
 
 
-Functions
-^^^^^^^^^
-
-.. autofunction:: ldif.CreateLDIF
-
-.. autofunction:: ldif.ParseLDIF
-
-
-Classes
-^^^^^^^
-
-.. autoclass:: ldif.LDIFWriter
-
-.. autoclass:: ldif.LDIFParser
-
-.. autoclass:: LDIFRecordList
-
-.. autoclass:: LDIFCopy
-
-
 .. _ldif-example:
 .. _ldif-example:
 
 
 Example
 Example
-^^^^^^^
+^^^^^^^^
 
 
 The following example demonstrates how to write LDIF output
 The following example demonstrates how to write LDIF output
 of an LDAP entry with :mod:`ldif` module.
 of an LDAP entry with :mod:`ldif` module.

+ 5 - 6
desktop/core/ext-py/python-ldap-2.4.6/INSTALL → desktop/core/ext-py/python-ldap-2.3.13/INSTALL

@@ -8,21 +8,20 @@ Prerequisites:
 
 
     - Python 2.3 or newer (see http://www.python.org)
     - Python 2.3 or newer (see http://www.python.org)
 
 
-    - OpenLDAP 2.4.11+ client libs (see http://www.openldap.org)
-      It is not possible and not supported
+    - OpenLDAP libs (see http://www.openldap.org)
+      You need OpenLDAP 2.3.x client libs or newer for full
+      functionality. It is not possible and not supported
       by the python-ldap project to build with prior versions.
       by the python-ldap project to build with prior versions.
 
 
-  Optional dependencies of OpenLDAP libs:
+  Optional:
 
 
     - Cyrus SASL 2.1.x or newer (see http://asg.web.cmu.edu/sasl/sasl-library.html)
     - Cyrus SASL 2.1.x or newer (see http://asg.web.cmu.edu/sasl/sasl-library.html)
 
 
     - OpenSSL 0.9.7 or newer (see http://www.openssl.org)
     - OpenSSL 0.9.7 or newer (see http://www.openssl.org)
-    
-    - MIT Kerberos or heimdal libs
 
 
 Quick build instructions:
 Quick build instructions:
     edit setup.cfg (see Build/ for platform-specific examples)
     edit setup.cfg (see Build/ for platform-specific examples)
     python setup.py build
     python setup.py build
     python setup.py install
     python setup.py install
 
 
-$Id: INSTALL,v 1.10 2011/04/02 22:30:55 stroeder Exp $
+$Id: INSTALL,v 1.9 2008/06/19 08:56:03 stroeder Exp $

+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/LICENCE → desktop/core/ext-py/python-ldap-2.3.13/LICENCE


+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Lib/.cvsignore → desktop/core/ext-py/python-ldap-2.3.13/Lib/.cvsignore


+ 40 - 36
desktop/core/ext-py/python-ldap-2.4.6/Lib/dsml.py → desktop/core/ext-py/python-ldap-2.3.13/Lib/dsml.py

@@ -4,16 +4,25 @@ dsml - generate and parse DSMLv1 data
 
 
 See http://www.python-ldap.org/ for details.
 See http://www.python-ldap.org/ for details.
 
 
-$Id: dsml.py,v 1.23 2011/11/27 15:27:00 stroeder Exp $
+$Id: dsml.py,v 1.16 2010/05/07 08:15:47 stroeder Exp $
 
 
 Python compability note:
 Python compability note:
 Tested with Python 2.0+.
 Tested with Python 2.0+.
 """
 """
 
 
-__version__ = '2.4.6'
+__version__ = '2.3.12'
 
 
 import string,base64
 import string,base64
 
 
+def list_dict(l):
+  """
+  return a dictionary with all items of l being the keys of the dictionary
+  """
+  d = {}
+  for i in l:
+    d[i]=None
+  return d
+
 
 
 special_entities = (
 special_entities = (
   ('&','&amp;'),
   ('&','&amp;'),
@@ -22,34 +31,29 @@ special_entities = (
   ("'",'&apos;'),
   ("'",'&apos;'),
 )
 )
 
 
-
 def replace_char(s):
 def replace_char(s):
   for char,entity in special_entities:
   for char,entity in special_entities:
     s = string.replace(s,char,entity)
     s = string.replace(s,char,entity)
   return s
   return s
 
 
-
 class DSMLWriter:
 class DSMLWriter:
-  """
-  Class for writing LDAP entry records to a DSMLv1 file.
-
-  Arguments:
-
-  f
-      File object for output.
-  base64_attrs
-      Attribute types to be base64-encoded.
-  dsml_comment
-      Text placed in comment lines behind <dsml:dsml>.
-  indent
-      String used for indentiation of next nested level.
-  """
 
 
   def __init__(
   def __init__(
     self,f,base64_attrs=[],dsml_comment='',indent='    '
     self,f,base64_attrs=[],dsml_comment='',indent='    '
   ):
   ):
+    """
+    Parameters:
+    f
+          File object for output.
+    base64_attrs
+          Attribute types to be base64-encoded.
+    dsml_comment
+          Text placed in comment lines behind <dsml:dsml>.
+    indent
+          String used for indentiation of next nested level.
+    """
     self._output_file = f
     self._output_file = f
-    self._base64_attrs = {}.fromkeys(map(string.lower,base64_attrs))
+    self._base64_attrs = list_dict(map(string.lower,base64_attrs))
     self._dsml_comment = dsml_comment
     self._dsml_comment = dsml_comment
     self._indent = indent
     self._indent = indent
 
 
@@ -86,7 +90,7 @@ class DSMLWriter:
     """
     """
     self._output_file.write('%s</dsml:directory-entries>\n' % (self._indent))
     self._output_file.write('%s</dsml:directory-entries>\n' % (self._indent))
     self._output_file.write('</dsml:dsml>\n')
     self._output_file.write('</dsml:dsml>\n')
-
+    
   def unparse(self,dn,entry):
   def unparse(self,dn,entry):
     return self.writeRecord(dn,entry)
     return self.writeRecord(dn,entry)
 
 
@@ -247,21 +251,8 @@ else:
     class and override method handle() to implement something meaningful.
     class and override method handle() to implement something meaningful.
 
 
     Public class attributes:
     Public class attributes:
-
     records_read
     records_read
-        Counter for records processed so far
-
-    Arguments:
-
-    input_file
-        File-object to read the DSMLv1 input from
-    ignored_attr_types
-        Attributes with these attribute type names will be ignored.
-    max_entries
-        If non-zero specifies the maximum number of entries to be
-        read from f.
-    line_sep
-        String used as line separator
+          Counter for records processed so far
     """
     """
 
 
     def __init__(
     def __init__(
@@ -271,9 +262,21 @@ else:
       ignored_attr_types=None,
       ignored_attr_types=None,
       max_entries=0,
       max_entries=0,
     ):
     ):
+      """
+      Parameters:
+      input_file
+          File-object to read the DSMLv1 input from
+      ignored_attr_types
+          Attributes with these attribute type names will be ignored.
+      max_entries
+          If non-zero specifies the maximum number of entries to be
+          read from f.
+      line_sep
+          String used as line separator
+      """
       self._input_file = input_file
       self._input_file = input_file
       self._max_entries = max_entries
       self._max_entries = max_entries
-      self._ignored_attr_types = {}.fromkeys(map(string.lower,(ignored_attr_types or [])))
+      self._ignored_attr_types = list_dict(map(string.lower,(ignored_attr_types or [])))
       self._current_record = None,None
       self._current_record = None,None
       self.records_read = 0
       self.records_read = 0
       self._parser = xml.sax.make_parser()
       self._parser = xml.sax.make_parser()
@@ -283,7 +286,7 @@ else:
 
 
     def handle(self,*args,**kwargs):
     def handle(self,*args,**kwargs):
       """
       """
-      Process a single DSMLv1 entry record. This method should be
+      Process a single content DSMLv1 record. This method should be
       implemented by applications using DSMLParser.
       implemented by applications using DSMLParser.
       """
       """
       import pprint
       import pprint
@@ -295,3 +298,4 @@ else:
       Continously read and parse DSML records
       Continously read and parse DSML records
       """
       """
       self._parser.parse(self._input_file)
       self._parser.parse(self._input_file)
+

+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Lib/ldap/.cvsignore → desktop/core/ext-py/python-ldap-2.3.13/Lib/ldap/.cvsignore


+ 3 - 5
desktop/core/ext-py/python-ldap-2.4.6/Lib/ldap/__init__.py → desktop/core/ext-py/python-ldap-2.3.13/Lib/ldap/__init__.py

@@ -3,12 +3,12 @@ ldap - base module
 
 
 See http://www.python-ldap.org/ for details.
 See http://www.python-ldap.org/ for details.
 
 
-$Id: __init__.py,v 1.78 2011/11/27 15:27:00 stroeder Exp $
+$Id: __init__.py,v 1.70 2011/02/19 14:36:53 stroeder Exp $
 """
 """
 
 
 # This is also the overall release version number
 # This is also the overall release version number
 
 
-__version__ = '2.4.6'
+__version__ = '2.3.13'
 
 
 import sys
 import sys
 
 
@@ -46,7 +46,7 @@ class LDAPLock:
   Note that this cumbersome approach with _lock attribute was taken
   Note that this cumbersome approach with _lock attribute was taken
   since threading.Lock is not suitable for sub-classing.
   since threading.Lock is not suitable for sub-classing.
   """
   """
-  _min_trace_level = 3
+  _min_trace_level = 2
 
 
   def __init__(self,lock_class=None,desc=''):
   def __init__(self,lock_class=None,desc=''):
     """
     """
@@ -60,14 +60,12 @@ class LDAPLock:
 
 
   def acquire(self):
   def acquire(self):
     if __debug__:
     if __debug__:
-      global _trace_level
       if _trace_level>=self._min_trace_level:
       if _trace_level>=self._min_trace_level:
         _trace_file.write('***%s %s.acquire()\n' % (self._desc,self.__class__.__name__))
         _trace_file.write('***%s %s.acquire()\n' % (self._desc,self.__class__.__name__))
     return self._lock.acquire()
     return self._lock.acquire()
 
 
   def release(self):
   def release(self):
     if __debug__:
     if __debug__:
-      global _trace_level
       if _trace_level>=self._min_trace_level:
       if _trace_level>=self._min_trace_level:
         _trace_file.write('***%s %s.release()\n' % (self._desc,self.__class__.__name__))
         _trace_file.write('***%s %s.release()\n' % (self._desc,self.__class__.__name__))
     return self._lock.release()
     return self._lock.release()

+ 39 - 29
desktop/core/ext-py/python-ldap-2.4.6/Lib/ldap/async.py → desktop/core/ext-py/python-ldap-2.3.13/Lib/ldap/async.py

@@ -3,7 +3,7 @@ ldap.async - handle async LDAP operations
 
 
 See http://www.python-ldap.org/ for details.
 See http://www.python-ldap.org/ for details.
 
 
-\$Id: async.py,v 1.32 2011/07/28 08:51:38 stroeder Exp $
+\$Id: async.py,v 1.29 2010/04/22 17:19:47 stroeder Exp $
 
 
 Python compability note:
 Python compability note:
 Tested on Python 2.0+ but should run on Python 1.5.x.
 Tested on Python 2.0+ but should run on Python 1.5.x.
@@ -38,19 +38,21 @@ class WrongResultType(Exception):
       self.receivedResultType,
       self.receivedResultType,
       ', '.join(self.expectedResultTypes),
       ', '.join(self.expectedResultTypes),
     )
     )
-
+      
 
 
 class AsyncSearchHandler:
 class AsyncSearchHandler:
   """
   """
   Class for stream-processsing LDAP search results
   Class for stream-processsing LDAP search results
-
-  Arguments:
-
-  l
-    LDAPObject instance
   """
   """
 
 
   def __init__(self,l):
   def __init__(self,l):
+    """
+    Initialize a StreamResultHandler
+    
+    Parameters:
+    l
+        LDAPObject instance
+    """
     self._l = l
     self._l = l
     self._msgId = None
     self._msgId = None
 
 
@@ -164,7 +166,7 @@ class AsyncSearchHandler:
 class List(AsyncSearchHandler):
 class List(AsyncSearchHandler):
   """
   """
   Class for collecting all search results.
   Class for collecting all search results.
-
+  
   This does not seem to make sense in the first place but think
   This does not seem to make sense in the first place but think
   of retrieving exactly a certain portion of the available search
   of retrieving exactly a certain portion of the available search
   results.
   results.
@@ -222,15 +224,18 @@ class IndexedDict(Dict):
 class FileWriter(AsyncSearchHandler):
 class FileWriter(AsyncSearchHandler):
   """
   """
   Class for writing a stream of LDAP search results to a file object
   Class for writing a stream of LDAP search results to a file object
-
-  Arguments:
-  l
-    LDAPObject instance
-  f
-    File object instance where the LDIF data is written to
   """
   """
 
 
   def __init__(self,l,f,headerStr='',footerStr=''):
   def __init__(self,l,f,headerStr='',footerStr=''):
+    """
+    Initialize a StreamResultHandler
+    
+    Parameters:
+    l
+        LDAPObject instance
+    f
+        File object instance where the LDIF data is written to
+    """
     AsyncSearchHandler.__init__(self,l)
     AsyncSearchHandler.__init__(self,l)
     self._f = f
     self._f = f
     self.headerStr = headerStr
     self.headerStr = headerStr
@@ -254,16 +259,19 @@ class FileWriter(AsyncSearchHandler):
 class LDIFWriter(FileWriter):
 class LDIFWriter(FileWriter):
   """
   """
   Class for writing a stream LDAP search results to a LDIF file
   Class for writing a stream LDAP search results to a LDIF file
-
-  Arguments:
-
-  l
-    LDAPObject instance
-  writer_obj
-    Either a file-like object or a ldif.LDIFWriter instance used for output
   """
   """
 
 
   def __init__(self,l,writer_obj,headerStr='',footerStr=''):
   def __init__(self,l,writer_obj,headerStr='',footerStr=''):
+    """
+    Initialize a StreamResultHandler
+    
+    Parameters:
+    l
+        LDAPObject instance
+    writer_obj
+        Either a file-like object or a ldif.LDIFWriter instance
+        used for output
+    """
     import ldif
     import ldif
     if isinstance(writer_obj,ldif.LDIFWriter):
     if isinstance(writer_obj,ldif.LDIFWriter):
       self._ldif_writer = writer_obj
       self._ldif_writer = writer_obj
@@ -277,20 +285,22 @@ class LDIFWriter(FileWriter):
       dn,entry = resultItem
       dn,entry = resultItem
       self._ldif_writer.unparse(dn,entry)
       self._ldif_writer.unparse(dn,entry)
 
 
-
 class DSMLWriter(FileWriter):
 class DSMLWriter(FileWriter):
   """
   """
   Class for writing a stream LDAP search results to a DSML file
   Class for writing a stream LDAP search results to a DSML file
-
-  Arguments:
-
-  l
-    LDAPObject instance
-  writer_obj
-    Either a file-like object or a dsml.DSMLWriter instance used for output
   """
   """
 
 
   def __init__(self,l,writer_obj,headerStr='',footerStr=''):
   def __init__(self,l,writer_obj,headerStr='',footerStr=''):
+    """
+    Initialize a StreamResultHandler
+
+    Parameters:
+    l
+        LDAPObject instance
+    writer_obj
+        Either a file-like object or a ldif.DSMLWriter instance
+        used for output
+    """
     import dsml
     import dsml
     if isinstance(writer_obj,dsml.DSMLWriter):
     if isinstance(writer_obj,dsml.DSMLWriter):
       self._dsml_writer = writer_obj
       self._dsml_writer = writer_obj

+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Lib/ldap/cidict.py → desktop/core/ext-py/python-ldap-2.3.13/Lib/ldap/cidict.py


+ 133 - 0
desktop/core/ext-py/python-ldap-2.3.13/Lib/ldap/controls.py

@@ -0,0 +1,133 @@
+"""
+controls.py - support classes for LDAP controls
+
+See http://www.python-ldap.org/ for details.
+
+\$Id: controls.py,v 1.7 2009/07/26 11:09:58 stroeder Exp $
+
+Description:
+The ldap.controls module provides LDAPControl classes.
+Each class provides support for a certain control.
+"""
+
+from ldap import __version__
+
+__all__ = [
+  'LDAPControl',
+]
+
+
+from types import ClassType
+
+import _ldap,ldap
+
+
+class LDAPControl:
+  """
+  Base class for all LDAP controls
+  """
+
+  def __init__(self,controlType,criticality,controlValue=None,encodedControlValue=None):
+    self.controlType = controlType
+    self.criticality = criticality
+    self.controlValue = controlValue or self.decodeControlValue(encodedControlValue)
+
+  def __repr__(self):
+    return '%s(%s,%s,%s)' % (self.__class__.__name__,self.controlType,self.criticality,self.controlValue)
+
+  def encodeControlValue(self,value):
+    return value
+
+  def decodeControlValue(self,encodedValue):
+    return encodedValue
+
+  def getEncodedTuple(self):
+    return (self.controlType,self.criticality,self.encodeControlValue(self.controlValue))
+
+
+class BooleanControl(LDAPControl):
+  """
+  Base class for simple controls with booelan control value
+
+  In this base class controlValue has to be passed as
+  boolean type (True/False or 1/0).
+  """
+  boolean2ber = { 1:'\x01\x01\xFF', 0:'\x01\x01\x00' }
+  ber2boolean = { '\x01\x01\xFF':1, '\x01\x01\x00':0 }
+
+  def encodeControlValue(self,value):
+    return self.boolean2ber[int(value)]
+
+  def decodeControlValue(self,encodedValue):
+    return self.ber2boolean[encodedValue]
+
+
+class SimplePagedResultsControl(LDAPControl):
+  """
+  LDAP Control Extension for Simple Paged Results Manipulation
+
+  see RFC 2696
+  """
+  controlType = ldap.LDAP_CONTROL_PAGE_OID
+
+  def __init__(self,controlType,criticality,controlValue=None,encodedControlValue=None):
+    LDAPControl.__init__(self,ldap.LDAP_CONTROL_PAGE_OID,criticality,controlValue,encodedControlValue)
+
+  def encodeControlValue(self,value):
+    size,cookie = value
+    return _ldap.encode_page_control(size,cookie)
+
+  def decodeControlValue(self,encodedValue):
+    size,cookie = _ldap.decode_page_control(encodedValue)
+    return size,cookie
+
+
+class MatchedValuesControl(LDAPControl):
+  """
+  LDAP Matched Values control, as defined in RFC 3876
+
+  from ldap.controls import MatchedValuesControl
+  control = MatchedValuesControl(criticality, filter)
+  """
+  
+  controlType = ldap.LDAP_CONTROL_VALUESRETURNFILTER
+  
+  def __init__(self, criticality, controlValue=None):
+    LDAPControl.__init__(self, self.controlType, criticality, controlValue, None) 
+
+  def encodeControlValue(self, value):
+    return _ldap.encode_valuesreturnfilter_control(value)
+
+
+def EncodeControlTuples(ldapControls):
+  """
+  Return list of readily encoded 3-tuples which can be directly
+  passed to C module _ldap
+  """
+  if ldapControls is None:
+    return None
+  else:
+    result = [
+      c.getEncodedTuple()
+      for c in ldapControls
+    ]
+    return result
+
+
+def DecodeControlTuples(ldapControlTuples):
+  """
+  Return list of readily encoded 3-tuples which can be directly
+  passed to C module _ldap
+  """
+  return [
+    knownLDAPControls.get(controlType,LDAPControl)
+      (controlType,criticality,encodedControlValue=encodedControlValue)
+    for controlType,criticality,encodedControlValue in ldapControlTuples or []
+  ]
+
+# Build a dictionary of known LDAPControls
+knownLDAPControls = {}
+for symbol_name in dir():
+  c = eval(symbol_name)
+  if type(c) is ClassType and hasattr(c,'controlType'):
+    knownLDAPControls[c.controlType] = c

+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Lib/ldap/dn.py → desktop/core/ext-py/python-ldap-2.3.13/Lib/ldap/dn.py


+ 2 - 2
desktop/core/ext-py/python-ldap-2.4.6/Lib/ldap/filter.py → desktop/core/ext-py/python-ldap-2.3.13/Lib/ldap/filter.py

@@ -3,7 +3,7 @@ filters.py - misc stuff for handling LDAP filter strings (see RFC2254)
 
 
 See http://www.python-ldap.org/ for details.
 See http://www.python-ldap.org/ for details.
 
 
-\$Id: filter.py,v 1.9 2011/07/22 07:20:53 stroeder Exp $
+\$Id: filter.py,v 1.8 2010/04/19 17:34:36 stroeder Exp $
 
 
 Compability:
 Compability:
 - Tested with Python 2.0+
 - Tested with Python 2.0+
@@ -18,7 +18,7 @@ def escape_filter_chars(assertion_value,escape_mode=0):
   by quoted notation.
   by quoted notation.
   
   
   escape_mode
   escape_mode
-      If 0 only special chars mentioned in RFC 4515 are escaped.
+      If 0 only special chars mentioned in RFC 2254 are escaped.
       If 1 all NON-ASCII chars are escaped.
       If 1 all NON-ASCII chars are escaped.
       If 2 all chars are escaped.
       If 2 all chars are escaped.
   """
   """

+ 9 - 8
desktop/core/ext-py/python-ldap-2.4.6/Lib/ldap/functions.py → desktop/core/ext-py/python-ldap-2.3.13/Lib/ldap/functions.py

@@ -3,7 +3,7 @@ functions.py - wraps functions of module _ldap
 
 
 See http://www.python-ldap.org/ for details.
 See http://www.python-ldap.org/ for details.
 
 
-\$Id: functions.py,v 1.28 2011/11/23 17:27:46 stroeder Exp $
+\$Id: functions.py,v 1.26 2010/06/03 12:26:39 stroeder Exp $
 
 
 Compability:
 Compability:
 - Tested with Python 2.0+ but should work with Python 1.5.x
 - Tested with Python 2.0+ but should work with Python 1.5.x
@@ -26,7 +26,7 @@ __all__ = [
   'get_option','set_option',
   'get_option','set_option',
 ]
 ]
 
 
-import sys,pprint,_ldap,ldap
+import sys,_ldap,ldap
 
 
 from ldap import LDAPError
 from ldap import LDAPError
 
 
@@ -52,24 +52,25 @@ def _ldap_function_call(lock,func,*args,**kwargs):
     lock.acquire()
     lock.acquire()
   if __debug__:
   if __debug__:
     if ldap._trace_level>=1:
     if ldap._trace_level>=1:
-      ldap._trace_file.write('*** %s.%s %s\n' % (
-        '_ldap',func.__name__,
-        pprint.pformat((args,kwargs))
+      ldap._trace_file.write('*** %s.%s (%s,%s)\n' % (
+        '_ldap',repr(func),
+        repr(args),repr(kwargs)
       ))
       ))
-      if ldap._trace_level>=9:
+      if ldap._trace_level>=3:
         traceback.print_stack(limit=ldap._trace_stack_limit,file=ldap._trace_file)
         traceback.print_stack(limit=ldap._trace_stack_limit,file=ldap._trace_file)
   try:
   try:
     try:
     try:
       result = func(*args,**kwargs)
       result = func(*args,**kwargs)
     finally:
     finally:
       if lock:
       if lock:
-        lock.release()
+        ldap._ldap_module_lock.release()
   except LDAPError,e:
   except LDAPError,e:
     if __debug__ and ldap._trace_level>=2:
     if __debug__ and ldap._trace_level>=2:
       ldap._trace_file.write('=> LDAPError: %s\n' % (str(e)))
       ldap._trace_file.write('=> LDAPError: %s\n' % (str(e)))
     raise
     raise
   if __debug__ and ldap._trace_level>=2:
   if __debug__ and ldap._trace_level>=2:
-    ldap._trace_file.write('=> result:\n%s\n' % (pprint.pformat(result)))
+    if result!=None and result!=(None,None):
+      ldap._trace_file.write('=> result: %s\n' % (repr(result)))
   return result
   return result
 
 
 
 

+ 82 - 124
desktop/core/ext-py/python-ldap-2.4.6/Lib/ldap/ldapobject.py → desktop/core/ext-py/python-ldap-2.3.13/Lib/ldap/ldapobject.py

@@ -3,7 +3,7 @@ ldapobject.py - wraps class _ldap.LDAPObject
 
 
 See http://www.python-ldap.org/ for details.
 See http://www.python-ldap.org/ for details.
 
 
-\$Id: ldapobject.py,v 1.127 2011/11/25 10:52:01 stroeder Exp $
+\$Id: ldapobject.py,v 1.109 2010/06/03 12:26:39 stroeder Exp $
 
 
 Compability:
 Compability:
 - Tested with Python 2.0+ but should work with Python 1.5.x
 - Tested with Python 2.0+ but should work with Python 1.5.x
@@ -25,6 +25,7 @@ __all__ = [
   'SimpleLDAPObject',
   'SimpleLDAPObject',
   'NonblockingLDAPObject',
   'NonblockingLDAPObject',
   'ReconnectLDAPObject',
   'ReconnectLDAPObject',
+  'SmartLDAPObject'
 ]
 ]
 
 
 
 
@@ -32,12 +33,10 @@ if __debug__:
   # Tracing is only supported in debugging mode
   # Tracing is only supported in debugging mode
   import traceback
   import traceback
 
 
-import sys,time,pprint,_ldap,ldap,ldap.functions
+import sys,time,_ldap,ldap,ldap.functions
 
 
 from ldap.schema import SCHEMA_ATTRS
 from ldap.schema import SCHEMA_ATTRS
-from ldap.controls import LDAPControl,DecodeControlTuples,RequestControlTuples
-from ldap.extop import ExtendedRequest,ExtendedResponse
-
+from ldap.controls import LDAPControl,DecodeControlTuples,EncodeControlTuples
 from ldap import LDAPError
 from ldap import LDAPError
 
 
 
 
@@ -84,22 +83,22 @@ class SimpleLDAPObject:
     """
     """
     self._ldap_object_lock.acquire()
     self._ldap_object_lock.acquire()
     if __debug__:
     if __debug__:
-      if self._trace_level>=1:
-        self._trace_file.write('*** %s %s - %s\n%s\n' % (
-          repr(self),
+      if self._trace_level>=1:# and func.__name__!='result':
+        self._trace_file.write('*** %s - %s (%s,%s)\n' % (
           self._uri,
           self._uri,
-          '.'.join((self.__class__.__name__,func.__name__)),
-          pprint.pformat((args,kwargs))
+          self.__class__.__name__+'.'+func.__name__,
+          repr(args),repr(kwargs)
         ))
         ))
-        if self._trace_level>=9:
+        if self._trace_level>=3:
           traceback.print_stack(limit=self._trace_stack_limit,file=self._trace_file)
           traceback.print_stack(limit=self._trace_stack_limit,file=self._trace_file)
-    diagnostic_message_success = None
     try:
     try:
       try:
       try:
         result = func(*args,**kwargs)
         result = func(*args,**kwargs)
         if __debug__ and self._trace_level>=2:
         if __debug__ and self._trace_level>=2:
           if func.__name__!="unbind_ext":
           if func.__name__!="unbind_ext":
             diagnostic_message_success = self._l.get_option(ldap.OPT_DIAGNOSTIC_MESSAGE)
             diagnostic_message_success = self._l.get_option(ldap.OPT_DIAGNOSTIC_MESSAGE)
+          else:
+            diagnostic_message_success = None
       finally:
       finally:
         self._ldap_object_lock.release()
         self._ldap_object_lock.release()
     except LDAPError,e:
     except LDAPError,e:
@@ -110,7 +109,8 @@ class SimpleLDAPObject:
       if __debug__ and self._trace_level>=2:
       if __debug__ and self._trace_level>=2:
         if not diagnostic_message_success is None:
         if not diagnostic_message_success is None:
           self._trace_file.write('=> diagnosticMessage: %s\n' % (repr(diagnostic_message_success)))
           self._trace_file.write('=> diagnosticMessage: %s\n' % (repr(diagnostic_message_success)))
-        self._trace_file.write('=> result:\n%s\n' % (pprint.pformat(result)))
+        if result!=None and result!=(None,None):
+          self._trace_file.write('=> result: %s\n' % (repr(result)))
     return result
     return result
 
 
   def __setattr__(self,name,value):
   def __setattr__(self,name,value):
@@ -131,15 +131,15 @@ class SimpleLDAPObject:
 
 
   def abandon_ext(self,msgid,serverctrls=None,clientctrls=None):
   def abandon_ext(self,msgid,serverctrls=None,clientctrls=None):
     """
     """
-    abandon_ext(msgid[,serverctrls=None[,clientctrls=None]]) -> None
-    abandon(msgid) -> None
+    abandon_ext(msgid[,serverctrls=None[,clientctrls=None]]) -> None    
+    abandon(msgid) -> None    
         Abandons or cancels an LDAP operation in progress. The msgid should
         Abandons or cancels an LDAP operation in progress. The msgid should
         be the message id of an outstanding LDAP operation as returned
         be the message id of an outstanding LDAP operation as returned
         by the asynchronous methods search(), modify() etc.  The caller
         by the asynchronous methods search(), modify() etc.  The caller
         can expect that the result of an abandoned operation will not be
         can expect that the result of an abandoned operation will not be
         returned from a future call to result().
         returned from a future call to result().
     """
     """
-    return self._ldap_call(self._l.abandon_ext,msgid,RequestControlTuples(serverctrls),RequestControlTuples(clientctrls))
+    return self._ldap_call(self._l.abandon_ext,msgid,EncodeControlTuples(serverctrls),EncodeControlTuples(clientctrls))
 
 
   def abandon(self,msgid):
   def abandon(self,msgid):
     return self.abandon_ext(msgid,None,None)
     return self.abandon_ext(msgid,None,None)
@@ -148,14 +148,14 @@ class SimpleLDAPObject:
     """
     """
     cancel(cancelid[,serverctrls=None[,clientctrls=None]]) -> int
     cancel(cancelid[,serverctrls=None[,clientctrls=None]]) -> int
         Send cancels extended operation for an LDAP operation specified by cancelid.
         Send cancels extended operation for an LDAP operation specified by cancelid.
-        The cancelid should be the message id of an outstanding LDAP operation as returned
+	The cancelid should be the message id of an outstanding LDAP operation as returned
         by the asynchronous methods search(), modify() etc.  The caller
         by the asynchronous methods search(), modify() etc.  The caller
         can expect that the result of an abandoned operation will not be
         can expect that the result of an abandoned operation will not be
         returned from a future call to result().
         returned from a future call to result().
-        In opposite to abandon() this extended operation gets an result from
-        the server and thus should be preferred if the server supports it.
+	In opposite to abandon() this extended operation gets an result from
+	the server and thus should be preferred if the server supports it.
     """
     """
-    return self._ldap_call(self._l.cancel,cancelid,RequestControlTuples(serverctrls),RequestControlTuples(clientctrls))
+    return self._ldap_call(self._l.cancel,cancelid,EncodeControlTuples(serverctrls),EncodeControlTuples(clientctrls))
 
 
   def cancel_s(self,cancelid,serverctrls=None,clientctrls=None):
   def cancel_s(self,cancelid,serverctrls=None,clientctrls=None):
     msgid = self.cancel(cancelid,serverctrls,clientctrls)
     msgid = self.cancel(cancelid,serverctrls,clientctrls)
@@ -173,12 +173,11 @@ class SimpleLDAPObject:
         The parameter modlist is similar to the one passed to modify(),
         The parameter modlist is similar to the one passed to modify(),
         except that no operation integer need be included in the tuples.
         except that no operation integer need be included in the tuples.
     """
     """
-    return self._ldap_call(self._l.add_ext,dn,modlist,RequestControlTuples(serverctrls),RequestControlTuples(clientctrls))
+    return self._ldap_call(self._l.add_ext,dn,modlist,EncodeControlTuples(serverctrls),EncodeControlTuples(clientctrls))
 
 
   def add_ext_s(self,dn,modlist,serverctrls=None,clientctrls=None):
   def add_ext_s(self,dn,modlist,serverctrls=None,clientctrls=None):
     msgid = self.add_ext(dn,modlist,serverctrls,clientctrls)
     msgid = self.add_ext(dn,modlist,serverctrls,clientctrls)
-    resp_type, resp_data, resp_msgid, resp_ctrls = self.result3(msgid,all=1,timeout=self.timeout)
-    return resp_type, resp_data, resp_msgid, resp_ctrls
+    return self.result(msgid,all=1,timeout=self.timeout)
 
 
   def add(self,dn,modlist):
   def add(self,dn,modlist):
     """
     """
@@ -198,15 +197,14 @@ class SimpleLDAPObject:
     """
     """
     simple_bind([who='' [,cred='']]) -> int
     simple_bind([who='' [,cred='']]) -> int
     """
     """
-    return self._ldap_call(self._l.simple_bind,who,cred,RequestControlTuples(serverctrls),RequestControlTuples(clientctrls))
+    return self._ldap_call(self._l.simple_bind,who,cred,EncodeControlTuples(serverctrls),EncodeControlTuples(clientctrls))
 
 
   def simple_bind_s(self,who='',cred='',serverctrls=None,clientctrls=None):
   def simple_bind_s(self,who='',cred='',serverctrls=None,clientctrls=None):
     """
     """
     simple_bind_s([who='' [,cred='']]) -> None
     simple_bind_s([who='' [,cred='']]) -> None
     """
     """
     msgid = self.simple_bind(who,cred,serverctrls,clientctrls)
     msgid = self.simple_bind(who,cred,serverctrls,clientctrls)
-    resp_type, resp_data, resp_msgid, resp_ctrls = self.result3(msgid,all=1,timeout=self.timeout)
-    return resp_type, resp_data, resp_msgid, resp_ctrls
+    return self.result(msgid,all=1,timeout=self.timeout)
 
 
   def bind(self,who,cred,method=ldap.AUTH_SIMPLE):
   def bind(self,who,cred,method=ldap.AUTH_SIMPLE):
     """
     """
@@ -226,14 +224,14 @@ class SimpleLDAPObject:
     """
     """
     sasl_interactive_bind_s(who, auth) -> None
     sasl_interactive_bind_s(who, auth) -> None
     """
     """
-    return self._ldap_call(self._l.sasl_interactive_bind_s,who,auth,RequestControlTuples(serverctrls),RequestControlTuples(clientctrls),sasl_flags)
+    return self._ldap_call(self._l.sasl_interactive_bind_s,who,auth,EncodeControlTuples(serverctrls),EncodeControlTuples(clientctrls),sasl_flags)
 
 
   def compare_ext(self,dn,attr,value,serverctrls=None,clientctrls=None):
   def compare_ext(self,dn,attr,value,serverctrls=None,clientctrls=None):
     """
     """
     compare_ext(dn, attr, value [,serverctrls=None[,clientctrls=None]]) -> int
     compare_ext(dn, attr, value [,serverctrls=None[,clientctrls=None]]) -> int
-    compare_ext_s(dn, attr, value [,serverctrls=None[,clientctrls=None]]) -> int
+    compare_ext_s(dn, attr, value [,serverctrls=None[,clientctrls=None]]) -> int    
     compare(dn, attr, value) -> int
     compare(dn, attr, value) -> int
-    compare_s(dn, attr, value) -> int
+    compare_s(dn, attr, value) -> int    
         Perform an LDAP comparison between the attribute named attr of
         Perform an LDAP comparison between the attribute named attr of
         entry dn, and the value value. The synchronous form returns 0
         entry dn, and the value value. The synchronous form returns 0
         for false, or 1 for true.  The asynchronous form returns the
         for false, or 1 for true.  The asynchronous form returns the
@@ -246,12 +244,12 @@ class SimpleLDAPObject:
         A design bug in the library prevents value from containing
         A design bug in the library prevents value from containing
         nul characters.
         nul characters.
     """
     """
-    return self._ldap_call(self._l.compare_ext,dn,attr,value,RequestControlTuples(serverctrls),RequestControlTuples(clientctrls))
+    return self._ldap_call(self._l.compare_ext,dn,attr,value,EncodeControlTuples(serverctrls),EncodeControlTuples(clientctrls))
 
 
   def compare_ext_s(self,dn,attr,value,serverctrls=None,clientctrls=None):
   def compare_ext_s(self,dn,attr,value,serverctrls=None,clientctrls=None):
     msgid = self.compare_ext(dn,attr,value,serverctrls,clientctrls)
     msgid = self.compare_ext(dn,attr,value,serverctrls,clientctrls)
     try:
     try:
-      resp_type, resp_data, resp_msgid, resp_ctrls = self.result3(msgid,all=1,timeout=self.timeout)
+      self.result(msgid,all=1,timeout=self.timeout)
     except ldap.COMPARE_TRUE:
     except ldap.COMPARE_TRUE:
       return 1
       return 1
     except ldap.COMPARE_FALSE:
     except ldap.COMPARE_FALSE:
@@ -274,12 +272,11 @@ class SimpleLDAPObject:
         form returns the message id of the initiated request, and the
         form returns the message id of the initiated request, and the
         result can be obtained from a subsequent call to result().
         result can be obtained from a subsequent call to result().
     """
     """
-    return self._ldap_call(self._l.delete_ext,dn,RequestControlTuples(serverctrls),RequestControlTuples(clientctrls))
+    return self._ldap_call(self._l.delete_ext,dn,EncodeControlTuples(serverctrls),EncodeControlTuples(clientctrls))
 
 
   def delete_ext_s(self,dn,serverctrls=None,clientctrls=None):
   def delete_ext_s(self,dn,serverctrls=None,clientctrls=None):
     msgid = self.delete_ext(dn,serverctrls,clientctrls)
     msgid = self.delete_ext(dn,serverctrls,clientctrls)
-    resp_type, resp_data, resp_msgid, resp_ctrls = self.result3(msgid,all=1,timeout=self.timeout)
-    return resp_type, resp_data, resp_msgid, resp_ctrls
+    return self.result(msgid,all=1,timeout=self.timeout)
 
 
   def delete(self,dn):
   def delete(self,dn):
     return self.delete_ext(dn,None,None)
     return self.delete_ext(dn,None,None)
@@ -287,65 +284,33 @@ class SimpleLDAPObject:
   def delete_s(self,dn):
   def delete_s(self,dn):
     return self.delete_ext_s(dn,None,None)
     return self.delete_ext_s(dn,None,None)
 
 
-  def extop(self,extreq,serverctrls=None,clientctrls=None):
-    """
-    extop(extreq[,serverctrls=None[,clientctrls=None]]]) -> int
-    extop_s(extreq[,serverctrls=None[,clientctrls=None[,extop_resp_class=None]]]]) ->
-        (respoid,respvalue)
-        Performs an LDAP extended operation. The asynchronous
-        form returns the message id of the initiated request, and the
-        result can be obtained from a subsequent call to extop_result().
-        The extreq is an instance of class ldap.extop.ExtendedRequest.
-
-        If argument extop_resp_class is set to a sub-class of
-        ldap.extop.ExtendedResponse this class is used to return an
-        object of this class instead of a raw BER value in respvalue.
-    """
-    return self._ldap_call(self._l.extop,extreq.requestName,extreq.encodedRequestValue(),RequestControlTuples(serverctrls),RequestControlTuples(clientctrls))
-
-  def extop_result(self,msgid=ldap.RES_ANY,all=1,timeout=None):
-    resulttype,msg,msgid,respctrls,respoid,respvalue = self.result4(msgid,all=1,timeout=self.timeout,add_ctrls=1,add_intermediates=1,add_extop=1)
-    return (respoid,respvalue)
-
-  def extop_s(self,extreq,serverctrls=None,clientctrls=None,extop_resp_class=None):
-    msgid = self.extop(extreq,serverctrls,clientctrls)
-    res = self.extop_result(msgid,all=1,timeout=self.timeout)
-    if extop_resp_class:
-      respoid,respvalue = res
-      if extop_resp_class.responseName!=respoid:
-        raise ldap.PROTOCOL_ERROR("Wrong OID in extended response! Expected %s, got %s" % (extop_resp_class.responseName,respoid))
-      return extop_resp_class(extop_resp_class.responseName,respvalue)
-    else:
-      return res
-
   def modify_ext(self,dn,modlist,serverctrls=None,clientctrls=None):
   def modify_ext(self,dn,modlist,serverctrls=None,clientctrls=None):
     """
     """
     modify_ext(dn, modlist[,serverctrls=None[,clientctrls=None]]) -> int
     modify_ext(dn, modlist[,serverctrls=None[,clientctrls=None]]) -> int
     """
     """
-    return self._ldap_call(self._l.modify_ext,dn,modlist,RequestControlTuples(serverctrls),RequestControlTuples(clientctrls))
+    return self._ldap_call(self._l.modify_ext,dn,modlist,EncodeControlTuples(serverctrls),EncodeControlTuples(clientctrls))
 
 
   def modify_ext_s(self,dn,modlist,serverctrls=None,clientctrls=None):
   def modify_ext_s(self,dn,modlist,serverctrls=None,clientctrls=None):
     msgid = self.modify_ext(dn,modlist,serverctrls,clientctrls)
     msgid = self.modify_ext(dn,modlist,serverctrls,clientctrls)
-    resp_type, resp_data, resp_msgid, resp_ctrls = self.result3(msgid,all=1,timeout=self.timeout)
-    return resp_type, resp_data, resp_msgid, resp_ctrls
+    return self.result(msgid,all=1,timeout=self.timeout)
 
 
   def modify(self,dn,modlist):
   def modify(self,dn,modlist):
     """
     """
     modify(dn, modlist) -> int
     modify(dn, modlist) -> int
-    modify_s(dn, modlist) -> None
+    modify_s(dn, modlist) -> None    
     modify_ext(dn, modlist[,serverctrls=None[,clientctrls=None]]) -> int
     modify_ext(dn, modlist[,serverctrls=None[,clientctrls=None]]) -> int
     modify_ext_s(dn, modlist[,serverctrls=None[,clientctrls=None]]) -> None
     modify_ext_s(dn, modlist[,serverctrls=None[,clientctrls=None]]) -> None
         Performs an LDAP modify operation on an entry's attributes.
         Performs an LDAP modify operation on an entry's attributes.
         dn is the DN of the entry to modify, and modlist is the list
         dn is the DN of the entry to modify, and modlist is the list
         of modifications to make to the entry.
         of modifications to make to the entry.
 
 
-        Each element of the list modlist should be a tuple of the form
-        (mod_op,mod_type,mod_vals), where mod_op is the operation (one of
-        MOD_ADD, MOD_DELETE, MOD_INCREMENT or MOD_REPLACE), mod_type is a
-        string indicating the attribute type name, and mod_vals is either a
-        string value or a list of string values to add, delete, increment by or
-        replace respectively.  For the delete operation, mod_vals may be None
-        indicating that all attributes are to be deleted.
+	Each element of the list modlist should be a tuple of the form
+	(mod_op,mod_type,mod_vals), where mod_op is the operation (one of
+	MOD_ADD, MOD_DELETE, MOD_INCREMENT or MOD_REPLACE), mod_type is a
+	string indicating the attribute type name, and mod_vals is either a
+	string value or a list of string values to add, delete, increment by or
+	replace respectively.  For the delete operation, mod_vals may be None
+	indicating that all attributes are to be deleted.
 
 
         The asynchronous modify() returns the message id of the
         The asynchronous modify() returns the message id of the
         initiated request.
         initiated request.
@@ -359,7 +324,7 @@ class SimpleLDAPObject:
   def modrdn(self,dn,newrdn,delold=1):
   def modrdn(self,dn,newrdn,delold=1):
     """
     """
     modrdn(dn, newrdn [,delold=1]) -> int
     modrdn(dn, newrdn [,delold=1]) -> int
-    modrdn_s(dn, newrdn [,delold=1]) -> None
+    modrdn_s(dn, newrdn [,delold=1]) -> None    
         Perform a modify RDN operation. These routines take dn, the
         Perform a modify RDN operation. These routines take dn, the
         DN of the entry whose RDN is to be changed, and newrdn, the
         DN of the entry whose RDN is to be changed, and newrdn, the
         new RDN to give to the entry. The optional parameter delold
         new RDN to give to the entry. The optional parameter delold
@@ -376,11 +341,11 @@ class SimpleLDAPObject:
     return self.rename_s(dn,newrdn,None,delold)
     return self.rename_s(dn,newrdn,None,delold)
 
 
   def passwd(self,user,oldpw,newpw,serverctrls=None,clientctrls=None):
   def passwd(self,user,oldpw,newpw,serverctrls=None,clientctrls=None):
-    return self._ldap_call(self._l.passwd,user,oldpw,newpw,RequestControlTuples(serverctrls),RequestControlTuples(clientctrls))
+    return self._ldap_call(self._l.passwd,user,oldpw,newpw,EncodeControlTuples(serverctrls),EncodeControlTuples(clientctrls))
 
 
   def passwd_s(self,user,oldpw,newpw,serverctrls=None,clientctrls=None):
   def passwd_s(self,user,oldpw,newpw,serverctrls=None,clientctrls=None):
     msgid = self.passwd(user,oldpw,newpw,serverctrls,clientctrls)
     msgid = self.passwd(user,oldpw,newpw,serverctrls,clientctrls)
-    return self.extop_result(msgid,all=1,timeout=self.timeout)
+    return self.result(msgid,all=1,timeout=self.timeout)
 
 
   def rename(self,dn,newrdn,newsuperior=None,delold=1,serverctrls=None,clientctrls=None):
   def rename(self,dn,newrdn,newsuperior=None,delold=1,serverctrls=None,clientctrls=None):
     """
     """
@@ -397,12 +362,11 @@ class SimpleLDAPObject:
         This actually corresponds to the rename* routines in the
         This actually corresponds to the rename* routines in the
         LDAP-EXT C API library.
         LDAP-EXT C API library.
     """
     """
-    return self._ldap_call(self._l.rename,dn,newrdn,newsuperior,delold,RequestControlTuples(serverctrls),RequestControlTuples(clientctrls))
+    return self._ldap_call(self._l.rename,dn,newrdn,newsuperior,delold,EncodeControlTuples(serverctrls),EncodeControlTuples(clientctrls))
 
 
   def rename_s(self,dn,newrdn,newsuperior=None,delold=1,serverctrls=None,clientctrls=None):
   def rename_s(self,dn,newrdn,newsuperior=None,delold=1,serverctrls=None,clientctrls=None):
     msgid = self.rename(dn,newrdn,newsuperior,delold,serverctrls,clientctrls)
     msgid = self.rename(dn,newrdn,newsuperior,delold,serverctrls,clientctrls)
-    resp_type, resp_data, resp_msgid, resp_ctrls = self.result3(msgid,all=1,timeout=self.timeout)
-    return resp_type, resp_data, resp_msgid, resp_ctrls
+    return self.result(msgid,all=1,timeout=self.timeout)
 
 
   def result(self,msgid=ldap.RES_ANY,all=1,timeout=None):
   def result(self,msgid=ldap.RES_ANY,all=1,timeout=None):
     """
     """
@@ -455,38 +419,24 @@ class SimpleLDAPObject:
         If a timeout occurs, a TIMEOUT exception is raised, unless
         If a timeout occurs, a TIMEOUT exception is raised, unless
         polling (timeout = 0), in which case (None, None) is returned.
         polling (timeout = 0), in which case (None, None) is returned.
     """
     """
-    resp_type, resp_data, resp_msgid = self.result2(msgid,all,timeout)
-    return resp_type, resp_data
+    res_type,res_data,res_msgid = self.result2(msgid,all,timeout)
+    return res_type,res_data
 
 
   def result2(self,msgid=ldap.RES_ANY,all=1,timeout=None):
   def result2(self,msgid=ldap.RES_ANY,all=1,timeout=None):
-    resp_type, resp_data, resp_msgid, resp_ctrls = self.result3(msgid,all,timeout)
-    return resp_type, resp_data, resp_msgid
-
-  def result3(self,msgid=ldap.RES_ANY,all=1,timeout=None,resp_ctrl_classes=None):
-    resp_type, resp_data, resp_msgid, decoded_resp_ctrls, retoid, retval = self.result4(
-      msgid,all,timeout,
-      add_ctrls=0,add_intermediates=0,add_extop=0,
-      resp_ctrl_classes=resp_ctrl_classes
-    )
-    return resp_type, resp_data, resp_msgid, decoded_resp_ctrls
-
-  def result4(self,msgid=ldap.RES_ANY,all=1,timeout=None,add_ctrls=0,add_intermediates=0,add_extop=0,resp_ctrl_classes=None):
+    res_type, res_data, res_msgid, srv_ctrls = self.result3(msgid,all,timeout)
+    return res_type, res_data, res_msgid
+ 
+  def result3(self,msgid=ldap.RES_ANY,all=1,timeout=None):
     if timeout is None:
     if timeout is None:
       timeout = self.timeout
       timeout = self.timeout
-    ldap_result = self._ldap_call(self._l.result4,msgid,all,timeout,add_ctrls,add_intermediates,add_extop)
+    ldap_result = self._ldap_call(self._l.result3,msgid,all,timeout)
     if ldap_result is None:
     if ldap_result is None:
-        resp_type, resp_data, resp_msgid, resp_ctrls, resp_name, resp_value = (None,None,None,None,None,None)
+      rtype, rdata, rmsgid, decoded_serverctrls = (None,None,None,None)
     else:
     else:
-      if len(ldap_result)==4:
-        resp_type, resp_data, resp_msgid, resp_ctrls = ldap_result
-        resp_name, resp_value = None,None
-      else:
-        resp_type, resp_data, resp_msgid, resp_ctrls, resp_name, resp_value = ldap_result
-      if add_ctrls:
-        resp_data = [ (t,r,DecodeControlTuples(c,resp_ctrl_classes)) for t,r,c in resp_data ]
-    decoded_resp_ctrls = DecodeControlTuples(resp_ctrls,resp_ctrl_classes)
-    return resp_type, resp_data, resp_msgid, decoded_resp_ctrls, resp_name, resp_value
-
+      rtype, rdata, rmsgid, serverctrls = ldap_result
+      decoded_serverctrls = DecodeControlTuples(serverctrls)
+    return rtype, rdata, rmsgid, decoded_serverctrls
+ 
   def search_ext(self,base,scope,filterstr='(objectClass=*)',attrlist=None,attrsonly=0,serverctrls=None,clientctrls=None,timeout=-1,sizelimit=0):
   def search_ext(self,base,scope,filterstr='(objectClass=*)',attrlist=None,attrsonly=0,serverctrls=None,clientctrls=None,timeout=-1,sizelimit=0):
     """
     """
     search(base, scope [,filterstr='(objectClass=*)' [,attrlist=None [,attrsonly=0]]]) -> int
     search(base, scope [,filterstr='(objectClass=*)' [,attrlist=None [,attrsonly=0]]]) -> int
@@ -502,7 +452,7 @@ class SimpleLDAPObject:
         (to search the object and all its descendants).
         (to search the object and all its descendants).
 
 
         filter is a string representation of the filter to
         filter is a string representation of the filter to
-        apply in the search (see RFC 4515).
+        apply in the search (see RFC 2254).
 
 
         Each result tuple is of the form (dn,entry), where dn is a
         Each result tuple is of the form (dn,entry), where dn is a
         string containing the DN (distinguished name) of the entry, and
         string containing the DN (distinguished name) of the entry, and
@@ -536,8 +486,8 @@ class SimpleLDAPObject:
       self._l.search_ext,
       self._l.search_ext,
       base,scope,filterstr,
       base,scope,filterstr,
       attrlist,attrsonly,
       attrlist,attrsonly,
-      RequestControlTuples(serverctrls),
-      RequestControlTuples(clientctrls),
+      EncodeControlTuples(serverctrls),
+      EncodeControlTuples(clientctrls),
       timeout,sizelimit,
       timeout,sizelimit,
     )
     )
 
 
@@ -554,37 +504,48 @@ class SimpleLDAPObject:
   def search_st(self,base,scope,filterstr='(objectClass=*)',attrlist=None,attrsonly=0,timeout=-1):
   def search_st(self,base,scope,filterstr='(objectClass=*)',attrlist=None,attrsonly=0,timeout=-1):
     return self.search_ext_s(base,scope,filterstr,attrlist,attrsonly,None,None,timeout)
     return self.search_ext_s(base,scope,filterstr,attrlist,attrsonly,None,None,timeout)
 
 
+  def set_cache_options(self,*args,**kwargs):
+    """
+    set_cache_options(option) -> None    
+        Changes the caching behaviour. Currently supported options are
+            CACHE_OPT_CACHENOERRS, which suppresses caching of requests
+                that resulted in an error, and
+            CACHE_OPT_CACHEALLERRS, which enables caching of all requests.
+        The default behaviour is not to cache requests that result in
+        errors, except those that result in a SIZELIMIT_EXCEEDED exception.
+    """
+    return self._ldap_call(self._l.set_cache_options,*args,**kwargs)
+
   def start_tls_s(self):
   def start_tls_s(self):
     """
     """
-    start_tls_s() -> None
+    start_tls_s() -> None    
     Negotiate TLS with server. The `version' attribute must have been
     Negotiate TLS with server. The `version' attribute must have been
     set to VERSION3 before calling start_tls_s.
     set to VERSION3 before calling start_tls_s.
     If TLS could not be started an exception will be raised.
     If TLS could not be started an exception will be raised.
     """
     """
     return self._ldap_call(self._l.start_tls_s)
     return self._ldap_call(self._l.start_tls_s)
-
+  
   def unbind_ext(self,serverctrls=None,clientctrls=None):
   def unbind_ext(self,serverctrls=None,clientctrls=None):
     """
     """
-    unbind() -> int
+    unbind() -> int    
     unbind_s() -> None
     unbind_s() -> None
-    unbind_ext() -> int
+    unbind_ext() -> int    
     unbind_ext_s() -> None
     unbind_ext_s() -> None
         This call is used to unbind from the directory, terminate
         This call is used to unbind from the directory, terminate
         the current association, and free resources. Once called, the
         the current association, and free resources. Once called, the
         connection to the LDAP server is closed and the LDAP object
         connection to the LDAP server is closed and the LDAP object
         is invalid. Further invocation of methods on the object will
         is invalid. Further invocation of methods on the object will
         yield an exception.
         yield an exception.
-
+    
         The unbind and unbind_s methods are identical, and are
         The unbind and unbind_s methods are identical, and are
         synchronous in nature
         synchronous in nature
     """
     """
-    return self._ldap_call(self._l.unbind_ext,RequestControlTuples(serverctrls),RequestControlTuples(clientctrls))
+    return self._ldap_call(self._l.unbind_ext,EncodeControlTuples(serverctrls),EncodeControlTuples(clientctrls))
 
 
   def unbind_ext_s(self,serverctrls=None,clientctrls=None):
   def unbind_ext_s(self,serverctrls=None,clientctrls=None):
     msgid = self.unbind_ext(serverctrls,clientctrls)
     msgid = self.unbind_ext(serverctrls,clientctrls)
     if msgid!=None:
     if msgid!=None:
-      resp_type, resp_data, resp_msgid, resp_ctrls = self.result3(msgid,all=1,timeout=self.timeout)
-      return resp_type, resp_data, resp_msgid, resp_ctrls
+      return self.result(msgid,all=1,timeout=self.timeout)
 
 
   def unbind(self):
   def unbind(self):
     return self.unbind_ext(None,None)
     return self.unbind_ext(None,None)
@@ -603,7 +564,7 @@ class SimpleLDAPObject:
 
 
   def set_option(self,option,invalue):
   def set_option(self,option,invalue):
     if option==ldap.OPT_SERVER_CONTROLS or option==ldap.OPT_CLIENT_CONTROLS:
     if option==ldap.OPT_SERVER_CONTROLS or option==ldap.OPT_CLIENT_CONTROLS:
-      invalue = RequestControlTuples(invalue)
+      invalue = EncodeControlTuples(invalue)
     return self._ldap_call(self._l.set_option,option,invalue)
     return self._ldap_call(self._l.set_option,option,invalue)
 
 
   def search_subschemasubentry_s(self,dn=''):
   def search_subschemasubentry_s(self,dn=''):
@@ -698,7 +659,7 @@ class ReconnectLDAPObject(SimpleLDAPObject):
   of all synchronous operation methods (search_s() etc.) are doing
   of all synchronous operation methods (search_s() etc.) are doing
   an automatic reconnect and rebind and will retry the very same
   an automatic reconnect and rebind and will retry the very same
   operation.
   operation.
-
+  
   This is very handy for broken LDAP server implementations
   This is very handy for broken LDAP server implementations
   (e.g. in Lotus Domino) which drop connections very often making
   (e.g. in Lotus Domino) which drop connections very often making
   it impossible to have a long-lasting control flow in the
   it impossible to have a long-lasting control flow in the
@@ -843,9 +804,6 @@ class ReconnectLDAPObject(SimpleLDAPObject):
   def delete_ext_s(self,*args,**kwargs):
   def delete_ext_s(self,*args,**kwargs):
     return self._apply_method_s(SimpleLDAPObject.delete_ext_s,*args,**kwargs)
     return self._apply_method_s(SimpleLDAPObject.delete_ext_s,*args,**kwargs)
 
 
-  def extop_s(self,*args,**kwargs):
-    return self._apply_method_s(SimpleLDAPObject.extop_s,*args,**kwargs)
-
   def modify_ext_s(self,*args,**kwargs):
   def modify_ext_s(self,*args,**kwargs):
     return self._apply_method_s(SimpleLDAPObject.modify_ext_s,*args,**kwargs)
     return self._apply_method_s(SimpleLDAPObject.modify_ext_s,*args,**kwargs)
 
 

+ 7 - 18
desktop/core/ext-py/python-ldap-2.4.6/Lib/ldap/modlist.py → desktop/core/ext-py/python-ldap-2.3.13/Lib/ldap/modlist.py

@@ -3,7 +3,7 @@ ldap.modlist - create add/modify modlist's
 
 
 See http://www.python-ldap.org/ for details.
 See http://www.python-ldap.org/ for details.
 
 
-$Id: modlist.py,v 1.18 2011/06/06 13:07:38 stroeder Exp $
+$Id: modlist.py,v 1.17 2009/07/26 11:09:58 stroeder Exp $
 
 
 Python compability note:
 Python compability note:
 This module is known to work with Python 2.0+ but should work
 This module is known to work with Python 2.0+ but should work
@@ -12,20 +12,14 @@ with Python 1.5.2 as well.
 
 
 from ldap import __version__
 from ldap import __version__
 
 
-import string,ldap,ldap.cidict
+import string,ldap
 
 
 
 
-def list_dict(l,case_insensitive=0):
+def list_dict(l):
   """
   """
   return a dictionary with all items of l being the keys of the dictionary
   return a dictionary with all items of l being the keys of the dictionary
-
-  If argument case_insensitive is non-zero ldap.cidict.cidict will be
-  used for case-insensitive string keys
   """
   """
-  if case_insensitive:
-    d = ldap.cidict.cidict()
-  else:
-    d = {}
+  d = {}
   for i in l:
   for i in l:
     d[i]=None
     d[i]=None
   return d
   return d
@@ -47,7 +41,7 @@ def addModlist(entry,ignore_attr_types=None):
 
 
 
 
 def modifyModlist(
 def modifyModlist(
-  old_entry,new_entry,ignore_attr_types=None,ignore_oldexistent=0,case_ignore_attr_types=None
+  old_entry,new_entry,ignore_attr_types=None,ignore_oldexistent=0
 ):
 ):
   """
   """
   Build differential modify list for calling LDAPObject.modify()/modify_s()
   Build differential modify list for calling LDAPObject.modify()/modify_s()
@@ -64,12 +58,8 @@ def modifyModlist(
       This is handy for situations where your application
       This is handy for situations where your application
       sets attribute value to '' for deleting an attribute.
       sets attribute value to '' for deleting an attribute.
       In most cases leave zero.
       In most cases leave zero.
-  case_ignore_attr_types
-      List of attribute type names for which comparison will be made
-      case-insensitive
   """
   """
   ignore_attr_types = list_dict(map(string.lower,(ignore_attr_types or [])))
   ignore_attr_types = list_dict(map(string.lower,(ignore_attr_types or [])))
-  case_ignore_attr_types = list_dict(map(string.lower,(case_ignore_attr_types or [])))
   modlist = []
   modlist = []
   attrtype_lower_map = {}
   attrtype_lower_map = {}
   for a in old_entry.keys():
   for a in old_entry.keys():
@@ -94,9 +84,8 @@ def modifyModlist(
       # Replace existing attribute
       # Replace existing attribute
       replace_attr_value = len(old_value)!=len(new_value)
       replace_attr_value = len(old_value)!=len(new_value)
       if not replace_attr_value:
       if not replace_attr_value:
-        case_insensitive = case_ignore_attr_types.has_key(attrtype_lower)
-        old_value_dict=list_dict(old_value,case_insensitive)
-        new_value_dict=list_dict(new_value,case_insensitive)
+        old_value_dict=list_dict(old_value)
+        new_value_dict=list_dict(new_value)
         delete_values = []
         delete_values = []
         for v in old_value:
         for v in old_value:
           if not new_value_dict.has_key(v):
           if not new_value_dict.has_key(v):

+ 7 - 3
desktop/core/ext-py/python-ldap-2.4.6/Lib/ldap/resiter.py → desktop/core/ext-py/python-ldap-2.3.13/Lib/ldap/resiter.py

@@ -3,22 +3,26 @@ ldap.resiter - processing LDAP results with iterators
 
 
 See http://www.python-ldap.org/ for details.
 See http://www.python-ldap.org/ for details.
 
 
-\$Id: resiter.py,v 1.6 2011/07/28 08:23:32 stroeder Exp $
+\$Id: resiter.py,v 1.4 2009/07/26 11:09:58 stroeder Exp $
 
 
 Python compability note:
 Python compability note:
 Requires Python 2.3+
 Requires Python 2.3+
 """
 """
 
 
+import ldap
+
+from ldap import __version__
+
 
 
 class ResultProcessor:
 class ResultProcessor:
   """
   """
-  Mix-in class used with ldap.ldapopbject.LDAPObject or derived classes.
+  Mix-in class for ldap.ldapopbject.LDAPObject which adds method allresults().
   """
   """
 
 
   def allresults(self,msgid,timeout=-1):
   def allresults(self,msgid,timeout=-1):
     """
     """
     Generator function which returns an iterator for processing all LDAP operation
     Generator function which returns an iterator for processing all LDAP operation
-    results of the given msgid retrieved with LDAPObject.result3() -> 4-tuple
+    results of the given msgid.
     """
     """
     result_type,result_list,result_msgid,result_serverctrls = self.result3(msgid,0,timeout)
     result_type,result_list,result_msgid,result_serverctrls = self.result3(msgid,0,timeout)
     while result_type and result_list:
     while result_type and result_list:

+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Lib/ldap/sasl.py → desktop/core/ext-py/python-ldap-2.3.13/Lib/ldap/sasl.py


+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Lib/ldap/schema/.cvsignore → desktop/core/ext-py/python-ldap-2.3.13/Lib/ldap/schema/.cvsignore


+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Lib/ldap/schema/__init__.py → desktop/core/ext-py/python-ldap-2.3.13/Lib/ldap/schema/__init__.py


+ 81 - 209
desktop/core/ext-py/python-ldap-2.4.6/Lib/ldap/schema/models.py → desktop/core/ext-py/python-ldap-2.3.13/Lib/ldap/schema/models.py

@@ -3,7 +3,7 @@ schema.py - support for subSchemaSubEntry information
 
 
 See http://www.python-ldap.org/ for details.
 See http://www.python-ldap.org/ for details.
 
 
-\$Id: models.py,v 1.44 2011/07/22 17:19:08 stroeder Exp $
+\$Id: models.py,v 1.39 2010/04/30 08:39:38 stroeder Exp $
 """
 """
 
 
 import UserDict,ldap.cidict
 import UserDict,ldap.cidict
@@ -34,19 +34,6 @@ NOT_HUMAN_READABLE_LDAP_SYNTAXES = {
 class SchemaElement:
 class SchemaElement:
   """
   """
   Base class for all schema element classes. Not used directly!
   Base class for all schema element classes. Not used directly!
-
-  Arguments:
-  
-  schema_element_str
-    String which contains the schema element description to be parsed.
-
-  Class attributes:
-
-  schema_attribute
-    LDAP attribute type containing a certain schema element description
-  token_defaults
-    Dictionary internally used by the schema element parser
-    containing the defaults for certain schema description key-words
   """
   """
   token_defaults = {
   token_defaults = {
     'DESC':(None,),
     'DESC':(None,),
@@ -56,6 +43,7 @@ class SchemaElement:
     if schema_element_str:
     if schema_element_str:
       l = split_tokens(schema_element_str,self.token_defaults)
       l = split_tokens(schema_element_str,self.token_defaults)
       self.set_id(l[1])
       self.set_id(l[1])
+      assert type(self.get_id())==StringType
       d = extract_tokens(l,self.token_defaults)
       d = extract_tokens(l,self.token_defaults)
       self._set_attrs(l,d)
       self._set_attrs(l,d)
 
 
@@ -100,36 +88,17 @@ class SchemaElement:
 
 
 class ObjectClass(SchemaElement):
 class ObjectClass(SchemaElement):
   """
   """
-  Arguments:
-  
-  schema_element_str
-    String containing an ObjectClassDescription
-
-  Class attributes:
-
-  oid
-    OID assigned to the object class
-  names
-    This list of strings contains all NAMEs of the object class
-  desc
-    This string contains description text (DESC) of the object class
-  obsolete
-    Integer flag (0 or 1) indicating whether the object class is marked
-    as OBSOLETE in the schema
-  must
-    This list of strings contains NAMEs or OIDs of all attributes
-    an entry of the object class must have
-  may
-    This list of strings contains NAMEs or OIDs of additional attributes
-    an entry of the object class may have
-  kind
-    Kind of an object class:
-    0 = ABSTRACT,
-    1 = STRUCTURAL,
-    2 = AUXILIARY
-  sup
-    This list of strings contains NAMEs or OIDs of object classes
-    this object class is derived from
+  ObjectClassDescription = "(" whsp
+      numericoid whsp      ; ObjectClass identifier
+      [ "NAME" qdescrs ]
+      [ "DESC" qdstring ]
+      [ "OBSOLETE" whsp ]
+      [ "SUP" oids ]       ; Superior ObjectClasses
+      [ ( "ABSTRACT" / "STRUCTURAL" / "AUXILIARY" ) whsp ]
+                           ; default structural
+      [ "MUST" oids ]      ; AttributeTypes
+      [ "MAY" oids ]       ; AttributeTypes
+  whsp ")"
   """
   """
   schema_attribute = 'objectClasses'
   schema_attribute = 'objectClasses'
   token_defaults = {
   token_defaults = {
@@ -193,47 +162,28 @@ AttributeUsage = ldap.cidict.cidict({
 
 
 class AttributeType(SchemaElement):
 class AttributeType(SchemaElement):
   """
   """
-  Arguments:
-  
-  schema_element_str
-    String containing an AttributeTypeDescription
-
-  Class attributes:
-
-  oid
-    OID assigned to the attribute type
-  names
-    This list of strings contains all NAMEs of the attribute type
-  desc
-    This string contains description text (DESC) of the attribute type
-  obsolete
-    Integer flag (0 or 1) indicating whether the attribute type is marked
-    as OBSOLETE in the schema
-  single_value
-    Integer flag (0 or 1) indicating whether the attribute must
-    have only one value
-  syntax
-    String contains OID of the LDAP syntax assigned to the attribute type
-  no_user_mod
-    Integer flag (0 or 1) indicating whether the attribute is modifiable
-    by a client application
-  equality
-    String contains NAME or OID of the matching rule used for
-    checking whether attribute values are equal
-  substr
-    String contains NAME or OID of the matching rule used for
-    checking whether an attribute value contains another value
-  ordering
-    String contains NAME or OID of the matching rule used for
-    checking whether attribute values are lesser-equal than
-  usage
-    USAGE of an attribute type:
-    1 = directoryOperation,
-    2 = distributedOperation,
-    3 = dSAOperation
-  sup
-    This list of strings contains NAMEs or OIDs of attribute types
-    this attribute type is derived from
+      AttributeTypeDescription = "(" whsp
+            numericoid whsp              ; AttributeType identifier
+          [ "NAME" qdescrs ]             ; name used in AttributeType
+          [ "DESC" qdstring ]            ; description
+          [ "OBSOLETE" whsp ]
+          [ "SUP" woid ]                 ; derived from this other
+                                         ; AttributeType
+          [ "EQUALITY" woid              ; Matching Rule name
+          [ "ORDERING" woid              ; Matching Rule name
+          [ "SUBSTR" woid ]              ; Matching Rule name
+          [ "SYNTAX" whsp noidlen whsp ] ; see section 4.3
+          [ "SINGLE-VALUE" whsp ]        ; default multi-valued
+          [ "COLLECTIVE" whsp ]          ; default not collective
+          [ "NO-USER-MODIFICATION" whsp ]; default user modifiable
+          [ "USAGE" whsp AttributeUsage ]; default userApplications
+          whsp ")"
+
+      AttributeUsage =
+          "userApplications"     /
+          "directoryOperation"   /
+          "distributedOperation" / ; DSA-shared
+          "dSAOperation"          ; DSA-specific, value depends on server
   """
   """
   schema_attribute = 'attributeTypes'
   schema_attribute = 'attributeTypes'
   token_defaults = {
   token_defaults = {
@@ -325,15 +275,10 @@ class AttributeType(SchemaElement):
 
 
 class LDAPSyntax(SchemaElement):
 class LDAPSyntax(SchemaElement):
   """
   """
-  SyntaxDescription
-
-  oid
-    OID assigned to the LDAP syntax
-  desc
-    This string contains description text (DESC) of the LDAP syntax
-  not_human_readable
-    Integer flag (0 or 1) indicating whether the attribute type is marked
-    as not human-readable (X-NOT-HUMAN-READABLE)  
+  SyntaxDescription = "(" whsp
+      numericoid whsp
+      [ "DESC" qdstring ]
+      whsp ")"
   """
   """
   schema_attribute = 'ldapSyntaxes'
   schema_attribute = 'ldapSyntaxes'
   token_defaults = {
   token_defaults = {
@@ -360,24 +305,13 @@ class LDAPSyntax(SchemaElement):
 
 
 class MatchingRule(SchemaElement):
 class MatchingRule(SchemaElement):
   """
   """
-  Arguments:
-  
-  schema_element_str
-    String containing an MatchingRuleDescription
-
-  Class attributes:
-
-  oid
-    OID assigned to the matching rule
-  names
-    This list of strings contains all NAMEs of the matching rule
-  desc
-    This string contains description text (DESC) of the matching rule
-  obsolete
-    Integer flag (0 or 1) indicating whether the matching rule is marked
-    as OBSOLETE in the schema
-  syntax
-    String contains OID of the LDAP syntax this matching rule is usable with
+  MatchingRuleDescription = "(" whsp
+      numericoid whsp  ; MatchingRule identifier
+      [ "NAME" qdescrs ]
+      [ "DESC" qdstring ]
+      [ "OBSOLETE" whsp ]
+      "SYNTAX" numericoid
+  whsp ")"
   """
   """
   schema_attribute = 'matchingRules'
   schema_attribute = 'matchingRules'
   token_defaults = {
   token_defaults = {
@@ -409,25 +343,14 @@ class MatchingRule(SchemaElement):
 
 
 class MatchingRuleUse(SchemaElement):
 class MatchingRuleUse(SchemaElement):
   """
   """
-  Arguments:
-  
-  schema_element_str
-    String containing an MatchingRuleUseDescription
-
-  Class attributes:
-
-  oid
-    OID of the accompanying matching rule
-  names
-    This list of strings contains all NAMEs of the matching rule
-  desc
-    This string contains description text (DESC) of the matching rule
-  obsolete
-    Integer flag (0 or 1) indicating whether the matching rule is marked
-    as OBSOLETE in the schema
-  applies
-    This list of strings contains NAMEs or OIDs of attribute types
-    for which this matching rule is used
+  MatchingRuleUseDescription = "(" whsp
+     numericoid 
+     [ space "NAME" space qdescrs ]
+     [ space "DESC" space qdstring ]
+     [ space "OBSOLETE" ]
+     space "APPLIES" space oids    ;  AttributeType identifiers
+     extensions
+     whsp ")" 
   """
   """
   schema_attribute = 'matchingRuleUse'
   schema_attribute = 'matchingRuleUse'
   token_defaults = {
   token_defaults = {
@@ -459,36 +382,16 @@ class MatchingRuleUse(SchemaElement):
 
 
 class DITContentRule(SchemaElement):
 class DITContentRule(SchemaElement):
   """
   """
-  Arguments:
-  
-  schema_element_str
-    String containing an DITContentRuleDescription
-
-  Class attributes:
-
-  oid
-    OID of the accompanying structural object class
-  names
-    This list of strings contains all NAMEs of the DIT content rule
-  desc
-    This string contains description text (DESC) of the DIT content rule
-  obsolete
-    Integer flag (0 or 1) indicating whether the DIT content rule is marked
-    as OBSOLETE in the schema
-  aux
-    This list of strings contains NAMEs or OIDs of all auxiliary
-    object classes usable in an entry of the object class
-  must
-    This list of strings contains NAMEs or OIDs of all attributes
-    an entry of the object class must have which may extend the
-    list of required attributes of the object classes of an entry
-  may
-    This list of strings contains NAMEs or OIDs of additional attributes
-    an entry of the object class may have which may extend the
-    list of optional attributes of the object classes of an entry
-  nots
-    This list of strings contains NAMEs or OIDs of attributes which
-    may not be present in an entry of the object class
+  DITContentRuleDescription = LPAREN WSP
+      numericoid                 ; object identifer
+      [ SP "NAME" SP qdescrs ]   ; short names
+      [ SP "DESC" SP qdstring ]  ; description
+      [ SP "OBSOLETE" ]          ; not active
+      [ SP "AUX" SP oids ]       ; auxiliary object classes
+      [ SP "MUST" SP oids ]      ; attribute types
+      [ SP "MAY" SP oids ]       ; attribute types
+      [ SP "NOT" SP oids ]       ; attribute types
+      extensions WSP RPAREN      ; extensions
   """
   """
   schema_attribute = 'dITContentRules'
   schema_attribute = 'dITContentRules'
   token_defaults = {
   token_defaults = {
@@ -532,27 +435,14 @@ class DITContentRule(SchemaElement):
 
 
 class DITStructureRule(SchemaElement):
 class DITStructureRule(SchemaElement):
   """
   """
-  Arguments:
-  
-  schema_element_str
-    String containing an DITStructureRuleDescription
-
-  Class attributes:
-
-  ruleid
-    rule ID of the DIT structure rule (only locally unique)
-  names
-    This list of strings contains all NAMEs of the DIT structure rule
-  desc
-    This string contains description text (DESC) of the DIT structure rule
-  obsolete
-    Integer flag (0 or 1) indicating whether the DIT content rule is marked
-    as OBSOLETE in the schema
-  form
-    List of strings with NAMEs or OIDs of associated name forms
-  sup
-    List of strings with NAMEs or OIDs of allowed structural object classes
-    of superior entries in the DIT
+  DITStructureRuleDescription = LPAREN WSP
+      ruleid                     ; rule identifier
+      [ SP "NAME" SP qdescrs ]   ; short names
+      [ SP "DESC" SP qdstring ]  ; description
+      [ SP "OBSOLETE" ]          ; not active
+      SP "FORM" SP oid           ; NameForm
+      [ SP "SUP" ruleids ]       ; superior rules
+      extensions WSP RPAREN      ; extensions
   """
   """
   schema_attribute = 'dITStructureRules'
   schema_attribute = 'dITStructureRules'
 
 
@@ -595,33 +485,15 @@ class DITStructureRule(SchemaElement):
 
 
 class NameForm(SchemaElement):
 class NameForm(SchemaElement):
   """
   """
-  Arguments:
-  
-  schema_element_str
-    String containing an NameFormDescription
-
-  Class attributes:
-
-  oid
-    OID of the name form
-  names
-    This list of strings contains all NAMEs of the name form
-  desc
-    This string contains description text (DESC) of the name form
-  obsolete
-    Integer flag (0 or 1) indicating whether the name form is marked
-    as OBSOLETE in the schema
-  form
-    List of strings with NAMEs or OIDs of associated name forms
-  oc
-    String with NAME or OID of structural object classes this name form
-    is usable with
-  must
-    This list of strings contains NAMEs or OIDs of all attributes
-    an RDN must contain
-  may
-    This list of strings contains NAMEs or OIDs of additional attributes
-    an RDN may contain
+  NameFormDescription = LPAREN WSP
+      numericoid                 ; object identifer
+      [ SP "NAME" SP qdescrs ]   ; short names
+      [ SP "DESC" SP qdstring ]  ; description
+      [ SP "OBSOLETE" ]          ; not active
+      SP "OC" SP oid             ; structural object class
+      SP "MUST" SP oids          ; attribute types
+      [ SP "MAY" SP oids ]       ; attribute types
+      extensions WSP RPAREN      ; extensions
   """
   """
   schema_attribute = 'nameForms'
   schema_attribute = 'nameForms'
   token_defaults = {
   token_defaults = {

+ 97 - 162
desktop/core/ext-py/python-ldap-2.4.6/Lib/ldap/schema/subentry.py → desktop/core/ext-py/python-ldap-2.3.13/Lib/ldap/schema/subentry.py

@@ -3,7 +3,7 @@ ldap.schema.subentry -  subschema subentry handling
 
 
 See http://www.python-ldap.org/ for details.
 See http://www.python-ldap.org/ for details.
 
 
-\$Id: subentry.py,v 1.31 2011/07/22 17:01:46 stroeder Exp $
+\$Id: subentry.py,v 1.25 2010/04/30 08:39:38 stroeder Exp $
 """
 """
 
 
 import ldap.cidict,ldap.schema
 import ldap.cidict,ldap.schema
@@ -24,114 +24,35 @@ for _name in dir():
 SCHEMA_ATTRS = SCHEMA_CLASS_MAPPING.keys()
 SCHEMA_ATTRS = SCHEMA_CLASS_MAPPING.keys()
 
 
 
 
-class SubschemaError(ValueError):
-  pass
-
-
-class OIDNotUnique(SubschemaError):
-
-  def __init__(self,desc):
-    self.desc = desc
-
-  def __str__(self):
-    return 'OID not unique for %s' % (self.desc)
-
-
-class NameNotUnique(SubschemaError):
-
-  def __init__(self,desc):
-    self.desc = desc
-
-  def __str__(self):
-    return 'NAME not unique for %s' % (self.desc)
-
-
 class SubSchema:
 class SubSchema:
-  """
-  Arguments:
-
-  sub_schema_sub_entry
-      Dictionary usually returned by LDAP search or the LDIF parser
-      containing the sub schema sub entry
-
-  check_uniqueness
-      Defines whether uniqueness of OIDs and NAME is checked.
-
-      0
-        no check
-      1
-        check but add schema description with work-around
-      2
-        check and raise exception if non-unique OID or NAME is found
-
-  Class attributes:
-
-  sed
-    Dictionary holding the subschema information as pre-parsed
-    SchemaElement objects (do not access directly!)
-  name2oid
-    Dictionary holding the mapping from NAMEs to OIDs
-    (do not access directly!)
-  non_unique_oids
-    List of OIDs used at least twice in the subschema
-  non_unique_names
-    List of NAMEs used at least twice in the subschema for the same schema element 
-  """
-
-  def __init__(self,sub_schema_sub_entry,check_uniqueness=1):
-
-    # Initialize all dictionaries
-    self.name2oid = {}
-    self.sed = {}
-    self.non_unique_oids = {}
-    self.non_unique_names = {}
-    for c in SCHEMA_CLASS_MAPPING.values():
-      self.name2oid[c] = ldap.cidict.cidict()
-      self.sed[c] = {}
-      self.non_unique_names[c] = set()
-
-    # Transform entry dict to case-insensitive dict
-    e = ldap.cidict.cidict(sub_schema_sub_entry)
-
-    # Build the schema registry in dictionaries
-    for attr_type in SCHEMA_ATTRS:
-
-      for attr_value in filter(None,e.get(attr_type,[])):
-
-        se_class = SCHEMA_CLASS_MAPPING[attr_type]
-        se_instance = se_class(attr_value)
-        se_id = se_instance.get_id()
-
-        if check_uniqueness and se_id in self.sed[se_class]:
-            self.non_unique_oids[se_id] = None
-            if check_uniqueness==1:
-              # Add to subschema by adding suffix to ID
-              suffix_counter = 1
-              new_se_id = se_id
-              while new_se_id in self.sed[se_class]:
-                new_se_id = ';'.join((se_id,str(suffix_counter)))
-                suffix_counter += 1
-              else:
-                se_id = new_se_id
-            elif check_uniqueness>=2:
-              raise OIDNotUnique(attr_value)
-
-        # Store the schema element instance in the central registry
-        self.sed[se_class][se_id] = se_instance
-
-        if hasattr(se_instance,'names'):
-          for name in se_instance.names:
-            if check_uniqueness and name in self.name2oid[se_class]:
-              self.non_unique_names[se_class][se_id] = None
-              raise NameNotUnique(attr_value)
-            else:
-              self.name2oid[se_class][name] = se_id
-
-    # Turn dict into list maybe more handy for applications
-    self.non_unique_oids = self.non_unique_oids.keys()
-
-    return # subSchema.__init__()
-
+    
+  def __init__(self,sub_schema_sub_entry):
+      """
+      sub_schema_sub_entry
+          Dictionary containing the sub schema sub entry
+      """
+      # Initialize all dictionaries
+      self.name2oid = {}
+      self.sed = {}
+      for c in SCHEMA_CLASS_MAPPING.values():
+        self.name2oid[c] = ldap.cidict.cidict()
+        self.sed[c] = {}
+
+      e = ldap.cidict.cidict(sub_schema_sub_entry)
+
+      # Build the schema registry
+      for attr_type in SCHEMA_ATTRS:
+        if not e.has_key(attr_type) or \
+           not e[attr_type]:
+          continue
+        for attr_value in filter(None,e[attr_type]):
+          se_class = SCHEMA_CLASS_MAPPING[attr_type]
+          se_instance = se_class(attr_value)
+          self.sed[se_class][se_instance.get_id()] = se_instance
+          if hasattr(se_instance,'names'):
+            for name in se_instance.names:
+              self.name2oid[se_class][name] = se_instance.get_id()
+      return # subSchema.__init__()
 
 
   def ldap_entry(self):
   def ldap_entry(self):
     """
     """
@@ -169,7 +90,7 @@ class SubSchema:
     else:
     else:
       result = avail_se.keys()
       result = avail_se.keys()
     return result
     return result
-
+    
 
 
   def tree(self,schema_element_class,schema_element_filters=None):
   def tree(self,schema_element_class,schema_element_filters=None):
     """
     """
@@ -195,7 +116,7 @@ class SubSchema:
           se_oid,schema_element_class.__name__,se_obj.__class__
           se_oid,schema_element_class.__name__,se_obj.__class__
         )
         )
       for s in se_obj.sup or ('_',):
       for s in se_obj.sup or ('_',):
-        sup_oid = self.getoid(schema_element_class,s)
+        sup_oid = self.name2oid[schema_element_class].get(s,s)
         try:
         try:
           tree[sup_oid].append(se_oid)
           tree[sup_oid].append(se_oid)
         except:
         except:
@@ -203,23 +124,12 @@ class SubSchema:
     return tree
     return tree
 
 
 
 
-  def getoid(self,se_class,nameoroid,raise_keyerror=0):
+  def getoid(self,se_class,nameoroid):
     """
     """
     Get an OID by name or OID
     Get an OID by name or OID
     """
     """
-    nameoroid_stripped = nameoroid.split(';')[0].strip()
-    if nameoroid_stripped in self.sed[se_class]:
-      # name_or_oid is already a registered OID
-      return nameoroid_stripped
-    else:
-      try:
-        result_oid = self.name2oid[se_class][nameoroid_stripped]
-      except KeyError:
-        if raise_keyerror:
-          raise KeyError('No registered %s-OID for nameoroid %s' % (se_class.__name__,repr(nameoroid_stripped)))
-        else:
-          result_oid = nameoroid_stripped
-    return result_oid
+    se_oid = nameoroid.split(';')[0].strip()
+    return self.name2oid[se_class].get(se_oid,se_oid)
 
 
 
 
   def get_inheritedattr(self,se_class,nameoroid,name):
   def get_inheritedattr(self,se_class,nameoroid,name):
@@ -227,7 +137,7 @@ class SubSchema:
     Get a possibly inherited attribute specified by name
     Get a possibly inherited attribute specified by name
     of a schema element specified by nameoroid.
     of a schema element specified by nameoroid.
     Returns None if class attribute is not set at all.
     Returns None if class attribute is not set at all.
-
+    
     Raises KeyError if no schema element is found by nameoroid.
     Raises KeyError if no schema element is found by nameoroid.
     """
     """
     se = self.sed[se_class][self.getoid(se_class,nameoroid)]
     se = self.sed[se_class][self.getoid(se_class,nameoroid)]
@@ -240,21 +150,11 @@ class SubSchema:
     return result
     return result
 
 
 
 
-  def get_obj(self,se_class,nameoroid,default=None,raise_keyerror=0):
+  def get_obj(self,se_class,nameoroid,default=None):
     """
     """
     Get a schema element by name or OID
     Get a schema element by name or OID
     """
     """
-    se_oid = self.getoid(se_class,nameoroid)
-    try:
-      se_obj = self.sed[se_class][se_oid]
-    except KeyError:
-      if raise_keyerror:
-        raise KeyError('No ldap.schema.%s instance with nameoroid %s and se_oid %s' % (
-          se_class.__name__,repr(nameoroid),repr(se_oid))
-        )
-      else:
-        se_obj = default
-    return se_obj
+    return self.sed[se_class].get(self.getoid(se_class,nameoroid),default)
 
 
 
 
   def get_inheritedobj(self,se_class,nameoroid,inherited=None):
   def get_inheritedobj(self,se_class,nameoroid,inherited=None):
@@ -286,7 +186,7 @@ class SubSchema:
 
 
   def get_structural_oc(self,oc_list):
   def get_structural_oc(self,oc_list):
     """
     """
-    Returns OID of structural object class in oc_list
+    Returns OID of structural object class in object_class_list
     if any is present. Returns None else.
     if any is present. Returns None else.
     """
     """
     # Get tree of all STRUCTURAL object classes
     # Get tree of all STRUCTURAL object classes
@@ -342,17 +242,17 @@ class SubSchema:
         which has to be matched
         which has to be matched
     raise_keyerror
     raise_keyerror
         All KeyError exceptions for non-existent schema elements
         All KeyError exceptions for non-existent schema elements
-        are ignored
+	are ignored
     ignore_dit_content_rule
     ignore_dit_content_rule
-        A DIT content rule governing the structural object class
-        is ignored
+	A DIT content rule governing the structural object class
+	is ignored
     """
     """
     AttributeType = ldap.schema.AttributeType
     AttributeType = ldap.schema.AttributeType
     ObjectClass = ldap.schema.ObjectClass
     ObjectClass = ldap.schema.ObjectClass
 
 
     # Map object_class_list to object_class_oids (list of OIDs)
     # Map object_class_list to object_class_oids (list of OIDs)
     object_class_oids = [
     object_class_oids = [
-      self.getoid(ObjectClass,o)
+      self.name2oid[ObjectClass].get(o,o)
       for o in object_class_list
       for o in object_class_list
     ]
     ]
     # Initialize
     # Initialize
@@ -384,14 +284,28 @@ class SubSchema:
       assert hasattr(object_class,'must'),ValueError(object_class_oid)
       assert hasattr(object_class,'must'),ValueError(object_class_oid)
       assert hasattr(object_class,'may'),ValueError(object_class_oid)
       assert hasattr(object_class,'may'),ValueError(object_class_oid)
       for a in object_class.must:
       for a in object_class.must:
-        se_oid = self.getoid(AttributeType,a,raise_keyerror=raise_keyerror)
-        r_must[se_oid] = self.get_obj(AttributeType,se_oid,raise_keyerror=raise_keyerror)
+        try:
+          at_obj = self.sed[AttributeType][self.name2oid[AttributeType].get(a,a)]
+        except KeyError:
+          if raise_keyerror:
+            raise
+          else:
+            r_must[a] = None
+        else:
+          r_must[at_obj.oid] = at_obj
       for a in object_class.may:
       for a in object_class.may:
-        se_oid = self.getoid(AttributeType,a,raise_keyerror=raise_keyerror)
-        r_may[se_oid] = self.get_obj(AttributeType,se_oid,raise_keyerror=raise_keyerror)
+        try:
+          at_obj = self.sed[AttributeType][self.name2oid[AttributeType].get(a,a)]
+        except KeyError:
+          if raise_keyerror:
+            raise
+          else:
+            r_may[a] = None
+        else:
+          r_may[at_obj.oid] = at_obj
 
 
       object_class_oids.extend([
       object_class_oids.extend([
-        self.getoid(ObjectClass,o)
+        self.name2oid[ObjectClass].get(o,o)
         for o in object_class.sup
         for o in object_class.sup
       ])
       ])
 
 
@@ -406,24 +320,45 @@ class SubSchema:
       structural_oc = self.get_structural_oc(object_class_list)
       structural_oc = self.get_structural_oc(object_class_list)
       if structural_oc:
       if structural_oc:
         # Process applicable DIT content rule
         # Process applicable DIT content rule
-        try:
-          dit_content_rule = self.get_obj(DITContentRule,structural_oc,raise_keyerror=1)
-        except KeyError:
-          # Not DIT content rule found for structural objectclass
-          pass
-        else:
+        dit_content_rule = self.get_obj(DITContentRule,structural_oc)
+        if dit_content_rule:
           for a in dit_content_rule.must:
           for a in dit_content_rule.must:
-            se_oid = self.getoid(AttributeType,a,raise_keyerror=raise_keyerror)
-            r_must[se_oid] = self.get_obj(AttributeType,se_oid,raise_keyerror=raise_keyerror)
+            try:
+              at_obj = self.sed[AttributeType][self.name2oid[AttributeType].get(a,a)]
+            except KeyError:
+              if raise_keyerror:
+                raise
+              else:
+                r_must[a] = None
+            else:
+              r_must[at_obj.oid] = at_obj
           for a in dit_content_rule.may:
           for a in dit_content_rule.may:
-            se_oid = self.getoid(AttributeType,a,raise_keyerror=raise_keyerror)
-            r_may[se_oid] = self.get_obj(AttributeType,se_oid,raise_keyerror=raise_keyerror)
-          for a in dit_content_rule.nots:
-            a_oid = self.getoid(AttributeType,a,raise_keyerror=raise_keyerror)
             try:
             try:
-              del r_may[a_oid]
+              at_obj = self.sed[AttributeType][self.name2oid[AttributeType].get(a,a)]
             except KeyError:
             except KeyError:
-              pass
+              if raise_keyerror:
+                raise
+              else:
+                r_may[a] = None
+            else:
+              r_may[at_obj.oid] = at_obj
+          for a in dit_content_rule.nots:
+            a_oid = self.name2oid[AttributeType].get(a,a)
+            if not r_must.has_key(a_oid):
+              try:
+                at_obj = self.sed[AttributeType][a_oid]
+              except KeyError:
+                if raise_keyerror:
+                  raise
+              else:
+                try:
+                  del r_must[at_obj.oid]
+                except KeyError:
+                  pass
+                try:
+                  del r_may[at_obj.oid]
+                except KeyError:
+                  pass
 
 
     # Apply attr_type_filter to results
     # Apply attr_type_filter to results
     if attr_type_filter:
     if attr_type_filter:
@@ -450,7 +385,7 @@ class SubSchema:
 def urlfetch(uri,trace_level=0):
 def urlfetch(uri,trace_level=0):
   """
   """
   Fetches a parsed schema entry by uri.
   Fetches a parsed schema entry by uri.
-
+  
   If uri is a LDAP URL the LDAP server is queried directly.
   If uri is a LDAP URL the LDAP server is queried directly.
   Otherwise uri is assumed to point to a LDIF file which
   Otherwise uri is assumed to point to a LDIF file which
   is loaded with urllib.
   is loaded with urllib.

+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Lib/ldap/schema/tokenizer.py → desktop/core/ext-py/python-ldap-2.3.13/Lib/ldap/schema/tokenizer.py


+ 4 - 13
desktop/core/ext-py/python-ldap-2.4.6/Lib/ldapurl.py → desktop/core/ext-py/python-ldap-2.3.13/Lib/ldapurl.py

@@ -3,7 +3,7 @@ ldapurl - handling of LDAP URLs as described in RFC 4516
 
 
 See http://www.python-ldap.org/ for details.
 See http://www.python-ldap.org/ for details.
 
 
-\$Id: ldapurl.py,v 1.54 2011/11/27 15:27:00 stroeder Exp $
+\$Id: ldapurl.py,v 1.45 2010/05/07 08:15:47 stroeder Exp $
 
 
 Python compability note:
 Python compability note:
 This module only works with Python 2.0+ since
 This module only works with Python 2.0+ since
@@ -11,7 +11,7 @@ This module only works with Python 2.0+ since
 2. list comprehensions are used.
 2. list comprehensions are used.
 """
 """
 
 
-__version__ = '2.4.6'
+__version__ = '2.3.12'
 
 
 __all__ = [
 __all__ = [
   # constants
   # constants
@@ -203,7 +203,7 @@ class LDAPUrl:
         integer search scope for ldap-module
         integer search scope for ldap-module
     filterstr
     filterstr
         String representation of LDAP Search Filters
         String representation of LDAP Search Filters
-        (see RFC 4515)
+        (see RFC 2254)
     extensions
     extensions
         Dictionary used as extensions store
         Dictionary used as extensions store
     who
     who
@@ -357,16 +357,7 @@ class LDAPUrl:
     return ldap_url
     return ldap_url
   
   
   def htmlHREF(self,urlPrefix='',hrefText=None,hrefTarget=None):
   def htmlHREF(self,urlPrefix='',hrefText=None,hrefTarget=None):
-    """
-    Returns a string with HTML link for this LDAP URL.
-    
-    urlPrefix
-        Prefix before LDAP URL (e.g. for addressing another web-based client)
-    hrefText
-        link text/description
-    hrefTarget
-        string added as link target attribute
-    """
+    """Complete """
     assert type(urlPrefix)==StringType, "urlPrefix must be StringType"
     assert type(urlPrefix)==StringType, "urlPrefix must be StringType"
     if hrefText is None:
     if hrefText is None:
       hrefText = self.unparse()
       hrefText = self.unparse()

+ 2 - 2
desktop/core/ext-py/python-ldap-2.4.6/Lib/ldif.py → desktop/core/ext-py/python-ldap-2.3.13/Lib/ldif.py

@@ -3,13 +3,13 @@ ldif - generate and parse LDIF data (see RFC 2849)
 
 
 See http://www.python-ldap.org/ for details.
 See http://www.python-ldap.org/ for details.
 
 
-$Id: ldif.py,v 1.63 2011/11/27 15:27:00 stroeder Exp $
+$Id: ldif.py,v 1.56 2010/07/19 08:23:22 stroeder Exp $
 
 
 Python compability note:
 Python compability note:
 Tested with Python 2.0+, but should work with Python 1.5.2+.
 Tested with Python 2.0+, but should work with Python 1.5.2+.
 """
 """
 
 
-__version__ = '2.4.6'
+__version__ = '2.3.12'
 
 
 __all__ = [
 __all__ = [
   # constants
   # constants

+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/MANIFEST.in → desktop/core/ext-py/python-ldap-2.3.13/MANIFEST.in


+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Modules/.cvsignore → desktop/core/ext-py/python-ldap-2.3.13/Modules/.cvsignore


+ 230 - 309
desktop/core/ext-py/python-ldap-2.4.6/Modules/LDAPObject.c → desktop/core/ext-py/python-ldap-2.3.13/Modules/LDAPObject.c

@@ -1,5 +1,5 @@
 /* See http://www.python-ldap.org/ for details.
 /* See http://www.python-ldap.org/ for details.
- * $Id: LDAPObject.c,v 1.90 2011/04/11 11:29:59 stroeder Exp $ */
+ * $Id: LDAPObject.c,v 1.88 2009/10/08 18:22:44 stroeder Exp $ */
 
 
 #include "common.h"
 #include "common.h"
 #include "patchlevel.h"
 #include "patchlevel.h"
@@ -27,7 +27,7 @@ newLDAPObject( LDAP* l )
 {
 {
     LDAPObject* self = (LDAPObject*) PyObject_NEW(LDAPObject, &LDAP_Type);
     LDAPObject* self = (LDAPObject*) PyObject_NEW(LDAPObject, &LDAP_Type);
     if (self == NULL) 
     if (self == NULL) 
-        return NULL;
+    	return NULL;
     self->ldap = l;
     self->ldap = l;
     self->_save = NULL;
     self->_save = NULL;
     self->valid = 1;
     self->valid = 1;
@@ -40,13 +40,13 @@ static void
 dealloc( LDAPObject* self )
 dealloc( LDAPObject* self )
 {
 {
     if (self->ldap) {
     if (self->ldap) {
-        if (self->valid) {
-            LDAP_BEGIN_ALLOW_THREADS( self );
-            ldap_unbind_ext( self->ldap, NULL, NULL );
-            LDAP_END_ALLOW_THREADS( self );
-            self->valid = 0;
-        }
-        self->ldap = NULL;
+	if (self->valid) {
+	    LDAP_BEGIN_ALLOW_THREADS( self );
+	    ldap_unbind_ext( self->ldap, NULL, NULL );
+	    LDAP_END_ALLOW_THREADS( self );
+	    self->valid = 0;
+	}
+	self->ldap = NULL;
     }
     }
     PyObject_DEL(self);
     PyObject_DEL(self);
 }
 }
@@ -63,10 +63,10 @@ dealloc( LDAPObject* self )
 static int
 static int
 not_valid( LDAPObject* l ) {
 not_valid( LDAPObject* l ) {
     if (l->valid) {
     if (l->valid) {
-        return 0;
+    	return 0;
     } else {
     } else {
-        PyErr_SetString( LDAPexception_class, "LDAP connection invalid" );
-        return 1;
+    	PyErr_SetString( LDAPexception_class, "LDAP connection invalid" );
+	return 1;
     }
     }
 }
 }
 
 
@@ -78,12 +78,12 @@ LDAPMod_DEL( LDAPMod* lm )
     Py_ssize_t i;
     Py_ssize_t i;
 
 
     if (lm->mod_type)
     if (lm->mod_type)
-        PyMem_DEL(lm->mod_type);
+	PyMem_DEL(lm->mod_type);
     if (lm->mod_bvalues) {
     if (lm->mod_bvalues) {
-        for (i = 0; lm->mod_bvalues[i]; i++) {
-            PyMem_DEL(lm->mod_bvalues[i]);
-        }
-        PyMem_DEL(lm->mod_bvalues);
+	for (i = 0; lm->mod_bvalues[i]; i++) {
+	    PyMem_DEL(lm->mod_bvalues[i]);
+	}
+	PyMem_DEL(lm->mod_bvalues);
     }
     }
     PyMem_DEL(lm);
     PyMem_DEL(lm);
 }
 }
@@ -95,7 +95,7 @@ LDAPMod_DEL( LDAPMod* lm )
  *
  *
  * NOTE: the resulting LDAPMod structure has pointers directly into
  * NOTE: the resulting LDAPMod structure has pointers directly into
  *       the Python string storage, so LDAPMod structures MUST have a
  *       the Python string storage, so LDAPMod structures MUST have a
- *       shorter lifetime than the tuple passed in.
+ *	 shorter lifetime than the tuple passed in.
  */
  */
 
 
 /* XXX - there is no way to pass complex-structured BER objects in here! */
 /* XXX - there is no way to pass complex-structured BER objects in here! */
@@ -110,23 +110,23 @@ Tuple_to_LDAPMod( PyObject* tup, int no_op )
     Py_ssize_t i, len, nstrs;
     Py_ssize_t i, len, nstrs;
 
 
     if (!PyTuple_Check(tup)) {
     if (!PyTuple_Check(tup)) {
-        PyErr_SetObject(PyExc_TypeError, Py_BuildValue("sO",
-           "expected a tuple", tup));
-        return NULL;
+	PyErr_SetObject(PyExc_TypeError, Py_BuildValue("sO",
+	   "expected a tuple", tup));
+	return NULL;
     }
     }
 
 
     if (no_op) {
     if (no_op) {
-        if (!PyArg_ParseTuple( tup, "sO", &type, &list ))
-                return NULL;
-        op = 0;
+	if (!PyArg_ParseTuple( tup, "sO", &type, &list ))
+		return NULL;
+	op = 0;
     } else {
     } else {
-        if (!PyArg_ParseTuple( tup, "isO", &op, &type, &list ))
-                return NULL;
+	if (!PyArg_ParseTuple( tup, "isO", &op, &type, &list ))
+		return NULL;
     }
     }
 
 
     lm = PyMem_NEW(LDAPMod, 1);
     lm = PyMem_NEW(LDAPMod, 1);
     if (lm == NULL)
     if (lm == NULL)
-        goto nomem;
+	goto nomem;
 
 
     lm->mod_op = op | LDAP_MOD_BVALUES;
     lm->mod_op = op | LDAP_MOD_BVALUES;
     lm->mod_bvalues = NULL;
     lm->mod_bvalues = NULL;
@@ -134,47 +134,47 @@ Tuple_to_LDAPMod( PyObject* tup, int no_op )
     len = strlen(type);
     len = strlen(type);
     lm->mod_type = PyMem_NEW(char, len + 1);
     lm->mod_type = PyMem_NEW(char, len + 1);
     if (lm->mod_type == NULL)
     if (lm->mod_type == NULL)
-        goto nomem;
+	goto nomem;
     memcpy(lm->mod_type, type, len + 1);
     memcpy(lm->mod_type, type, len + 1);
 
 
     if (list == Py_None) {
     if (list == Py_None) {
-        /* None indicates a NULL mod_bvals */
+	/* None indicates a NULL mod_bvals */
     } else if (PyString_Check(list)) {
     } else if (PyString_Check(list)) {
-        /* Single string is a singleton list */
-        lm->mod_bvalues = PyMem_NEW(struct berval *, 2);
-        if (lm->mod_bvalues == NULL)
-            goto nomem;
-        lm->mod_bvalues[0] = PyMem_NEW(struct berval, 1);
-        if (lm->mod_bvalues[0] == NULL)
-            goto nomem;
-        lm->mod_bvalues[1] = NULL;
-        lm->mod_bvalues[0]->bv_len = PyString_Size(list);
-        lm->mod_bvalues[0]->bv_val = PyString_AsString(list);
+	/* Single string is a singleton list */
+	lm->mod_bvalues = PyMem_NEW(struct berval *, 2);
+	if (lm->mod_bvalues == NULL)
+		goto nomem;
+	lm->mod_bvalues[0] = PyMem_NEW(struct berval, 1);
+	if (lm->mod_bvalues[0] == NULL)
+		goto nomem;
+	lm->mod_bvalues[1] = NULL;
+	lm->mod_bvalues[0]->bv_len = PyString_Size(list);
+	lm->mod_bvalues[0]->bv_val = PyString_AsString(list);
     } else if (PySequence_Check(list)) {
     } else if (PySequence_Check(list)) {
-        nstrs = PySequence_Length(list);
-        lm->mod_bvalues = PyMem_NEW(struct berval *, nstrs + 1);
-        if (lm->mod_bvalues == NULL)
-            goto nomem;
-        for (i = 0; i < nstrs; i++) {
-          lm->mod_bvalues[i] = PyMem_NEW(struct berval, 1);
-          if (lm->mod_bvalues[i] == NULL)
-              goto nomem;
-          lm->mod_bvalues[i+1] = NULL;
-          item = PySequence_GetItem(list, i);
-          if (item == NULL)
-              goto error;
-          if (!PyString_Check(item)) {
-              PyErr_SetObject( PyExc_TypeError, Py_BuildValue( "sO",
-                  "expected a string in the list", item));
-              Py_DECREF(item);
-              goto error;
-          }
-          lm->mod_bvalues[i]->bv_len = PyString_Size(item);
-          lm->mod_bvalues[i]->bv_val = PyString_AsString(item);
-          Py_DECREF(item);
-        }
-        if (nstrs == 0)
-            lm->mod_bvalues[0] = NULL;
+	nstrs = PySequence_Length(list);
+	lm->mod_bvalues = PyMem_NEW(struct berval *, nstrs + 1);
+	if (lm->mod_bvalues == NULL)
+		goto nomem;
+	for (i = 0; i < nstrs; i++) {
+	   lm->mod_bvalues[i] = PyMem_NEW(struct berval, 1);
+	   if (lm->mod_bvalues[i] == NULL)
+		goto nomem;
+	   lm->mod_bvalues[i+1] = NULL;
+	   item = PySequence_GetItem(list, i);
+	   if (item == NULL)
+		goto error;
+	   if (!PyString_Check(item)) {
+		PyErr_SetObject( PyExc_TypeError, Py_BuildValue( "sO",
+		   "expected a string in the list", item));
+		Py_DECREF(item);
+		goto error;
+	   }
+	   lm->mod_bvalues[i]->bv_len = PyString_Size(item);
+	   lm->mod_bvalues[i]->bv_val = PyString_AsString(item);
+	   Py_DECREF(item);
+	}
+	if (nstrs == 0)
+	    lm->mod_bvalues[0] = NULL;
     }
     }
 
 
     return lm;
     return lm;
@@ -183,7 +183,7 @@ nomem:
     PyErr_NoMemory();
     PyErr_NoMemory();
 error:
 error:
     if (lm) 
     if (lm) 
-        LDAPMod_DEL(lm);
+	LDAPMod_DEL(lm);
 
 
     return NULL;
     return NULL;
 }
 }
@@ -194,7 +194,7 @@ static void
 LDAPMods_DEL( LDAPMod** lms ) {
 LDAPMods_DEL( LDAPMod** lms ) {
     LDAPMod** lmp;
     LDAPMod** lmp;
     for ( lmp = lms; *lmp; lmp++ )
     for ( lmp = lms; *lmp; lmp++ )
-        LDAPMod_DEL( *lmp );
+    	LDAPMod_DEL( *lmp );
     PyMem_DEL(lms);
     PyMem_DEL(lms);
 }
 }
 
 
@@ -211,32 +211,32 @@ List_to_LDAPMods( PyObject *list, int no_op ) {
     PyObject *item;
     PyObject *item;
 
 
     if (!PySequence_Check(list)) {
     if (!PySequence_Check(list)) {
-        PyErr_SetObject( PyExc_TypeError, Py_BuildValue("sO",
-                        "expected list of tuples", list ));
-        return NULL;
+	PyErr_SetObject( PyExc_TypeError, Py_BuildValue("sO",
+			"expected list of tuples", list ));
+    	return NULL;
     }
     }
 
 
     len = PySequence_Length(list);
     len = PySequence_Length(list);
 
 
     if (len < 0) {
     if (len < 0) {
-        PyErr_SetObject( PyExc_TypeError, Py_BuildValue("sO",
-                         "expected list of tuples", list ));
-        return NULL;
+       PyErr_SetObject( PyExc_TypeError, Py_BuildValue("sO",
+                       "expected list of tuples", list ));
+       return NULL;
     }
     }
 
 
     lms = PyMem_NEW(LDAPMod *, len + 1);
     lms = PyMem_NEW(LDAPMod *, len + 1);
     if (lms == NULL) 
     if (lms == NULL) 
-        goto nomem;
+	goto nomem;
 
 
     for (i = 0; i < len; i++) {
     for (i = 0; i < len; i++) {
         lms[i] = NULL;
         lms[i] = NULL;
         item = PySequence_GetItem(list, i);
         item = PySequence_GetItem(list, i);
         if (item == NULL) 
         if (item == NULL) 
-            goto error;
+		goto error;
         lms[i] = Tuple_to_LDAPMod(item, no_op);
         lms[i] = Tuple_to_LDAPMod(item, no_op);
         Py_DECREF(item);
         Py_DECREF(item);
         if (lms[i] == NULL)
         if (lms[i] == NULL)
-            goto error;
+	    goto error;
     }
     }
     lms[len] = NULL;
     lms[len] = NULL;
     return lms;
     return lms;
@@ -245,7 +245,7 @@ nomem:
     PyErr_NoMemory();
     PyErr_NoMemory();
 error:
 error:
     if (lms)
     if (lms)
-        LDAPMods_DEL(lms);
+	LDAPMods_DEL(lms);
     return NULL;
     return NULL;
 }
 }
 
 
@@ -263,37 +263,37 @@ attrs_from_List( PyObject *attrlist, char***attrsp ) {
     PyObject *item;
     PyObject *item;
 
 
     if (attrlist == Py_None) {
     if (attrlist == Py_None) {
-        /* None means a NULL attrlist */
+	/* None means a NULL attrlist */
     } else if (PyString_Check(attrlist)) {
     } else if (PyString_Check(attrlist)) {
-        /* caught by John Benninghoff <johnb@netscape.com> */
-        PyErr_SetObject( PyExc_TypeError, Py_BuildValue("sO",
-                  "expected *list* of strings, not a string", attrlist ));
-        goto error;
+	/* caught by John Benninghoff <johnb@netscape.com> */
+	PyErr_SetObject( PyExc_TypeError, Py_BuildValue("sO",
+		  "expected *list* of strings, not a string", attrlist ));
+	goto error;
     } else if (PySequence_Check(attrlist)) {
     } else if (PySequence_Check(attrlist)) {
-        len = PySequence_Length(attrlist);
+	len = PySequence_Length(attrlist);
         attrs = PyMem_NEW(char *, len + 1);
         attrs = PyMem_NEW(char *, len + 1);
-        if (attrs == NULL)
-            goto nomem;
-
-        for (i = 0; i < len; i++) {
-            attrs[i] = NULL;
-            item = PySequence_GetItem(attrlist, i);
-            if (item == NULL)
-                goto error;
-            if (!PyString_Check(item)) {
-                PyErr_SetObject(PyExc_TypeError, Py_BuildValue("sO",
-                                "expected string in list", item));
-                Py_DECREF(item);
-                goto error;
-            }
-            attrs[i] = PyString_AsString(item);
-            Py_DECREF(item);
-        }
-        attrs[len] = NULL;
+	if (attrs == NULL)
+	    goto nomem;
+
+	for (i = 0; i < len; i++) {
+	    attrs[i] = NULL;
+	    item = PySequence_GetItem(attrlist, i);
+	    if (item == NULL)
+		goto error;
+	    if (!PyString_Check(item)) {
+		PyErr_SetObject(PyExc_TypeError, Py_BuildValue("sO",
+			  "expected string in list", item));
+		Py_DECREF(item);
+		goto error;
+	    }
+	    attrs[i] = PyString_AsString(item);
+	    Py_DECREF(item);
+	}
+	attrs[len] = NULL;
     } else {
     } else {
-        PyErr_SetObject( PyExc_TypeError, Py_BuildValue("sO",
-                         "expected list of strings or None", attrlist ));
-        goto error;
+    	PyErr_SetObject( PyExc_TypeError, Py_BuildValue("sO",
+			  "expected list of strings or None", attrlist ));
+	goto error;
     }
     }
 
 
     *attrsp = attrs;
     *attrsp = attrs;
@@ -313,8 +313,8 @@ free_attrs( char*** attrsp ) {
     char **attrs = *attrsp;
     char **attrs = *attrsp;
 
 
     if (attrs != NULL) {
     if (attrs != NULL) {
-        PyMem_DEL(attrs);
-        *attrsp = NULL;
+   	PyMem_DEL(attrs);
+	*attrsp = NULL;
     }
     }
 }
 }
 
 
@@ -355,7 +355,7 @@ l_ldap_unbind_ext( LDAPObject* self, PyObject* args )
     LDAPControl_List_DEL( client_ldcs );
     LDAPControl_List_DEL( client_ldcs );
 
 
     if ( ldaperror!=LDAP_SUCCESS )
     if ( ldaperror!=LDAP_SUCCESS )
-        return LDAPerror( self->ldap, "ldap_unbind_ext" );
+    	return LDAPerror( self->ldap, "ldap_unbind_ext" );
 
 
     self->valid = 0;
     self->valid = 0;
     Py_INCREF(Py_None);
     Py_INCREF(Py_None);
@@ -396,7 +396,7 @@ l_ldap_abandon_ext( LDAPObject* self, PyObject* args )
     LDAPControl_List_DEL( client_ldcs );
     LDAPControl_List_DEL( client_ldcs );
 
 
     if ( ldaperror!=LDAP_SUCCESS )
     if ( ldaperror!=LDAP_SUCCESS )
-        return LDAPerror( self->ldap, "ldap_abandon_ext" );
+    	return LDAPerror( self->ldap, "ldap_abandon_ext" );
 
 
     Py_INCREF(Py_None);
     Py_INCREF(Py_None);
     return Py_None;
     return Py_None;
@@ -423,7 +423,7 @@ l_ldap_add_ext( LDAPObject* self, PyObject *args )
 
 
     mods = List_to_LDAPMods( modlist, 1 );
     mods = List_to_LDAPMods( modlist, 1 );
     if (mods == NULL)
     if (mods == NULL)
-        return NULL;
+	return NULL;
 
 
     if (!PyNone_Check(serverctrls)) {
     if (!PyNone_Check(serverctrls)) {
         if (!LDAPControls_from_object(serverctrls, &server_ldcs))
         if (!LDAPControls_from_object(serverctrls, &server_ldcs))
@@ -443,7 +443,7 @@ l_ldap_add_ext( LDAPObject* self, PyObject *args )
     LDAPControl_List_DEL( client_ldcs );
     LDAPControl_List_DEL( client_ldcs );
 
 
     if ( ldaperror!=LDAP_SUCCESS )
     if ( ldaperror!=LDAP_SUCCESS )
-        return LDAPerror( self->ldap, "ldap_add_ext" );
+    	return LDAPerror( self->ldap, "ldap_add_ext" );
 
 
     return PyInt_FromLong(msgid);
     return PyInt_FromLong(msgid);
 }
 }
@@ -486,7 +486,7 @@ l_ldap_simple_bind( LDAPObject* self, PyObject* args )
     LDAPControl_List_DEL( client_ldcs );
     LDAPControl_List_DEL( client_ldcs );
 
 
     if ( ldaperror!=LDAP_SUCCESS )
     if ( ldaperror!=LDAP_SUCCESS )
-        return LDAPerror( self->ldap, "ldap_simple_bind" );
+    	return LDAPerror( self->ldap, "ldap_simple_bind" );
 
 
     return PyInt_FromLong( msgid );
     return PyInt_FromLong( msgid );
 }
 }
@@ -550,19 +550,19 @@ l_ldap_simple_bind( LDAPObject* self, PyObject* args )
 
 
 */
 */
 static int interaction ( unsigned flags, 
 static int interaction ( unsigned flags, 
-                         sasl_interact_t *interact,
-                         PyObject* SASLObject )
+			 sasl_interact_t *interact,
+			 PyObject* SASLObject )
 {
 {
 /*  const char *dflt = interact->defresult; */
 /*  const char *dflt = interact->defresult; */
   PyObject *result;
   PyObject *result;
   char *c_result;
   char *c_result;
   result = PyObject_CallMethod(SASLObject,
   result = PyObject_CallMethod(SASLObject,
-                               "callback",
-                               "isss",
-                               interact->id,  /* see sasl.h */
-                               interact->challenge,
-                               interact->prompt,   
-                               interact->defresult);
+			       "callback",
+			       "isss",
+			       interact->id,  /* see sasl.h */
+			       interact->challenge,
+			       interact->prompt,   
+			       interact->defresult);
 
 
   if (result == NULL) 
   if (result == NULL) 
     /*searching for a better error code */
     /*searching for a better error code */
@@ -599,9 +599,9 @@ static int interaction ( unsigned flags,
 */
 */
 
 
 int py_ldap_sasl_interaction(   LDAP *ld, 
 int py_ldap_sasl_interaction(   LDAP *ld, 
-                                unsigned flags, 
-                                void *defaults,
-                                void *in )
+				unsigned flags, 
+				void *defaults,
+				void *in )
 {
 {
   /* These are just typecasts */
   /* These are just typecasts */
   sasl_interact_t *interact = (sasl_interact_t *) in;
   sasl_interact_t *interact = (sasl_interact_t *) in;
@@ -672,19 +672,19 @@ l_ldap_sasl_interactive_bind_s( LDAPObject* self, PyObject* args )
        static variable would destroy thread safety, IMHO.
        static variable would destroy thread safety, IMHO.
      */
      */
     msgid = ldap_sasl_interactive_bind_s(self->ldap, 
     msgid = ldap_sasl_interactive_bind_s(self->ldap, 
-                                         who, 
-                                         c_mechanism, 
-                                         (LDAPControl**) server_ldcs, 
-                                         (LDAPControl**) client_ldcs,
-                                         sasl_flags, 
-                                         py_ldap_sasl_interaction, 
-                                         SASLObject);
+					 who, 
+					 c_mechanism, 
+					 (LDAPControl**) server_ldcs, 
+					 (LDAPControl**) client_ldcs,
+					 sasl_flags, 
+					 py_ldap_sasl_interaction, 
+					 SASLObject);
 
 
     LDAPControl_List_DEL( server_ldcs );
     LDAPControl_List_DEL( server_ldcs );
     LDAPControl_List_DEL( client_ldcs );
     LDAPControl_List_DEL( client_ldcs );
 
 
     if (msgid != LDAP_SUCCESS)
     if (msgid != LDAP_SUCCESS)
-        return LDAPerror( self->ldap, "ldap_sasl_interactive_bind_s" );
+    	return LDAPerror( self->ldap, "ldap_sasl_interactive_bind_s" );
     return PyInt_FromLong( msgid );
     return PyInt_FromLong( msgid );
 }
 }
 #endif
 #endif
@@ -727,7 +727,7 @@ l_ldap_cancel( LDAPObject* self, PyObject* args )
     LDAPControl_List_DEL( client_ldcs );
     LDAPControl_List_DEL( client_ldcs );
 
 
     if ( ldaperror!=LDAP_SUCCESS )
     if ( ldaperror!=LDAP_SUCCESS )
-        return LDAPerror( self->ldap, "ldap_cancel" );
+    	return LDAPerror( self->ldap, "ldap_cancel" );
 
 
     return PyInt_FromLong( msgid );
     return PyInt_FromLong( msgid );
 }
 }
@@ -773,7 +773,7 @@ l_ldap_compare_ext( LDAPObject* self, PyObject *args )
     LDAPControl_List_DEL( client_ldcs );
     LDAPControl_List_DEL( client_ldcs );
 
 
     if ( ldaperror!=LDAP_SUCCESS )
     if ( ldaperror!=LDAP_SUCCESS )
-        return LDAPerror( self->ldap, "ldap_compare_ext" );
+    	return LDAPerror( self->ldap, "ldap_compare_ext" );
 
 
     return PyInt_FromLong( msgid );
     return PyInt_FromLong( msgid );
 }
 }
@@ -814,7 +814,7 @@ l_ldap_delete_ext( LDAPObject* self, PyObject *args )
     LDAPControl_List_DEL( client_ldcs );
     LDAPControl_List_DEL( client_ldcs );
 
 
     if ( ldaperror!=LDAP_SUCCESS )
     if ( ldaperror!=LDAP_SUCCESS )
-        return LDAPerror( self->ldap, "ldap_delete_ext" );
+    	return LDAPerror( self->ldap, "ldap_delete_ext" );
 
 
     return PyInt_FromLong(msgid);
     return PyInt_FromLong(msgid);
 }
 }
@@ -841,7 +841,7 @@ l_ldap_modify_ext( LDAPObject* self, PyObject *args )
 
 
     mods = List_to_LDAPMods( modlist, 0 );
     mods = List_to_LDAPMods( modlist, 0 );
     if (mods == NULL)
     if (mods == NULL)
-        return NULL;
+	return NULL;
 
 
     if (!PyNone_Check(serverctrls)) {
     if (!PyNone_Check(serverctrls)) {
         if (!LDAPControls_from_object(serverctrls, &server_ldcs))
         if (!LDAPControls_from_object(serverctrls, &server_ldcs))
@@ -862,7 +862,7 @@ l_ldap_modify_ext( LDAPObject* self, PyObject *args )
     LDAPControl_List_DEL( client_ldcs );
     LDAPControl_List_DEL( client_ldcs );
 
 
     if ( ldaperror!=LDAP_SUCCESS )
     if ( ldaperror!=LDAP_SUCCESS )
-        return LDAPerror( self->ldap, "ldap_modify_ext" );
+    	return LDAPerror( self->ldap, "ldap_modify_ext" );
 
 
     return PyInt_FromLong( msgid );
     return PyInt_FromLong( msgid );
 }
 }
@@ -885,7 +885,7 @@ l_ldap_rename( LDAPObject* self, PyObject *args )
     int ldaperror;
     int ldaperror;
 
 
     if (!PyArg_ParseTuple( args, "ss|ziOO", &dn, &newrdn, &newSuperior, &delold, &serverctrls, &clientctrls ))
     if (!PyArg_ParseTuple( args, "ss|ziOO", &dn, &newrdn, &newSuperior, &delold, &serverctrls, &clientctrls ))
-        return NULL;
+    	return NULL;
     if (not_valid(self)) return NULL;
     if (not_valid(self)) return NULL;
 
 
     if (!PyNone_Check(serverctrls)) {
     if (!PyNone_Check(serverctrls)) {
@@ -906,133 +906,103 @@ l_ldap_rename( LDAPObject* self, PyObject *args )
     LDAPControl_List_DEL( client_ldcs );
     LDAPControl_List_DEL( client_ldcs );
 
 
     if ( ldaperror!=LDAP_SUCCESS )
     if ( ldaperror!=LDAP_SUCCESS )
-        return LDAPerror( self->ldap, "ldap_rename" );
+    	return LDAPerror( self->ldap, "ldap_rename" );
 
 
     return PyInt_FromLong( msgid );
     return PyInt_FromLong( msgid );
 }
 }
 
 
 
 
-/* ldap_result4 */
+/* ldap_result3 */
 
 
 static PyObject *
 static PyObject *
-l_ldap_result4( LDAPObject* self, PyObject *args )
+l_ldap_result3( LDAPObject* self, PyObject *args )
 {
 {
     int msgid = LDAP_RES_ANY;
     int msgid = LDAP_RES_ANY;
     int all = 1;
     int all = 1;
     double timeout = -1.0;
     double timeout = -1.0;
-    int add_ctrls = 0;
-    int add_intermediates = 0;
-    int add_extop = 0;
     struct timeval tv;
     struct timeval tv;
     struct timeval* tvp;
     struct timeval* tvp;
     int res_type;
     int res_type;
     LDAPMessage *msg = NULL;
     LDAPMessage *msg = NULL;
     PyObject *result_str, *retval, *pmsg, *pyctrls = 0;
     PyObject *result_str, *retval, *pmsg, *pyctrls = 0;
     int res_msgid = 0;
     int res_msgid = 0;
-    char *retoid = 0;
-    PyObject *valuestr = 0;
 
 
-    if (!PyArg_ParseTuple( args, "|iidiii", &msgid, &all, &timeout, &add_ctrls, &add_intermediates, &add_extop ))
-        return NULL;
+    if (!PyArg_ParseTuple( args, "|iid", &msgid, &all, &timeout ))
+    	return NULL;
     if (not_valid(self)) return NULL;
     if (not_valid(self)) return NULL;
     
     
     if (timeout >= 0) {
     if (timeout >= 0) {
         tvp = &tv;
         tvp = &tv;
-        set_timeval_from_double( tvp, timeout );
+	set_timeval_from_double( tvp, timeout );
     } else {
     } else {
-        tvp = NULL;
+    	tvp = NULL;
     }
     }
 
 
     LDAP_BEGIN_ALLOW_THREADS( self );
     LDAP_BEGIN_ALLOW_THREADS( self );
     res_type = ldap_result( self->ldap, msgid, all, tvp, &msg );
     res_type = ldap_result( self->ldap, msgid, all, tvp, &msg );
     LDAP_END_ALLOW_THREADS( self );
     LDAP_END_ALLOW_THREADS( self );
 
 
-    if (res_type < 0)   /* LDAP or system error */
-        return LDAPerror( self->ldap, "ldap_result4" );
+    if (res_type < 0)	/* LDAP or system error */
+    	return LDAPerror( self->ldap, "ldap_result3" );
 
 
     if (res_type == 0) {
     if (res_type == 0) {
-        /* Polls return (None, None, None, None); timeouts raise an exception */
-        if (timeout == 0) {
-            if (add_extop) {
-                return Py_BuildValue("(OOOOOO)", Py_None, Py_None, Py_None, Py_None, Py_None, Py_None);
-            } else {
-                return Py_BuildValue("(OOOO)", Py_None, Py_None, Py_None, Py_None);
-            }
-        }
-        else
-            return LDAPerr(LDAP_TIMEOUT);
+	/* Polls return (None, None, None, None); timeouts raise an exception */
+	if (timeout == 0)
+		return Py_BuildValue("(OOOO)", Py_None, Py_None, Py_None, Py_None);
+	else
+		return LDAPerr(LDAP_TIMEOUT);
     }
     }
 
 
     if (msg)
     if (msg)
-        res_msgid = ldap_msgid(msg);
+	    res_msgid = ldap_msgid(msg);
 
 
-    int result = LDAP_SUCCESS;
+    int result;
     char **refs = NULL;
     char **refs = NULL;
     LDAPControl **serverctrls = 0;
     LDAPControl **serverctrls = 0;
     LDAP_BEGIN_ALLOW_THREADS( self );
     LDAP_BEGIN_ALLOW_THREADS( self );
-    if (res_type == LDAP_RES_SEARCH_ENTRY) {
-        /* LDAPmessage_to_python will parse entries and read the controls for each entry */
-    } else if (res_type == LDAP_RES_SEARCH_REFERENCE) {
-        /* LDAPmessage_to_python will parse refs and read the controls for each res */
-    } else if (res_type == LDAP_RES_INTERMEDIATE) {
-        /* LDAPmessage_to_python will parse intermediates and controls */
-    } else {
-        int rc;
-        if (res_type == LDAP_RES_EXTENDED) {
-            struct berval *retdata = 0;
-            rc = ldap_parse_extended_result( self->ldap, msg, &retoid, &retdata, 0 );
-            /* handle error rc!=0 here? */
-            if (rc == LDAP_SUCCESS) {
-                valuestr = LDAPberval_to_object(retdata);
-            }
-            ber_bvfree( retdata );
-        }
-            
-        rc = ldap_parse_result( self->ldap, msg, &result, NULL, NULL, &refs,
-                                &serverctrls, 0 );
-    }
+    ldap_parse_result( self->ldap, msg, &result, NULL, NULL, &refs,
+		       &serverctrls, 0 );
     LDAP_END_ALLOW_THREADS( self );
     LDAP_END_ALLOW_THREADS( self );
 
 
-    if (result != LDAP_SUCCESS) {               /* result error */
-        char *e, err[1024];
-        if (result == LDAP_REFERRAL && refs && refs[0]) {
-            snprintf(err, sizeof(err), "Referral:\n%s", refs[0]);
-            e = err;
-        } else
-            e = "ldap_parse_result";
-        ldap_msgfree(msg);
-        return LDAPerror( self->ldap, e );
+    if (result != LDAP_SUCCESS) {		/* result error */
+	char *e, err[1024];
+	if (result == LDAP_REFERRAL && refs && refs[0]) {
+	    snprintf(err, sizeof(err), "Referral:\n%s", refs[0]);
+	    e = err;
+	} else
+	    e = "ldap_parse_result";
+	ldap_msgfree(msg);
+	return LDAPerror( self->ldap, e );
     }
     }
 
 
     if (!(pyctrls = LDAPControls_to_List(serverctrls))) {
     if (!(pyctrls = LDAPControls_to_List(serverctrls))) {
-        int err = LDAP_NO_MEMORY;
-        ldap_set_option(self->ldap, LDAP_OPT_ERROR_NUMBER, &err);
-        ldap_msgfree(msg);
-        return LDAPerror(self->ldap, "LDAPControls_to_List");
+	int err = LDAP_NO_MEMORY;
+	ldap_set_option(self->ldap, LDAP_OPT_ERROR_NUMBER, &err);
+	ldap_msgfree(msg);
+	return LDAPerror(self->ldap, "LDAPControls_to_List");
     }
     }
     ldap_controls_free(serverctrls);
     ldap_controls_free(serverctrls);
 
 
-    pmsg = LDAPmessage_to_python( self->ldap, msg, add_ctrls, add_intermediates );
+    pmsg = LDAPmessage_to_python( self->ldap, msg );
 
 
     result_str = LDAPconstant( res_type );
     result_str = LDAPconstant( res_type );
 
 
     if (pmsg == NULL) {
     if (pmsg == NULL) {
-            retval = NULL;
+	    retval = NULL;
     } else {
     } else {
-        /* s handles NULL, but O does not */
-        if (add_extop) {
-            retval = Py_BuildValue("(OOiOsO)", result_str, pmsg, res_msgid,
-                                   pyctrls, retoid, valuestr ? valuestr : Py_None);
-        } else {
-            retval = Py_BuildValue("(OOiO)", result_str, pmsg, res_msgid, pyctrls);
-        }
-
-        if (pmsg != Py_None) {
+	if (pyctrls != NULL) {
+        	retval = Py_BuildValue("(OOiO)", result_str, pmsg, res_msgid,
+				       pyctrls);
+	} else { 
+		PyObject *pNewList = PyList_New(0);
+        	retval = Py_BuildValue("(OOiO)", result_str, pmsg, res_msgid,
+				       pNewList);
+		Py_DECREF(pNewList);
+	}
+
+	if (pmsg != Py_None) {
         Py_DECREF(pmsg);
         Py_DECREF(pmsg);
-        }
     }
     }
-    if (valuestr) {
-        Py_DECREF(valuestr);
     }
     }
     Py_XDECREF(pyctrls);
     Py_XDECREF(pyctrls);
     Py_DECREF(result_str);
     Py_DECREF(result_str);
@@ -1067,18 +1037,18 @@ l_ldap_search_ext( LDAPObject* self, PyObject* args )
     int ldaperror;
     int ldaperror;
 
 
     if (!PyArg_ParseTuple( args, "sis|OiOOdi",
     if (!PyArg_ParseTuple( args, "sis|OiOOdi",
-                           &base, &scope, &filter, &attrlist, &attrsonly,
+    	                   &base, &scope, &filter, &attrlist, &attrsonly,
                            &serverctrls, &clientctrls, &timeout, &sizelimit )) return NULL;
                            &serverctrls, &clientctrls, &timeout, &sizelimit )) return NULL;
     if (not_valid(self)) return NULL;
     if (not_valid(self)) return NULL;
 
 
     if (!attrs_from_List( attrlist, &attrs )) 
     if (!attrs_from_List( attrlist, &attrs )) 
-         return NULL;
+   	 return NULL;
 
 
     if (timeout >= 0) {
     if (timeout >= 0) {
         tvp = &tv;
         tvp = &tv;
-        set_timeval_from_double( tvp, timeout );
+	set_timeval_from_double( tvp, timeout );
     } else {
     } else {
-        tvp = NULL;
+    	tvp = NULL;
     }
     }
 
 
     if (!PyNone_Check(serverctrls)) {
     if (!PyNone_Check(serverctrls)) {
@@ -1101,10 +1071,10 @@ l_ldap_search_ext( LDAPObject* self, PyObject* args )
     LDAPControl_List_DEL( client_ldcs );
     LDAPControl_List_DEL( client_ldcs );
 
 
     if ( ldaperror!=LDAP_SUCCESS )
     if ( ldaperror!=LDAP_SUCCESS )
-        return LDAPerror( self->ldap, "ldap_search_ext" );
+    	return LDAPerror( self->ldap, "ldap_search_ext" );
 
 
     return PyInt_FromLong( msgid );
     return PyInt_FromLong( msgid );
-}       
+}	
 
 
 
 
 /* ldap_whoami_s (available since OpenLDAP 2.1.13) */
 /* ldap_whoami_s (available since OpenLDAP 2.1.13) */
@@ -1143,7 +1113,7 @@ l_ldap_whoami_s( LDAPObject* self, PyObject* args )
     LDAPControl_List_DEL( client_ldcs );
     LDAPControl_List_DEL( client_ldcs );
 
 
     if ( ldaperror!=LDAP_SUCCESS )
     if ( ldaperror!=LDAP_SUCCESS )
-        return LDAPerror( self->ldap, "ldap_whoami_s" );
+    	return LDAPerror( self->ldap, "ldap_whoami_s" );
 
 
     result = LDAPberval_to_object(bvalue);
     result = LDAPberval_to_object(bvalue);
 
 
@@ -1163,8 +1133,8 @@ l_ldap_start_tls_s( LDAPObject* self, PyObject* args )
 
 
     result = ldap_start_tls_s( self->ldap, NULL, NULL );
     result = ldap_start_tls_s( self->ldap, NULL, NULL );
     if ( result != LDAP_SUCCESS ){
     if ( result != LDAP_SUCCESS ){
-        ldap_set_option(self->ldap, LDAP_OPT_ERROR_NUMBER, &result);
-        return LDAPerror( self->ldap, "ldap_start_tls_s" );
+	ldap_set_option(self->ldap, LDAP_OPT_ERROR_NUMBER, &result);
+	return LDAPerror( self->ldap, "ldap_start_tls_s" );
     }
     }
 
 
     Py_INCREF(Py_None);
     Py_INCREF(Py_None);
@@ -1182,9 +1152,9 @@ l_ldap_set_option(PyObject* self, PyObject *args)
     int option;
     int option;
 
 
     if (!PyArg_ParseTuple(args, "iO:set_option", &option, &value))
     if (!PyArg_ParseTuple(args, "iO:set_option", &option, &value))
-        return NULL;
+    	return NULL;
     if (LDAP_set_option((LDAPObject *)self, option, value) == -1)
     if (LDAP_set_option((LDAPObject *)self, option, value) == -1)
-        return NULL;
+	return NULL;
     Py_INCREF(Py_None);
     Py_INCREF(Py_None);
     return Py_None;
     return Py_None;
 }
 }
@@ -1198,7 +1168,7 @@ l_ldap_get_option(PyObject* self, PyObject *args)
     int option;
     int option;
 
 
     if (!PyArg_ParseTuple(args, "i:get_option", &option))
     if (!PyArg_ParseTuple(args, "i:get_option", &option))
-        return NULL;
+    	return NULL;
     return LDAP_get_option((LDAPObject *)self, option);
     return LDAP_get_option((LDAPObject *)self, option);
 }
 }
 
 
@@ -1223,7 +1193,7 @@ l_ldap_passwd( LDAPObject* self, PyObject *args )
     int ldaperror;
     int ldaperror;
 
 
     if (!PyArg_ParseTuple( args, "z#z#z#|OO", &user.bv_val, &user_len, &oldpw.bv_val, &oldpw_len, &newpw.bv_val, &newpw_len, &serverctrls, &clientctrls ))
     if (!PyArg_ParseTuple( args, "z#z#z#|OO", &user.bv_val, &user_len, &oldpw.bv_val, &oldpw_len, &newpw.bv_val, &newpw_len, &serverctrls, &clientctrls ))
-        return NULL;
+    	return NULL;
 
 
     user.bv_len = (ber_len_t) user_len;
     user.bv_len = (ber_len_t) user_len;
     oldpw.bv_len = (ber_len_t) oldpw_len;
     oldpw.bv_len = (ber_len_t) oldpw_len;
@@ -1255,55 +1225,7 @@ l_ldap_passwd( LDAPObject* self, PyObject *args )
     LDAPControl_List_DEL( client_ldcs );
     LDAPControl_List_DEL( client_ldcs );
 
 
     if ( ldaperror!=LDAP_SUCCESS )
     if ( ldaperror!=LDAP_SUCCESS )
-        return LDAPerror( self->ldap, "ldap_passwd" );
-
-    return PyInt_FromLong( msgid );
-}
-
-
-/* ldap_extended_operation */
-
-static PyObject *
-l_ldap_extended_operation( LDAPObject* self, PyObject *args )
-{
-    char *reqoid = NULL;
-    struct berval reqvalue = {0, NULL};
-    PyObject *serverctrls = Py_None;
-    PyObject *clientctrls = Py_None;
-    LDAPControl** server_ldcs = NULL;
-    LDAPControl** client_ldcs = NULL;
-
-    int msgid;
-    int ldaperror;
-
-    if (!PyArg_ParseTuple( args, "sz#|OO", &reqoid, &reqvalue.bv_val, &reqvalue.bv_len, &serverctrls, &clientctrls ))
-        return NULL;
-
-    if (not_valid(self)) return NULL;
-
-    if (!PyNone_Check(serverctrls)) {
-        if (!LDAPControls_from_object(serverctrls, &server_ldcs))
-            return NULL;
-    }
-
-    if (!PyNone_Check(clientctrls)) {
-        if (!LDAPControls_from_object(clientctrls, &client_ldcs))
-            return NULL;
-    }
-
-    LDAP_BEGIN_ALLOW_THREADS( self );
-    ldaperror = ldap_extended_operation( self->ldap, reqoid,
-            reqvalue.bv_val != NULL ? &reqvalue : NULL,
-            server_ldcs,
-            client_ldcs,
-            &msgid );
-    LDAP_END_ALLOW_THREADS( self );
-    
-    LDAPControl_List_DEL( server_ldcs );
-    LDAPControl_List_DEL( client_ldcs );
-
-    if ( ldaperror!=LDAP_SUCCESS )
-        return LDAPerror( self->ldap, "ldap_extended_operation" );
+    	return LDAPerror( self->ldap, "ldap_passwd" );
 
 
     return PyInt_FromLong( msgid );
     return PyInt_FromLong( msgid );
 }
 }
@@ -1311,30 +1233,29 @@ l_ldap_extended_operation( LDAPObject* self, PyObject *args )
 /* methods */
 /* methods */
 
 
 static PyMethodDef methods[] = {
 static PyMethodDef methods[] = {
-    {"unbind_ext",      (PyCFunction)l_ldap_unbind_ext,         METH_VARARGS },
-    {"abandon_ext",     (PyCFunction)l_ldap_abandon_ext,        METH_VARARGS },
-    {"add_ext",         (PyCFunction)l_ldap_add_ext,            METH_VARARGS },
-    {"simple_bind",     (PyCFunction)l_ldap_simple_bind,        METH_VARARGS },
+    {"unbind_ext",	(PyCFunction)l_ldap_unbind_ext,		METH_VARARGS },
+    {"abandon_ext",	(PyCFunction)l_ldap_abandon_ext,	METH_VARARGS },
+    {"add_ext",		(PyCFunction)l_ldap_add_ext,		METH_VARARGS },
+    {"simple_bind",	(PyCFunction)l_ldap_simple_bind,	METH_VARARGS },
 #ifdef HAVE_SASL
 #ifdef HAVE_SASL
-    {"sasl_interactive_bind_s", (PyCFunction)l_ldap_sasl_interactive_bind_s,    METH_VARARGS },
+    {"sasl_interactive_bind_s",	(PyCFunction)l_ldap_sasl_interactive_bind_s,	METH_VARARGS },
 #endif
 #endif
-    {"compare_ext",     (PyCFunction)l_ldap_compare_ext,        METH_VARARGS },
-    {"delete_ext",      (PyCFunction)l_ldap_delete_ext,         METH_VARARGS },
-    {"modify_ext",      (PyCFunction)l_ldap_modify_ext,         METH_VARARGS },
-    {"rename",          (PyCFunction)l_ldap_rename,             METH_VARARGS },
-    {"result4",         (PyCFunction)l_ldap_result4,            METH_VARARGS },
-    {"search_ext",      (PyCFunction)l_ldap_search_ext,         METH_VARARGS },
+    {"compare_ext",	(PyCFunction)l_ldap_compare_ext,	METH_VARARGS },
+    {"delete_ext",	(PyCFunction)l_ldap_delete_ext,		METH_VARARGS },
+    {"modify_ext",	(PyCFunction)l_ldap_modify_ext,		METH_VARARGS },
+    {"rename",	        (PyCFunction)l_ldap_rename,		METH_VARARGS },
+    {"result3",		(PyCFunction)l_ldap_result3,		METH_VARARGS },
+    {"search_ext",	(PyCFunction)l_ldap_search_ext,		METH_VARARGS },
 #ifdef HAVE_TLS
 #ifdef HAVE_TLS
-    {"start_tls_s",     (PyCFunction)l_ldap_start_tls_s,        METH_VARARGS },
+    {"start_tls_s",	(PyCFunction)l_ldap_start_tls_s,	METH_VARARGS },
 #endif
 #endif
-    {"whoami_s",        (PyCFunction)l_ldap_whoami_s,           METH_VARARGS },
-    {"passwd",          (PyCFunction)l_ldap_passwd,             METH_VARARGS },
-    {"set_option",      (PyCFunction)l_ldap_set_option,         METH_VARARGS },
-    {"get_option",      (PyCFunction)l_ldap_get_option,         METH_VARARGS },
+    {"whoami_s",	(PyCFunction)l_ldap_whoami_s,	        METH_VARARGS },
+    {"passwd",	        (PyCFunction)l_ldap_passwd,	        METH_VARARGS },
+    {"set_option",	(PyCFunction)l_ldap_set_option,		METH_VARARGS },
+    {"get_option",	(PyCFunction)l_ldap_get_option,		METH_VARARGS },
 #ifdef LDAP_API_FEATURE_CANCEL
 #ifdef LDAP_API_FEATURE_CANCEL
-    {"cancel",          (PyCFunction)l_ldap_cancel,             METH_VARARGS },
+    {"cancel",		(PyCFunction)l_ldap_cancel,		METH_VARARGS },
 #endif
 #endif
-    {"extop",           (PyCFunction)l_ldap_extended_operation,         METH_VARARGS },
     { NULL, NULL }
     { NULL, NULL }
 };
 };
 
 
@@ -1343,7 +1264,7 @@ static PyMethodDef methods[] = {
 static PyObject*
 static PyObject*
 getattr(LDAPObject* self, char* name) 
 getattr(LDAPObject* self, char* name) 
 {
 {
-        return Py_FindMethod(methods, (PyObject*)self, name);
+	return Py_FindMethod(methods, (PyObject*)self, name);
 }
 }
 
 
 /* set attribute */
 /* set attribute */
@@ -1351,32 +1272,32 @@ getattr(LDAPObject* self, char* name)
 static int
 static int
 setattr(LDAPObject* self, char* name, PyObject* value) 
 setattr(LDAPObject* self, char* name, PyObject* value) 
 {
 {
-        PyErr_SetString(PyExc_AttributeError, name);
-        return -1;
+	PyErr_SetString(PyExc_AttributeError, name);
+	return -1;
 }
 }
 
 
 /* type entry */
 /* type entry */
 
 
 PyTypeObject LDAP_Type = {
 PyTypeObject LDAP_Type = {
 #if defined(MS_WINDOWS) || defined(__CYGWIN__)
 #if defined(MS_WINDOWS) || defined(__CYGWIN__)
-        /* see http://www.python.org/doc/FAQ.html#3.24 */
-        PyObject_HEAD_INIT(NULL)
+	/* see http://www.python.org/doc/FAQ.html#3.24 */
+	PyObject_HEAD_INIT(NULL)
 #else /* ! MS_WINDOWS */
 #else /* ! MS_WINDOWS */
-        PyObject_HEAD_INIT(&PyType_Type)
+	PyObject_HEAD_INIT(&PyType_Type)
 #endif /* MS_WINDOWS */
 #endif /* MS_WINDOWS */
-        0,                      /*ob_size*/
-        "LDAP",                 /*tp_name*/
-        sizeof(LDAPObject),     /*tp_basicsize*/
-        0,                      /*tp_itemsize*/
-        /* methods */
-        (destructor)dealloc,    /*tp_dealloc*/
-        0,                      /*tp_print*/
-        (getattrfunc)getattr,   /*tp_getattr*/
-        (setattrfunc)setattr,   /*tp_setattr*/
-        0,                      /*tp_compare*/
-        0,                      /*tp_repr*/
-        0,                      /*tp_as_number*/
-        0,                      /*tp_as_sequence*/
-        0,                      /*tp_as_mapping*/
-        0,                      /*tp_hash*/
+	0,                      /*ob_size*/
+	"LDAP",                 /*tp_name*/
+	sizeof(LDAPObject),     /*tp_basicsize*/
+	0,                      /*tp_itemsize*/
+	/* methods */
+	(destructor)dealloc,	/*tp_dealloc*/
+	0,                      /*tp_print*/
+	(getattrfunc)getattr,	/*tp_getattr*/
+	(setattrfunc)setattr,	/*tp_setattr*/
+	0,                      /*tp_compare*/
+	0,                      /*tp_repr*/
+	0,                      /*tp_as_number*/
+	0,                      /*tp_as_sequence*/
+	0,                      /*tp_as_mapping*/
+	0,                      /*tp_hash*/
 };
 };

+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Modules/LDAPObject.h → desktop/core/ext-py/python-ldap-2.3.13/Modules/LDAPObject.h


+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Modules/berval.c → desktop/core/ext-py/python-ldap-2.3.13/Modules/berval.c


+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Modules/berval.h → desktop/core/ext-py/python-ldap-2.3.13/Modules/berval.h


+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Modules/common.c → desktop/core/ext-py/python-ldap-2.3.13/Modules/common.c


+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Modules/common.h → desktop/core/ext-py/python-ldap-2.3.13/Modules/common.h


+ 305 - 0
desktop/core/ext-py/python-ldap-2.3.13/Modules/constants.c

@@ -0,0 +1,305 @@
+/* constants defined for LDAP
+ * See http://www.python-ldap.org/ for details.
+ * $Id: constants.c,v 1.49 2010/10/01 18:23:18 stroeder Exp $ */
+
+#include "common.h"
+#include "constants.h"
+#include "lber.h"
+#include "ldap.h"
+
+static PyObject* reverse;
+static PyObject* forward;
+
+/* convert an result integer into a Python string */
+
+PyObject*
+LDAPconstant( int val ) {
+    PyObject *i = PyInt_FromLong( val );
+    PyObject *s = PyObject_GetItem( reverse, i );
+    if (s == NULL) {
+    	PyErr_Clear();
+	return i;
+    }
+    Py_DECREF(i);
+    return s;
+}
+
+/* initialise the module constants */
+
+void
+LDAPinit_constants( PyObject* d )
+{
+	PyObject *zero, *author,*obj;
+
+	reverse = PyDict_New();
+	forward = PyDict_New();
+	
+	PyDict_SetItemString( d, "_reverse", reverse );
+	PyDict_SetItemString( d, "_forward", forward );
+
+#define add_int(d, name)                                                \
+	{								\
+		PyObject *i = PyInt_FromLong(LDAP_##name);		\
+		PyDict_SetItemString( d, #name, i );			\
+		Py_DECREF(i);						\
+	}
+
+	/* simple constants */
+
+	add_int(d,API_VERSION);
+	add_int(d,VENDOR_VERSION);
+
+        add_int(d,PORT);
+	add_int(d,VERSION1);
+	add_int(d,VERSION2);
+	add_int(d,VERSION3);
+	add_int(d,VERSION_MIN);
+	add_int(d,VERSION);
+	add_int(d,VERSION_MAX);
+	add_int(d,TAG_MESSAGE);
+	add_int(d,TAG_MSGID);
+
+	add_int(d,REQ_BIND);
+	add_int(d,REQ_UNBIND);
+	add_int(d,REQ_SEARCH);
+	add_int(d,REQ_MODIFY);
+	add_int(d,REQ_ADD);
+	add_int(d,REQ_DELETE);
+	add_int(d,REQ_MODRDN);
+	add_int(d,REQ_COMPARE);
+	add_int(d,REQ_ABANDON);
+
+	add_int(d,TAG_LDAPDN);
+	add_int(d,TAG_LDAPCRED);
+	add_int(d,TAG_CONTROLS);
+	add_int(d,TAG_REFERRAL);
+
+	add_int(d,REQ_EXTENDED);
+#if LDAP_API_VERSION >= 2004
+	add_int(d,TAG_NEWSUPERIOR);
+	add_int(d,TAG_EXOP_REQ_OID);
+	add_int(d,TAG_EXOP_REQ_VALUE);
+	add_int(d,TAG_EXOP_RES_OID);
+	add_int(d,TAG_EXOP_RES_VALUE);
+#ifdef HAVE_SASL
+	add_int(d,TAG_SASL_RES_CREDS);
+#endif
+#endif
+
+	add_int(d,SASL_AUTOMATIC);
+	add_int(d,SASL_INTERACTIVE);
+	add_int(d,SASL_QUIET);
+
+	/* reversibles */
+
+	zero = PyInt_FromLong( 0 );
+	PyDict_SetItem( reverse, zero, Py_None );
+	Py_DECREF( zero );
+
+	add_int(d,RES_BIND);
+	add_int(d,RES_SEARCH_ENTRY);
+	add_int(d,RES_SEARCH_RESULT);
+	add_int(d,RES_MODIFY);
+	add_int(d,RES_ADD);
+	add_int(d,RES_DELETE);
+	add_int(d,RES_MODRDN);
+	add_int(d,RES_COMPARE);
+	add_int(d,RES_ANY);
+
+	add_int(d,RES_SEARCH_REFERENCE);
+	add_int(d,RES_EXTENDED);
+	add_int(d,RES_UNSOLICITED);
+
+	/* non-reversibles */
+
+	add_int(d,AUTH_NONE);
+	add_int(d,AUTH_SIMPLE);
+	add_int(d,SCOPE_BASE);
+	add_int(d,SCOPE_ONELEVEL);
+	add_int(d,SCOPE_SUBTREE);
+	add_int(d,MOD_ADD);
+	add_int(d,MOD_DELETE);
+	add_int(d,MOD_REPLACE);
+	add_int(d,MOD_INCREMENT);
+	add_int(d,MOD_BVALUES);
+
+	add_int(d,MSG_ONE);
+	add_int(d,MSG_ALL);
+	add_int(d,MSG_RECEIVED);
+
+	/* (errors.c contains the error constants) */
+
+	add_int(d,DEREF_NEVER);
+	add_int(d,DEREF_SEARCHING);
+	add_int(d,DEREF_FINDING);
+	add_int(d,DEREF_ALWAYS);
+	add_int(d,NO_LIMIT);
+
+	add_int(d,OPT_API_INFO);
+	add_int(d,OPT_DEREF);
+	add_int(d,OPT_SIZELIMIT);
+	add_int(d,OPT_TIMELIMIT);
+#ifdef LDAP_OPT_REFERRALS
+	add_int(d,OPT_REFERRALS);
+#endif
+	add_int(d,OPT_ERROR_NUMBER);
+	add_int(d,OPT_RESTART);
+	add_int(d,OPT_PROTOCOL_VERSION);
+	add_int(d,OPT_SERVER_CONTROLS);
+	add_int(d,OPT_CLIENT_CONTROLS);
+	add_int(d,OPT_API_FEATURE_INFO);
+	add_int(d,OPT_HOST_NAME);
+
+	/* For backward-compability with OpenLDAP 2.3 libs this is defined in ldap/__init__.py */
+	/* add_int(d,OPT_DIAGNOSTIC_MESSAGE); */
+
+	add_int(d,OPT_ERROR_STRING);
+	add_int(d,OPT_MATCHED_DN);
+	add_int(d,OPT_DEBUG_LEVEL);
+	add_int(d,OPT_TIMEOUT);
+	add_int(d,OPT_REFHOPLIMIT);
+	add_int(d,OPT_NETWORK_TIMEOUT);
+	add_int(d,OPT_URI);
+#ifdef LDAP_OPT_DEFBASE
+	add_int(d,OPT_DEFBASE);
+#endif
+#ifdef HAVE_TLS
+	add_int(d,OPT_X_TLS);
+#ifdef LDAP_OPT_X_TLS_NEWCTX
+	add_int(d,OPT_X_TLS_CTX);
+#endif
+	add_int(d,OPT_X_TLS_CACERTFILE);
+	add_int(d,OPT_X_TLS_CACERTDIR);
+	add_int(d,OPT_X_TLS_CERTFILE);
+	add_int(d,OPT_X_TLS_KEYFILE);
+	add_int(d,OPT_X_TLS_REQUIRE_CERT);
+	add_int(d,OPT_X_TLS_CIPHER_SUITE);
+	add_int(d,OPT_X_TLS_RANDOM_FILE);
+	add_int(d,OPT_X_TLS_DHFILE);
+	add_int(d,OPT_X_TLS_NEVER);
+	add_int(d,OPT_X_TLS_HARD);
+	add_int(d,OPT_X_TLS_DEMAND);
+	add_int(d,OPT_X_TLS_ALLOW);
+	add_int(d,OPT_X_TLS_TRY);
+#ifdef LDAP_OPT_X_TLS_CRLCHECK
+  /* only available if OpenSSL supports it => might cause backward compability problems */
+	add_int(d,OPT_X_TLS_CRLCHECK);
+#ifdef LDAP_OPT_X_TLS_CRLFILE
+	add_int(d,OPT_X_TLS_CRLFILE);
+#endif
+	add_int(d,OPT_X_TLS_CRL_NONE);
+	add_int(d,OPT_X_TLS_CRL_PEER);
+	add_int(d,OPT_X_TLS_CRL_ALL);
+#endif
+#ifdef LDAP_OPT_X_TLS_NEWCTX
+	add_int(d,OPT_X_TLS_NEWCTX);
+#endif
+#ifdef LDAP_OPT_X_TLS_PROTOCOL_MIN
+	add_int(d,OPT_X_TLS_PROTOCOL_MIN);
+#endif
+#endif
+	add_int(d,OPT_X_SASL_MECH);
+	add_int(d,OPT_X_SASL_REALM);
+	add_int(d,OPT_X_SASL_AUTHCID);
+	add_int(d,OPT_X_SASL_AUTHZID);
+	add_int(d,OPT_X_SASL_SSF);
+	add_int(d,OPT_X_SASL_SSF_EXTERNAL);
+	add_int(d,OPT_X_SASL_SECPROPS);
+	add_int(d,OPT_X_SASL_SSF_MIN);
+	add_int(d,OPT_X_SASL_SSF_MAX);
+#ifdef LDAP_OPT_X_SASL_NOCANON
+	add_int(d,OPT_X_SASL_NOCANON);
+#endif
+#ifdef LDAP_OPT_X_SASL_USERNAME
+	add_int(d,OPT_X_SASL_USERNAME);
+#endif
+#ifdef LDAP_OPT_CONNECT_ASYNC
+	add_int(d,OPT_CONNECT_ASYNC);
+#endif
+#ifdef LDAP_OPT_X_KEEPALIVE_IDLE
+	add_int(d,OPT_X_KEEPALIVE_IDLE);
+#endif
+#ifdef LDAP_OPT_X_KEEPALIVE_PROBES
+	add_int(d,OPT_X_KEEPALIVE_PROBES);
+#endif
+#ifdef LDAP_OPT_X_KEEPALIVE_INTERVAL
+	add_int(d,OPT_X_KEEPALIVE_INTERVAL);
+#endif
+
+	add_int(d,DN_FORMAT_LDAP);
+	add_int(d,DN_FORMAT_LDAPV3);
+	add_int(d,DN_FORMAT_LDAPV2);
+	add_int(d,DN_FORMAT_DCE);
+	add_int(d,DN_FORMAT_UFN);
+	add_int(d,DN_FORMAT_AD_CANONICAL);
+	/* add_int(d,DN_FORMAT_LBER); */    /* "for testing only" */
+	add_int(d,DN_FORMAT_MASK);
+	add_int(d,DN_PRETTY);
+	add_int(d,DN_SKIP);
+	add_int(d,DN_P_NOLEADTRAILSPACES);
+	add_int(d,DN_P_NOSPACEAFTERRDN);
+	add_int(d,DN_PEDANTIC);
+
+	add_int(d,AVA_NULL);
+	add_int(d,AVA_STRING);
+	add_int(d,AVA_BINARY);
+	add_int(d,AVA_NONPRINTABLE);
+	
+	/*add_int(d,OPT_ON);*/
+	obj = PyInt_FromLong(1);
+	PyDict_SetItemString( d, "OPT_ON", obj );
+	Py_DECREF(obj);
+	/*add_int(d,OPT_OFF);*/
+	obj = PyInt_FromLong(0);
+	PyDict_SetItemString( d, "OPT_OFF", obj );			
+	Py_DECREF(obj);
+	
+	add_int(d,OPT_SUCCESS);
+
+	/* XXX - these belong in errors.c */
+
+	add_int(d,URL_ERR_BADSCOPE);
+	add_int(d,URL_ERR_MEM);
+
+	/* author */
+
+	author = PyString_FromString("python-ldap-dev@lists.sf.net");
+	PyDict_SetItemString(d, "__author__", author);
+	Py_DECREF(author);
+
+	/* add_int(d,LIBLDAP_R); */
+#ifdef HAVE_LIBLDAP_R
+	obj = PyInt_FromLong(1);
+#else
+	obj = PyInt_FromLong(0);
+#endif
+	PyDict_SetItemString( d, "LIBLDAP_R", obj );
+	Py_DECREF(obj);
+
+	/* add_int(d,SASL); */
+#ifdef HAVE_SASL
+	obj = PyInt_FromLong(1);
+#else
+	obj = PyInt_FromLong(0);
+#endif
+	PyDict_SetItemString( d, "SASL_AVAIL", obj );
+	Py_DECREF(obj);
+
+	/* add_int(d,TLS); */
+#ifdef HAVE_TLS
+	obj = PyInt_FromLong(1);
+#else
+	obj = PyInt_FromLong(0);
+#endif
+	PyDict_SetItemString( d, "TLS_AVAIL", obj );
+	Py_DECREF(obj);
+
+	obj = PyString_FromString(LDAP_CONTROL_PAGE_OID);
+	PyDict_SetItemString( d, "LDAP_CONTROL_PAGE_OID", obj );
+	Py_DECREF(obj);
+
+	obj = PyString_FromString(LDAP_CONTROL_VALUESRETURNFILTER);
+	PyDict_SetItemString( d, "LDAP_CONTROL_VALUESRETURNFILTER", obj );
+	Py_DECREF(obj);
+
+}

+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Modules/constants.h → desktop/core/ext-py/python-ldap-2.3.13/Modules/constants.h


+ 220 - 0
desktop/core/ext-py/python-ldap-2.3.13/Modules/errors.c

@@ -0,0 +1,220 @@
+/*
+ * errors that arise from ldap use
+ * Most errors become their own exception
+ * See http://www.python-ldap.org/ for details.
+ * $Id: errors.c,v 1.21 2009/04/17 12:19:09 stroeder Exp $ */
+
+#include "common.h"
+#include "errors.h"
+
+/* the base exception class */
+
+PyObject*
+LDAPexception_class;
+
+/* list of error objects */
+
+#define LDAP_ERROR_MIN          LDAP_REFERRAL_LIMIT_EXCEEDED
+
+#ifdef LDAP_PROXIED_AUTHORIZATION_DENIED
+	#define LDAP_ERROR_MAX          LDAP_PROXIED_AUTHORIZATION_DENIED
+#else
+	#ifdef LDAP_ASSERTION_FAILED
+		#define LDAP_ERROR_MAX          LDAP_ASSERTION_FAILED
+	#else
+		#define LDAP_ERROR_MAX          LDAP_OTHER
+	#endif
+#endif
+
+#define LDAP_ERROR_OFFSET       -LDAP_ERROR_MIN
+
+static PyObject* errobjects[ LDAP_ERROR_MAX-LDAP_ERROR_MIN+1 ];
+
+
+/* Convert a bare LDAP error number into an exception */
+PyObject*
+LDAPerr(int errnum)
+{
+	if (errnum >= LDAP_ERROR_MIN && errnum <= LDAP_ERROR_MAX)
+		PyErr_SetNone(errobjects[errnum+LDAP_ERROR_OFFSET]);
+	else
+		PyErr_SetObject(LDAPexception_class, 
+		    Py_BuildValue("{s:i}", "errnum", errnum));
+	return NULL;
+}
+
+/* Convert an LDAP error into an informative python exception */
+PyObject*
+LDAPerror( LDAP*l, char*msg ) 
+{
+	if (l == NULL) {
+		PyErr_SetFromErrno( LDAPexception_class );
+		return NULL;
+	}
+	else {
+		int errnum, opt_errnum;
+		PyObject *errobj;
+		PyObject *info;
+		PyObject *str;
+
+		char *matched, *error;
+
+		opt_errnum = ldap_get_option(l, LDAP_OPT_ERROR_NUMBER, &errnum);
+		if (opt_errnum != LDAP_OPT_SUCCESS)
+			errnum = opt_errnum;
+
+		if (errnum == LDAP_NO_MEMORY)
+			return PyErr_NoMemory();
+
+		if (errnum >= LDAP_ERROR_MIN && errnum <= LDAP_ERROR_MAX)
+			errobj = errobjects[errnum+LDAP_ERROR_OFFSET];
+		else
+			errobj = LDAPexception_class;
+		
+		info = PyDict_New();
+		if (info == NULL)
+			return NULL;
+
+		str = PyString_FromString(ldap_err2string(errnum));
+		if (str)
+			PyDict_SetItemString( info, "desc", str );
+		Py_XDECREF(str);
+
+		if (ldap_get_option(l, LDAP_OPT_MATCHED_DN, &matched) >= 0
+			&& matched != NULL) {
+		    if (*matched != '\0') {
+			str = PyString_FromString(matched);
+			if (str)
+			    PyDict_SetItemString( info, "matched", str );
+			Py_XDECREF(str);
+		    }
+		    ldap_memfree(matched);
+		}
+		
+		if (errnum == LDAP_REFERRAL) {
+		    str = PyString_FromString(msg);
+		    if (str)
+			PyDict_SetItemString( info, "info", str );
+		    Py_XDECREF(str);
+		} else if (ldap_get_option(l, LDAP_OPT_ERROR_STRING, &error) >= 0
+			&& error != NULL) {
+		    if (error != '\0') {
+			str = PyString_FromString(error);
+			if (str)
+			    PyDict_SetItemString( info, "info", str );
+			Py_XDECREF(str);
+		    }
+		    ldap_memfree(error);
+		}
+		PyErr_SetObject( errobj, info );
+		Py_DECREF(info);
+		return NULL;
+	}
+}
+
+
+/* initialisation */
+
+void
+LDAPinit_errors( PyObject*d ) {
+
+        /* create the base exception class */
+        LDAPexception_class = PyErr_NewException("ldap.LDAPError",
+                                                  NULL,
+                                                  NULL);
+        PyDict_SetItemString( d, "LDAPError", LDAPexception_class );
+
+	/* XXX - backward compatibility with pre-1.8 */
+        PyDict_SetItemString( d, "error", LDAPexception_class );
+	Py_DECREF( LDAPexception_class );
+
+	/* create each LDAP error object */
+
+#	define seterrobj2(n,o) \
+		PyDict_SetItemString( d, #n, (errobjects[LDAP_##n+LDAP_ERROR_OFFSET] = o) )
+
+
+#	define seterrobj(n) { \
+		PyObject *e = PyErr_NewException("ldap." #n,		\
+				  LDAPexception_class, NULL);		\
+		seterrobj2(n, e);					\
+		Py_INCREF(e);						\
+	}
+
+	seterrobj(ADMINLIMIT_EXCEEDED);
+	seterrobj(AFFECTS_MULTIPLE_DSAS);
+	seterrobj(ALIAS_DEREF_PROBLEM);
+	seterrobj(ALIAS_PROBLEM);
+	seterrobj(ALREADY_EXISTS);
+	seterrobj(AUTH_UNKNOWN);
+	seterrobj(BUSY);
+	seterrobj(CLIENT_LOOP);
+	seterrobj(COMPARE_FALSE);
+	seterrobj(COMPARE_TRUE);
+	seterrobj(CONFIDENTIALITY_REQUIRED);
+	seterrobj(CONNECT_ERROR);
+	seterrobj(CONSTRAINT_VIOLATION);
+	seterrobj(CONTROL_NOT_FOUND);
+	seterrobj(DECODING_ERROR);
+	seterrobj(ENCODING_ERROR);
+	seterrobj(FILTER_ERROR);
+	seterrobj(INAPPROPRIATE_AUTH);
+	seterrobj(INAPPROPRIATE_MATCHING);
+	seterrobj(INSUFFICIENT_ACCESS);
+	seterrobj(INVALID_CREDENTIALS);
+	seterrobj(INVALID_DN_SYNTAX);
+	seterrobj(INVALID_SYNTAX);
+	seterrobj(IS_LEAF);
+	seterrobj(LOCAL_ERROR);
+	seterrobj(LOOP_DETECT);
+	seterrobj(MORE_RESULTS_TO_RETURN);
+	seterrobj(NAMING_VIOLATION);
+	seterrobj(NO_OBJECT_CLASS_MODS);
+	seterrobj(NOT_ALLOWED_ON_NONLEAF);
+	seterrobj(NOT_ALLOWED_ON_RDN);
+	seterrobj(NOT_SUPPORTED);
+	seterrobj(NO_MEMORY);
+	seterrobj(NO_OBJECT_CLASS_MODS);
+	seterrobj(NO_RESULTS_RETURNED);
+	seterrobj(NO_SUCH_ATTRIBUTE);
+	seterrobj(NO_SUCH_OBJECT);
+	seterrobj(OBJECT_CLASS_VIOLATION);
+	seterrobj(OPERATIONS_ERROR);
+	seterrobj(OTHER);
+	seterrobj(PARAM_ERROR);
+	seterrobj(PARTIAL_RESULTS);
+	seterrobj(PROTOCOL_ERROR);
+	seterrobj(REFERRAL);
+	seterrobj(REFERRAL_LIMIT_EXCEEDED);
+	seterrobj(RESULTS_TOO_LARGE);
+	seterrobj(SASL_BIND_IN_PROGRESS);
+	seterrobj(SERVER_DOWN);
+	seterrobj(SIZELIMIT_EXCEEDED);
+	seterrobj(STRONG_AUTH_NOT_SUPPORTED);
+	seterrobj(STRONG_AUTH_REQUIRED);
+	seterrobj(SUCCESS);
+	seterrobj(TIMELIMIT_EXCEEDED);
+	seterrobj(TIMEOUT);
+	seterrobj(TYPE_OR_VALUE_EXISTS);
+	seterrobj(UNAVAILABLE);
+	seterrobj(UNAVAILABLE_CRITICAL_EXTENSION);
+	seterrobj(UNDEFINED_TYPE);
+	seterrobj(UNWILLING_TO_PERFORM);
+	seterrobj(USER_CANCELLED);
+
+#ifdef LDAP_API_FEATURE_CANCEL
+	seterrobj(CANCELLED);
+	seterrobj(NO_SUCH_OPERATION);
+	seterrobj(TOO_LATE);
+	seterrobj(CANNOT_CANCEL);
+#endif
+
+#ifdef LDAP_ASSERTION_FAILED
+	seterrobj(ASSERTION_FAILED);
+#endif
+
+#ifdef LDAP_PROXIED_AUTHORIZATION_DENIED
+  seterrobj(PROXIED_AUTHORIZATION_DENIED);
+#endif
+
+}

+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Modules/errors.h → desktop/core/ext-py/python-ldap-2.3.13/Modules/errors.h


+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Modules/functions.c → desktop/core/ext-py/python-ldap-2.3.13/Modules/functions.c


+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Modules/functions.h → desktop/core/ext-py/python-ldap-2.3.13/Modules/functions.h


+ 9 - 11
desktop/core/ext-py/python-ldap-2.4.6/Modules/ldapcontrol.c → desktop/core/ext-py/python-ldap-2.3.13/Modules/ldapcontrol.c

@@ -1,5 +1,5 @@
 /* See http://www.python-ldap.org/ for details.
 /* See http://www.python-ldap.org/ for details.
- * $Id: ldapcontrol.c,v 1.20 2011/10/26 18:38:06 stroeder Exp $ */
+ * $Id: ldapcontrol.c,v 1.17 2009/08/17 01:49:47 leonard Exp $ */
 
 
 #include "common.h"
 #include "common.h"
 #include "LDAPObject.h"
 #include "LDAPObject.h"
@@ -152,13 +152,11 @@ LDAPControls_from_object(PyObject* list, LDAPControl ***controls_ret)
 
 
       ldc = Tuple_to_LDAPControl(item);
       ldc = Tuple_to_LDAPControl(item);
       if (ldc == NULL) {
       if (ldc == NULL) {
-          Py_DECREF(item);
           PyMem_DEL(ldcs);
           PyMem_DEL(ldcs);
           return 0;
           return 0;
       }
       }
 
 
       ldcs[i] = ldc;
       ldcs[i] = ldc;
-      Py_DECREF(item);
     }
     }
 
 
     ldcs[len] = NULL;
     ldcs[len] = NULL;
@@ -331,6 +329,7 @@ decode_rfc2696(PyObject *self, PyObject *args)
     return res;
     return res;
 }
 }
 
 
+#ifdef LIBLDAP_HAS_ASSERTION_CONTROL_FUNC
 static PyObject*
 static PyObject*
 encode_assertion_control(PyObject *self, PyObject *args)
 encode_assertion_control(PyObject *self, PyObject *args)
 {
 {
@@ -338,33 +337,32 @@ encode_assertion_control(PyObject *self, PyObject *args)
     PyObject *res = 0;
     PyObject *res = 0;
     char *assertion_filterstr;
     char *assertion_filterstr;
     struct berval ctrl_val;
     struct berval ctrl_val;
-    LDAP *ld = NULL;
+    BerElement *ber = 0;
 
 
     if (!PyArg_ParseTuple(args, "s:encode_assertion_control",
     if (!PyArg_ParseTuple(args, "s:encode_assertion_control",
                           &assertion_filterstr)) {
                           &assertion_filterstr)) {
         goto endlbl;
         goto endlbl;
     }
     }
 
 
-    err = ldap_create(&ld);
-    if (err != LDAP_SUCCESS)
-    	return LDAPerror(ld, "ldap_create");
-
-    err = ldap_create_assertion_control_value(ld,assertion_filterstr,&ctrl_val);
-    if (err != LDAP_SUCCESS)
-    	return LDAPerror(ld, "ldap_create_assertion_control_value");
+    err = ldap_create_assertion_control_value(NULL,assertion_filterstr,&ctrl_val);
 
 
     res = LDAPberval_to_object(&ctrl_val);
     res = LDAPberval_to_object(&ctrl_val);
 
 
     endlbl:
     endlbl:
+       if (ber)
+           ber_free(ber, 1);
 
 
     return res;
     return res;
 }
 }
+#endif
 
 
 static PyMethodDef methods[] = {
 static PyMethodDef methods[] = {
     {"encode_page_control", encode_rfc2696, METH_VARARGS },
     {"encode_page_control", encode_rfc2696, METH_VARARGS },
     {"decode_page_control", decode_rfc2696, METH_VARARGS },
     {"decode_page_control", decode_rfc2696, METH_VARARGS },
     {"encode_valuesreturnfilter_control", encode_rfc3876, METH_VARARGS },
     {"encode_valuesreturnfilter_control", encode_rfc3876, METH_VARARGS },
+#ifdef LIBLDAP_HAS_ASSERTION_CONTROL_FUNC
     {"encode_assertion_control", encode_assertion_control, METH_VARARGS },
     {"encode_assertion_control", encode_assertion_control, METH_VARARGS },
+#endif
     { NULL, NULL }
     { NULL, NULL }
 };
 };
 
 

+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Modules/ldapcontrol.h → desktop/core/ext-py/python-ldap-2.3.13/Modules/ldapcontrol.h


+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Modules/ldapmodule.c → desktop/core/ext-py/python-ldap-2.3.13/Modules/ldapmodule.c


+ 7 - 105
desktop/core/ext-py/python-ldap-2.4.6/Modules/message.c → desktop/core/ext-py/python-ldap-2.3.13/Modules/message.c

@@ -1,12 +1,10 @@
 /* See http://www.python-ldap.org/ for details.
 /* See http://www.python-ldap.org/ for details.
- * $Id: message.c,v 1.19 2011/10/26 18:38:06 stroeder Exp $ */
+ * $Id: message.c,v 1.16 2009/08/17 01:49:47 leonard Exp $ */
 
 
 #include "common.h"
 #include "common.h"
 #include "message.h"
 #include "message.h"
 #include "berval.h"
 #include "berval.h"
 #include "errors.h"
 #include "errors.h"
-#include "ldapcontrol.h"
-#include "constants.h"
 
 
 /*
 /*
  * Converts an LDAP message into a Python structure.
  * Converts an LDAP message into a Python structure.
@@ -15,25 +13,17 @@
  * On failure, returns NULL, and sets an error.
  * On failure, returns NULL, and sets an error.
  *
  *
  * The message m is always freed, regardless of return value.
  * The message m is always freed, regardless of return value.
- *
- * If add_ctrls is non-zero, per-entry/referral/partial/intermediate
- * controls will be added as a third item to each entry tuple
- *
- * If add_intermediates is non-zero, intermediate/partial results will
- * be returned
  */
  */
 PyObject *
 PyObject *
-LDAPmessage_to_python(LDAP *ld, LDAPMessage *m, int add_ctrls, int add_intermediates)
+LDAPmessage_to_python(LDAP *ld, LDAPMessage *m)
 {
 {
     /* we convert an LDAP message into a python structure.
     /* we convert an LDAP message into a python structure.
      * It is always a list of dictionaries.
      * It is always a list of dictionaries.
      * We always free m.
      * We always free m.
      */
      */
 
 
-     PyObject *result, *pyctrls = 0;
+     PyObject* result;
      LDAPMessage* entry;
      LDAPMessage* entry;
-     LDAPControl **serverctrls = 0;
-     int rc;
 
 
      result = PyList_New(0);
      result = PyList_New(0);
      if (result == NULL) {
      if (result == NULL) {
@@ -66,27 +56,7 @@ LDAPmessage_to_python(LDAP *ld, LDAPMessage *m, int add_ctrls, int add_intermedi
 		return NULL;
 		return NULL;
 	 }
 	 }
 
 
-	 rc = ldap_get_entry_controls( ld, entry, &serverctrls );
-	 if (rc) {
-	    Py_DECREF(result);
-	    ldap_msgfree( m );
-	    ldap_memfree(dn);
-	    return LDAPerror( ld, "ldap_get_entry_controls" );
-	 }
-
-	 /* convert serverctrls to list of tuples */
-	 if ( ! ( pyctrls = LDAPControls_to_List( serverctrls ) ) ) {
-	    int err = LDAP_NO_MEMORY;
-	    ldap_set_option( ld, LDAP_OPT_ERROR_NUMBER, &err );
-	    Py_DECREF(result);
-	    ldap_msgfree( m );
-	    ldap_memfree(dn);
-	    ldap_controls_free(serverctrls);
-	    return LDAPerror( ld, "LDAPControls_to_List" );
-	 }
-	 ldap_controls_free(serverctrls);
-
-  	 /* Fill attrdict with lists */
+	 /* Fill attrdict with lists */
 	 for( attr = ldap_first_attribute( ld, entry, &ber );
 	 for( attr = ldap_first_attribute( ld, entry, &ber );
 	      attr != NULL;
 	      attr != NULL;
 	      attr = ldap_next_attribute( ld, entry, ber )
 	      attr = ldap_next_attribute( ld, entry, ber )
@@ -115,7 +85,6 @@ LDAPmessage_to_python(LDAP *ld, LDAPMessage *m, int add_ctrls, int add_intermedi
 		ldap_msgfree( m );
 		ldap_msgfree( m );
 		ldap_memfree(attr);
 		ldap_memfree(attr);
 		ldap_memfree(dn);
 		ldap_memfree(dn);
-		Py_XDECREF(pyctrls);
 		return NULL;
 		return NULL;
 	     }
 	     }
 
 
@@ -135,7 +104,6 @@ LDAPmessage_to_python(LDAP *ld, LDAPMessage *m, int add_ctrls, int add_intermedi
 			ldap_msgfree( m );
 			ldap_msgfree( m );
 			ldap_memfree(attr);
 			ldap_memfree(attr);
 			ldap_memfree(dn);
 			ldap_memfree(dn);
-			Py_XDECREF(pyctrls);
 			return NULL;
 			return NULL;
 		    }
 		    }
 		    Py_DECREF(valuestr);
 		    Py_DECREF(valuestr);
@@ -146,14 +114,9 @@ LDAPmessage_to_python(LDAP *ld, LDAPMessage *m, int add_ctrls, int add_intermedi
 	     ldap_memfree(attr);
 	     ldap_memfree(attr);
 	 }
 	 }
 
 
-	 if (add_ctrls) {
-	    entrytuple = Py_BuildValue("(sOO)", dn, attrdict, pyctrls);
-	 } else {
-	    entrytuple = Py_BuildValue("(sO)", dn, attrdict);
-	 }
+	 entrytuple = Py_BuildValue("(sO)", dn, attrdict);
 	 ldap_memfree(dn);
 	 ldap_memfree(dn);
 	 Py_DECREF(attrdict);
 	 Py_DECREF(attrdict);
-	 Py_XDECREF(pyctrls);
 	 PyList_Append(result, entrytuple);
 	 PyList_Append(result, entrytuple);
 	 Py_DECREF(entrytuple);
 	 Py_DECREF(entrytuple);
 	 if (ber != NULL)
 	 if (ber != NULL)
@@ -172,23 +135,11 @@ LDAPmessage_to_python(LDAP *ld, LDAPMessage *m, int add_ctrls, int add_intermedi
 	     ldap_msgfree( m );
 	     ldap_msgfree( m );
 	     return NULL;
 	     return NULL;
 	 }
 	 }
-	 if (ldap_parse_reference(ld, entry, &refs, &serverctrls, 0) != LDAP_SUCCESS) {
-             Py_DECREF(reflist);
+	 if (ldap_parse_reference(ld, entry, &refs, NULL, 0) != LDAP_SUCCESS) {
 	     Py_DECREF(result);
 	     Py_DECREF(result);
 	     ldap_msgfree( m );
 	     ldap_msgfree( m );
 	     return LDAPerror( ld, "ldap_parse_reference" );
 	     return LDAPerror( ld, "ldap_parse_reference" );
 	 }
 	 }
-	 /* convert serverctrls to list of tuples */
-	 if ( ! ( pyctrls = LDAPControls_to_List( serverctrls ) ) ) {
-	     int err = LDAP_NO_MEMORY;
-	     ldap_set_option( ld, LDAP_OPT_ERROR_NUMBER, &err );
-             Py_DECREF(reflist);
-	     Py_DECREF(result);
-	     ldap_msgfree( m );
-	     ldap_controls_free(serverctrls);
-	     return LDAPerror( ld, "LDAPControls_to_List" );
-	 }
-	 ldap_controls_free(serverctrls);
 	 if (refs) {
 	 if (refs) {
 	     Py_ssize_t i;
 	     Py_ssize_t i;
 	     for (i=0; refs[i] != NULL; i++) {
 	     for (i=0; refs[i] != NULL; i++) {
@@ -198,60 +149,11 @@ LDAPmessage_to_python(LDAP *ld, LDAPMessage *m, int add_ctrls, int add_intermedi
 	     }
 	     }
 	     ber_memvfree( (void **) refs );
 	     ber_memvfree( (void **) refs );
 	 }
 	 }
-	 if (add_ctrls) {
-	    entrytuple = Py_BuildValue("(sOO)", NULL, reflist, pyctrls);
-	 } else {
-	    entrytuple = Py_BuildValue("(sO)", NULL, reflist);
-	 }
+	 entrytuple = Py_BuildValue("(sO)", NULL, reflist);
 	 Py_DECREF(reflist);
 	 Py_DECREF(reflist);
-	 Py_XDECREF(pyctrls);
 	 PyList_Append(result, entrytuple);
 	 PyList_Append(result, entrytuple);
 	 Py_DECREF(entrytuple);
 	 Py_DECREF(entrytuple);
      }
      }
-     if (add_intermediates) {
-	for(entry = ldap_first_message(ld,m);
-	    entry != NULL;
-	    entry = ldap_next_message(ld,entry))
-	   {
-	      /* list of tuples */
-	      /* each tuple is OID, Berval, controllist */
-	      if ( LDAP_RES_INTERMEDIATE == ldap_msgtype( entry ) ) {
-		 PyObject* valtuple;
-		 PyObject *valuestr;
-		 char *retoid = 0;
-		 struct berval *retdata = 0;
-
-		 if (ldap_parse_intermediate( ld, entry, &retoid, &retdata, &serverctrls, 0 ) != LDAP_SUCCESS) {
-		    Py_DECREF(result);
-		    ldap_msgfree( m );
-		    return LDAPerror( ld, "ldap_parse_intermediate" );
-		 }
-		 /* convert serverctrls to list of tuples */
-		 if ( ! ( pyctrls = LDAPControls_to_List( serverctrls ) ) ) {
-		    int err = LDAP_NO_MEMORY;
-		    ldap_set_option( ld, LDAP_OPT_ERROR_NUMBER, &err );
-		    Py_DECREF(result);
-		    ldap_msgfree( m );
-		    ldap_controls_free(serverctrls);
-		    ldap_memfree( retoid );
-		    ber_bvfree( retdata );
-		    return LDAPerror( ld, "LDAPControls_to_List" );
-		 }
-		 ldap_controls_free(serverctrls);
-
-		 valuestr = LDAPberval_to_object(retdata);
-		 ber_bvfree( retdata );
-		 valtuple = Py_BuildValue("(sOO)", retoid,
-					  valuestr ? valuestr : Py_None,
-					  pyctrls);
-		 ldap_memfree( retoid );
-		 Py_DECREF(valuestr);
-		 Py_XDECREF(pyctrls);
-		 PyList_Append(result, valtuple);
-		 Py_DECREF(valtuple);
-	      }
-	   }
-     }
      ldap_msgfree( m );
      ldap_msgfree( m );
      return result;
      return result;
 }
 }

+ 2 - 2
desktop/core/ext-py/python-ldap-2.4.6/Modules/message.h → desktop/core/ext-py/python-ldap-2.3.13/Modules/message.h

@@ -1,5 +1,5 @@
 /* See http://www.python-ldap.org/ for details.
 /* See http://www.python-ldap.org/ for details.
- * $Id: message.h,v 1.6 2011/02/21 21:04:00 stroeder Exp $ */
+ * $Id: message.h,v 1.5 2009/04/17 12:19:09 stroeder Exp $ */
 
 
 #ifndef __h_message 
 #ifndef __h_message 
 #define __h_message 
 #define __h_message 
@@ -8,7 +8,7 @@
 #include "lber.h"
 #include "lber.h"
 #include "ldap.h"
 #include "ldap.h"
 
 
-extern PyObject* LDAPmessage_to_python( LDAP*ld, LDAPMessage*m, int add_ctrls, int add_intermediates );
+extern PyObject* LDAPmessage_to_python( LDAP*ld, LDAPMessage*m );
 
 
 #endif /* __h_message_ */
 #endif /* __h_message_ */
 
 

+ 1 - 4
desktop/core/ext-py/python-ldap-2.4.6/Modules/options.c → desktop/core/ext-py/python-ldap-2.3.13/Modules/options.c

@@ -1,5 +1,5 @@
 /* See http://www.python-ldap.org/ for details.
 /* See http://www.python-ldap.org/ for details.
- * $Id: options.c,v 1.39 2011/06/10 21:55:45 stroeder Exp $ */
+ * $Id: options.c,v 1.38 2010/10/01 18:23:18 stroeder Exp $ */
 
 
 #include "common.h"
 #include "common.h"
 #include "errors.h"
 #include "errors.h"
@@ -291,9 +291,6 @@ LDAP_get_option(LDAPObject *self, int option)
 #ifdef LDAP_OPT_X_TLS_CRLFILE
 #ifdef LDAP_OPT_X_TLS_CRLFILE
     case LDAP_OPT_X_TLS_CRLFILE:
     case LDAP_OPT_X_TLS_CRLFILE:
 #endif
 #endif
-#ifdef LDAP_OPT_X_TLS_PACKAGE
-    case LDAP_OPT_X_TLS_PACKAGE:
-#endif
 #endif
 #endif
 #ifdef HAVE_SASL
 #ifdef HAVE_SASL
     case LDAP_OPT_X_SASL_SECPROPS:
     case LDAP_OPT_X_SASL_SECPROPS:

+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Modules/options.h → desktop/core/ext-py/python-ldap-2.3.13/Modules/options.h


+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Modules/schema.c → desktop/core/ext-py/python-ldap-2.3.13/Modules/schema.c


+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Modules/schema.h → desktop/core/ext-py/python-ldap-2.3.13/Modules/schema.h


+ 0 - 0
desktop/core/ext-py/python-ldap-2.4.6/Modules/version.c → desktop/core/ext-py/python-ldap-2.3.13/Modules/version.c


Some files were not shown because too many files changed in this diff