View | Details | Raw Unified | Return to bug 28248 | Differences between
and this patch

Collapse All | Expand All

(-)/usr/share/pyshared/univention/management/console/modules/udm/__init__.py.orig (+6 lines)
 Lines 54-59    Link Here 
54
54
55
import univention.directory.reports as udr
55
import univention.directory.reports as udr
56
56
57
from univention.management.console.protocol.definitions import *
58
57
from .udm_ldap import UDM_Error, UDM_Module, UDM_Settings, check_license, ldap_dn2path, get_module, read_syntax_choices, list_objects, LDAP_Connection, LDAP_ConnectionError, set_credentials, container_modules
59
from .udm_ldap import UDM_Error, UDM_Module, UDM_Settings, check_license, ldap_dn2path, get_module, read_syntax_choices, list_objects, LDAP_Connection, LDAP_ConnectionError, set_credentials, container_modules
58
from .tools import LicenseError, LicenseImport
60
from .tools import LicenseError, LicenseImport
59
_ = Translation( 'univention-management-console-module-udm' ).translate
61
_ = Translation( 'univention-management-console-module-udm' ).translate
 Lines 103-108    Link Here 
103
		if not isinstance( result, BaseException ):
105
		if not isinstance( result, BaseException ):
104
			return False
106
			return False
105
107
108
		if isinstance( result, (udm_errors.ldapSizelimitExceeded, udm_errors.ldapTimeout ) ):
109
			self.finished( request.id, None, result.args[0], success = False, status = MODULE_ERR_COMMAND_FAILED )
110
			return True
111
106
		msg = '%s\n%s: %s\n' % ( ''.join( traceback.format_tb( thread.exc_info[ 2 ] ) ), thread.exc_info[ 0 ].__name__, str( thread.exc_info[ 1 ] ) )
112
		msg = '%s\n%s: %s\n' % ( ''.join( traceback.format_tb( thread.exc_info[ 2 ] ) ), thread.exc_info[ 0 ].__name__, str( thread.exc_info[ 1 ] ) )
107
		MODULE.process( 'An internal error occurred: %s' % msg )
113
		MODULE.process( 'An internal error occurred: %s' % msg )
108
		self.finished( request.id, None, msg, False )
114
		self.finished( request.id, None, msg, False )
(-)/usr/share/pyshared/univention/management/console/modules/udm/udm_ldap.py.orig (-1 / +18 lines)
 Lines 33-38    Link Here 
33
33
34
import operator
34
import operator
35
import threading
35
import threading
36
import gc
36
37
37
from univention.management.console import Translation
38
from univention.management.console import Translation
38
from univention.management.console.modules import Base, UMC_OptionTypeError, UMC_OptionMissing, UMC_CommandError
39
from univention.management.console.modules import Base, UMC_OptionTypeError, UMC_OptionMissing, UMC_CommandError
 Lines 131-136    Link Here 
131
			_ldap_connection = lo
132
			_ldap_connection = lo
132
			_ldap_position = po
133
			_ldap_position = po
133
			return ret
134
			return ret
135
		except (udm_errors.ldapSizelimitExceeded, udm_errors.ldapTimeout), e:
136
			raise e
134
		except ( LDAPError, udm_errors.base ), e:
137
		except ( LDAPError, udm_errors.base ), e:
135
			MODULE.info( 'LDAP operation for user %s has failed' % _user_dn )
138
			MODULE.info( 'LDAP operation for user %s has failed' % _user_dn )
136
			try:
139
			try:
 Lines 149-154    Link Here 
149
				_ldap_connection = lo
152
				_ldap_connection = lo
150
				_ldap_position = po
153
				_ldap_position = po
151
				return ret
154
				return ret
155
			except (udm_errors.ldapSizelimitExceeded, udm_errors.ldapTimeout), e:
156
				raise e
152
			except udm_errors.base, e:
157
			except udm_errors.base, e:
153
				raise LDAP_ConnectionError( str( e ) )
158
				raise LDAP_ConnectionError( str( e ) )
154
159
 Lines 390-403    Link Here 
390
			filter_s = '%s=%s' % ( attribute, value )
395
			filter_s = '%s=%s' % ( attribute, value )
