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

Collapse All | Expand All

(-)a/univention-ldap/conffiles/etc/ldap/slapd.conf.d/40univention-ldap-server_database (-1 / +21 lines)
 Lines 78-84   for indexcombination in indexcombinations: Link Here 
78
					attribs.append(attr)
78
					attribs.append(attr)
79
					found_attribs.append(attr)
79
					found_attribs.append(attr)
80
	if not attribs==[] and not indexes==[]:
80
	if not attribs==[] and not indexes==[]:
81
		print 'index\t%s %s'%(','.join(attribs),','.join(indexes))
81
		config_line = 'index\t%s %s' % (','.join(attribs),','.join(indexes))
82
		max_length = 2000
83
		if len(config_line) > max_length:
84
			head = 'index\t '
85
			tail = ' %s'%(','.join(indexes))
86
			attributes=""
87
			for attr in attribs:
88
				if not attributes:
89
					# regardless of max length we print at least one attribute per index line
90
					attributes += '%s' % (attr)
91
				else:
92
					if len('%s%s,%s%s' % (head, attributes, attr, tail)) > max_length:
93
						print '%s%s%s' %(head, attributes, tail)
94
						attributes='%s' % (attr)
95
					else:
96
						attributes += ',%s' % (attr)
97
			if attributes:
98
				print '%s%s%s' %(head, attributes, tail)
99
				attributes=''
100
		else:
101
			print config_line
82
102
83
print
103
print
84
for key in configRegistry.get("ldap/limits", "").split(";"):
104
for key in configRegistry.get("ldap/limits", "").split(";"):

Return to bug 41648