391
396
392
		MODULE.info( 'Searching for LDAP objects: container = %s, filter = %s, superordinate = %s' % ( container, filter_s, superordinate ) )
397
		MODULE.info( 'Searching for LDAP objects: container = %s, filter = %s, superordinate = %s' % ( container, filter_s, superordinate ) )
398
		result = None
393
		try:
399
		try:
394
			return self.module.lookup( None, ldap_connection, filter_s, base = container, superordinate = superordinate, scope = scope )
400
			result = self.module.lookup( None, ldap_connection, filter_s, base = container, superordinate = superordinate, scope = scope, sizelimit = int(ucr.get('directory/manager/web/sizelimit', '2000')) )
395
		except udm_errors.insufficientInformation, e:
401
		except udm_errors.insufficientInformation, e:
396
			return []
402
			return []
403
		except udm_errors.ldapTimeout, e:
404
			raise udm_errors.ldapTimeout( _('The query you have entered timed out. Please narrow down your search by specifiying more query parameters') )
405
		except udm_errors.ldapSizelimitExceeded, e:
406
			raise udm_errors.ldapSizelimitExceeded( _('The query you have entered yields too many matching entries. Please narrow down your search by specifiying more query parameters. The current size limit of %s can be configured with the UCR variable directory/manager/web/sizelimit.') % ucr.get('directory/manager/web/sizelimit', '2000') )
397
		except ( LDAPError, udm_errors.ldapError ), e:
407
		except ( LDAPError, udm_errors.ldapError ), e:
398
			raise e
408
			raise e
399
		except udm_errors.base, e:
409
		except udm_errors.base, e:
400
			raise UDM_Error( str( e ) )
410
			raise UDM_Error( str( e ) )
411
		
412
		# call the garbage collector manually as many parallel request may cause the
413
		# process to use too much memory
414
		MODULE.info('Triggering garbage collection')
415
		gc.collect()
416
417
		return result
401
418
402
	@LDAP_Connection
419
	@LDAP_Connection
403
	def get( self, ldap_dn = None, superordinate = None, attributes = [], ldap_connection = None, ldap_position = None ):
420
	def get( self, ldap_dn = None, superordinate = None, attributes = [], ldap_connection = None, ldap_position = None ):
(-)/usr/share/pyshared/univention/admin/uexceptions.py.orig (+6 lines)
 Lines 52-57    Link Here 
52
class ldapError(base):
52
class ldapError(base):
53
	message=_('LDAP Error')
53
	message=_('LDAP Error')
54
54
55
class ldapTimeout(base):
56
	message=_('The specified timeout for the LDAP search has been exceeded.')
57
58
class ldapSizelimitExceeded(base):
59
	message=_('The specified size limit for the LDAP search has been exceeded.')
60
55
class insufficientInformation(base):
61
class insufficientInformation(base):
56
	message=_('Information provided is not sufficient.')
62
	message=_('Information provided is not sufficient.')
57
63
(-)/usr/share/pyshared/univention/admin/uldap.py.orig (+4 lines)
 Lines 321-326    Link Here 
321
			raise univention.admin.uexceptions.noObject, _err2str(msg)
321
			raise univention.admin.uexceptions.noObject, _err2str(msg)
322
		except ldap.INAPPROPRIATE_MATCHING, msg:
322
		except ldap.INAPPROPRIATE_MATCHING, msg:
323
			raise univention.admin.uexceptions.insufficientInformation, _err2str(msg)
323
			raise univention.admin.uexceptions.insufficientInformation, _err2str(msg)
324
		except (ldap.TIMEOUT, ldap.TIMELIMIT_EXCEEDED), msg:
325
			raise univention.admin.uexceptions.ldapTimeout, _err2str(msg)
326
		except ldap.SIZELIMIT_EXCEEDED, msg:
327
			raise univention.admin.uexceptions.ldapSizelimitExceeded, _err2str(msg)
324
		except ldap.LDAPError, msg:
328
		except ldap.LDAPError, msg:
325
			raise univention.admin.uexceptions.ldapError, _err2str(msg)
329
			raise univention.admin.uexceptions.ldapError, _err2str(msg)
326
330

Return to bug 28248