mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2026-10-13 08:52:01 -05:00
Fix the client-side search size limit.
I've changed the variable name searchlimit to sizelimit to match the name in python-ldap (and hopefully therefore be more readable). The big change was changing the default value from 0 to -1. As 0 we were never using the value from cn=ipaconfig python-ldap expects this to be an int type In the UI sizelimit was hardcoded at 0 for users 439880
This commit is contained in:
1 parent
1e3276cec1
commit
306d8241b3
4 files changed
+45
-45
No files matched your search
+10
-10
@@ -136,11 +136,11 @@ class IPAClient:
|
|||||||
result = self.transport.set_custom_fields(schema)
|
result = self.transport.set_custom_fields(schema)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def find_users(self, criteria, sattrs=None, searchlimit=0, timelimit=-1):
|
def find_users(self, criteria, sattrs=None, sizelimit=-1, timelimit=-1):
|
||||||
"""Return a list: counter followed by a User object for each user that
|
"""Return a list: counter followed by a User object for each user that
|
||||||
matches the criteria. If the results are truncated, counter will
|
matches the criteria. If the results are truncated, counter will
|
||||||
be set to -1"""
|
be set to -1"""
|
||||||
result = self.transport.find_users(criteria, sattrs, searchlimit, timelimit)
|
result = self.transport.find_users(criteria, sattrs, sizelimit, timelimit)
|
||||||
counter = result[0]
|
counter = result[0]
|
||||||
|
|
||||||
users = [counter]
|
users = [counter]
|
||||||
@@ -204,10 +204,10 @@ class IPAClient:
|
|||||||
result = self.transport.add_group(group_dict, group_container)
|
result = self.transport.add_group(group_dict, group_container)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def find_groups(self, criteria, sattrs=None, searchlimit=0, timelimit=-1):
|
def find_groups(self, criteria, sattrs=None, sizelimit=-1, timelimit=-1):
|
||||||
"""Find groups whose cn matches the criteria. Wildcards are
|
"""Find groups whose cn matches the criteria. Wildcards are
|
||||||
acceptable. Returns a list of Group objects."""
|
acceptable. Returns a list of Group objects."""
|
||||||
result = self.transport.find_groups(criteria, sattrs, searchlimit, timelimit)
|
result = self.transport.find_groups(criteria, sattrs, sizelimit, timelimit)
|
||||||
counter = result[0]
|
counter = result[0]
|
||||||
|
|
||||||
groups = [counter]
|
groups = [counter]
|
||||||
@@ -387,11 +387,11 @@ class IPAClient:
|
|||||||
def delete_service_principal(self, principal_dn):
|
def delete_service_principal(self, principal_dn):
|
||||||
return self.transport.delete_service_principal(principal_dn)
|
return self.transport.delete_service_principal(principal_dn)
|
||||||
|
|
||||||
def find_service_principal(self, criteria, sattrs=None, searchlimit=0, timelimit=-1):
|
def find_service_principal(self, criteria, sattrs=None, sizelimit=-1, timelimit=-1):
|
||||||
"""Return a list: counter followed by a Entity object for each host that
|
"""Return a list: counter followed by a Entity object for each host that
|
||||||
matches the criteria. If the results are truncated, counter will
|
matches the criteria. If the results are truncated, counter will
|
||||||
be set to -1"""
|
be set to -1"""
|
||||||
result = self.transport.find_service_principal(criteria, sattrs, searchlimit, timelimit)
|
result = self.transport.find_service_principal(criteria, sattrs, sizelimit, timelimit)
|
||||||
counter = result[0]
|
counter = result[0]
|
||||||
|
|
||||||
hosts = [counter]
|
hosts = [counter]
|
||||||
@@ -426,8 +426,8 @@ class IPAClient:
|
|||||||
def delete_radius_client(self, ip_addr, container=None):
|
def delete_radius_client(self, ip_addr, container=None):
|
||||||
return self.transport.delete_radius_client(ip_addr, container)
|
return self.transport.delete_radius_client(ip_addr, container)
|
||||||
|
|
||||||
def find_radius_clients(self, criteria, container=None, sattrs=None, searchlimit=0, timelimit=-1):
|
def find_radius_clients(self, criteria, container=None, sattrs=None, sizelimit=-1, timelimit=-1):
|
||||||
result = self.transport.find_radius_clients(criteria, container, sattrs, searchlimit, timelimit)
|
result = self.transport.find_radius_clients(criteria, container, sattrs, sizelimit, timelimit)
|
||||||
counter = result[0]
|
counter = result[0]
|
||||||
|
|
||||||
users = [counter]
|
users = [counter]
|
||||||
@@ -458,8 +458,8 @@ class IPAClient:
|
|||||||
def delete_radius_profile(self, ip_addr, user_profile=None):
|
def delete_radius_profile(self, ip_addr, user_profile=None):
|
||||||
return self.transport.delete_radius_profile(ip_addr, user_profile)
|
return self.transport.delete_radius_profile(ip_addr, user_profile)
|
||||||
|
|
||||||
def find_radius_profiles(self, criteria, user_profile=None, sattrs=None, searchlimit=0, timelimit=-1):
|
def find_radius_profiles(self, criteria, user_profile=None, sattrs=None, sizelimit=-1, timelimit=-1):
|
||||||
result = self.transport.find_radius_profiles(criteria, user_profile, sattrs, searchlimit, timelimit)
|
result = self.transport.find_radius_profiles(criteria, user_profile, sattrs, sizelimit, timelimit)
|
||||||
counter = result[0]
|
counter = result[0]
|
||||||
|
|
||||||
users = [counter]
|
users = [counter]
|
||||||
|
|||||||
+10
-10
@@ -257,7 +257,7 @@ class RPCClient:
|
|||||||
|
|
||||||
return ipautil.unwrap_binary_data(result)
|
return ipautil.unwrap_binary_data(result)
|
||||||
|
|
||||||
def find_users (self, criteria, sattrs=None, searchlimit=0, timelimit=-1):
|
def find_users (self, criteria, sattrs=None, sizelimit=-1, timelimit=-1):
|
||||||
"""Return a list: counter followed by a dict for each user that
|
"""Return a list: counter followed by a dict for each user that
|
||||||
matches the criteria. If the results are truncated, counter will
|
matches the criteria. If the results are truncated, counter will
|
||||||
be set to -1"""
|
be set to -1"""
|
||||||
@@ -267,7 +267,7 @@ class RPCClient:
|
|||||||
# None values are not allowed in XML-RPC
|
# None values are not allowed in XML-RPC
|
||||||
if sattrs is None:
|
if sattrs is None:
|
||||||
sattrs = "__NONE__"
|
sattrs = "__NONE__"
|
||||||
result = server.find_users(criteria, sattrs, searchlimit, timelimit)
|
result = server.find_users(criteria, sattrs, sizelimit, timelimit)
|
||||||
except xmlrpclib.Fault, fault:
|
except xmlrpclib.Fault, fault:
|
||||||
raise ipaerror.gen_exception(fault.faultCode, fault.faultString)
|
raise ipaerror.gen_exception(fault.faultCode, fault.faultString)
|
||||||
except socket.error, (value, msg):
|
except socket.error, (value, msg):
|
||||||
@@ -383,7 +383,7 @@ class RPCClient:
|
|||||||
|
|
||||||
return ipautil.unwrap_binary_data(result)
|
return ipautil.unwrap_binary_data(result)
|
||||||
|
|
||||||
def find_groups (self, criteria, sattrs=None, searchlimit=0, timelimit=-1):
|
def find_groups (self, criteria, sattrs=None, sizelimit=-1, timelimit=-1):
|
||||||
"""Return a list containing a Group object for each group that matches
|
"""Return a list containing a Group object for each group that matches
|
||||||
the criteria."""
|
the criteria."""
|
||||||
|
|
||||||
@@ -392,7 +392,7 @@ class RPCClient:
|
|||||||
# None values are not allowed in XML-RPC
|
# None values are not allowed in XML-RPC
|
||||||
if sattrs is None:
|
if sattrs is None:
|
||||||
sattrs = "__NONE__"
|
sattrs = "__NONE__"
|
||||||
result = server.find_groups(criteria, sattrs, searchlimit, timelimit)
|
result = server.find_groups(criteria, sattrs, sizelimit, timelimit)
|
||||||
except xmlrpclib.Fault, fault:
|
except xmlrpclib.Fault, fault:
|
||||||
raise ipaerror.gen_exception(fault.faultCode, fault.faultString)
|
raise ipaerror.gen_exception(fault.faultCode, fault.faultString)
|
||||||
except socket.error, (value, msg):
|
except socket.error, (value, msg):
|
||||||
@@ -732,7 +732,7 @@ class RPCClient:
|
|||||||
|
|
||||||
return ipautil.unwrap_binary_data(result)
|
return ipautil.unwrap_binary_data(result)
|
||||||
|
|
||||||
def find_service_principal (self, criteria, sattrs=None, searchlimit=0, timelimit=-1):
|
def find_service_principal (self, criteria, sattrs=None, sizelimit=-1, timelimit=-1):
|
||||||
"""Return a list: counter followed by a Entity object for each host that
|
"""Return a list: counter followed by a Entity object for each host that
|
||||||
matches the criteria. If the results are truncated, counter will
|
matches the criteria. If the results are truncated, counter will
|
||||||
be set to -1"""
|
be set to -1"""
|
||||||
@@ -742,7 +742,7 @@ class RPCClient:
|
|||||||
# None values are not allowed in XML-RPC
|
# None values are not allowed in XML-RPC
|
||||||
if sattrs is None:
|
if sattrs is None:
|
||||||
sattrs = "__NONE__"
|
sattrs = "__NONE__"
|
||||||
result = server.find_service_principal(criteria, sattrs, searchlimit, timelimit)
|
result = server.find_service_principal(criteria, sattrs, sizelimit, timelimit)
|
||||||
except xmlrpclib.Fault, fault:
|
except xmlrpclib.Fault, fault:
|
||||||
raise ipaerror.gen_exception(fault.faultCode, fault.faultString)
|
raise ipaerror.gen_exception(fault.faultCode, fault.faultString)
|
||||||
except socket.error, (value, msg):
|
except socket.error, (value, msg):
|
||||||
@@ -818,14 +818,14 @@ class RPCClient:
|
|||||||
|
|
||||||
return ipautil.unwrap_binary_data(result)
|
return ipautil.unwrap_binary_data(result)
|
||||||
|
|
||||||
def find_radius_clients(self, criteria, container=None, sattrs=None, searchlimit=0, timelimit=-1):
|
def find_radius_clients(self, criteria, container=None, sattrs=None, sizelimit=-1, timelimit=-1):
|
||||||
server = self.setup_server()
|
server = self.setup_server()
|
||||||
if container is None: container = "__NONE__"
|
if container is None: container = "__NONE__"
|
||||||
try:
|
try:
|
||||||
# None values are not allowed in XML-RPC
|
# None values are not allowed in XML-RPC
|
||||||
if sattrs is None:
|
if sattrs is None:
|
||||||
sattrs = "__NONE__"
|
sattrs = "__NONE__"
|
||||||
result = server.find_radius_clients(criteria, container, sattrs, searchlimit, timelimit)
|
result = server.find_radius_clients(criteria, container, sattrs, sizelimit, timelimit)
|
||||||
except xmlrpclib.Fault, fault:
|
except xmlrpclib.Fault, fault:
|
||||||
raise ipaerror.gen_exception(fault.faultCode, fault.faultString)
|
raise ipaerror.gen_exception(fault.faultCode, fault.faultString)
|
||||||
except socket.error, (value, msg):
|
except socket.error, (value, msg):
|
||||||
@@ -887,14 +887,14 @@ class RPCClient:
|
|||||||
|
|
||||||
return ipautil.unwrap_binary_data(result)
|
return ipautil.unwrap_binary_data(result)
|
||||||
|
|
||||||
def find_radius_profiles(self, criteria, user_profile=None, sattrs=None, searchlimit=0, timelimit=-1):
|
def find_radius_profiles(self, criteria, user_profile=None, sattrs=None, sizelimit=-1, timelimit=-1):
|
||||||
server = self.setup_server()
|
server = self.setup_server()
|
||||||
if user_profile is None: user_profile = "__NONE__"
|
if user_profile is None: user_profile = "__NONE__"
|
||||||
try:
|
try:
|
||||||
# None values are not allowed in XML-RPC
|
# None values are not allowed in XML-RPC
|
||||||
if sattrs is None:
|
if sattrs is None:
|
||||||
sattrs = "__NONE__"
|
sattrs = "__NONE__"
|
||||||
result = server.find_radius_profiles(criteria, user_profile, sattrs, searchlimit, timelimit)
|
result = server.find_radius_profiles(criteria, user_profile, sattrs, sizelimit, timelimit)
|
||||||
except xmlrpclib.Fault, fault:
|
except xmlrpclib.Fault, fault:
|
||||||
raise ipaerror.gen_exception(fault.faultCode, fault.faultString)
|
raise ipaerror.gen_exception(fault.faultCode, fault.faultString)
|
||||||
except socket.error, (value, msg):
|
except socket.error, (value, msg):
|
||||||
|
|||||||
@@ -650,7 +650,7 @@ class UserController(IPAController):
|
|||||||
uid = kw.get('uid')
|
uid = kw.get('uid')
|
||||||
if uid != None and len(uid) > 0:
|
if uid != None and len(uid) > 0:
|
||||||
try:
|
try:
|
||||||
users = client.find_users(uid.encode('utf-8'), user_fields, 0, 2)
|
users = client.find_users(uid.encode('utf-8'), user_fields)
|
||||||
counter = users[0]
|
counter = users[0]
|
||||||
users = users[1:]
|
users = users[1:]
|
||||||
if counter == -1:
|
if counter == -1:
|
||||||
|
|||||||
@@ -700,7 +700,7 @@ class IPAServer:
|
|||||||
self.releaseConnection(conn)
|
self.releaseConnection(conn)
|
||||||
return res
|
return res
|
||||||
|
|
||||||
def find_radius_clients(self, ip_attrs, container=None, sattrs=None, searchlimit=0, timelimit=-1, opts=None):
|
def find_radius_clients(self, ip_attrs, container=None, sattrs=None, sizelimit=-1, timelimit=-1, opts=None):
|
||||||
def gen_filter(objectclass, attr, values):
|
def gen_filter(objectclass, attr, values):
|
||||||
'''Given ('myclass', 'myattr', [v1, v2]) returns
|
'''Given ('myclass', 'myattr', [v1, v2]) returns
|
||||||
(&(objectclass=myclass)(|(myattr=v1)(myattr=v2)))
|
(&(objectclass=myclass)(|(myattr=v1)(myattr=v2)))
|
||||||
@@ -716,7 +716,7 @@ class IPAServer:
|
|||||||
conn = self.getConnection(opts)
|
conn = self.getConnection(opts)
|
||||||
try:
|
try:
|
||||||
try:
|
try:
|
||||||
results = conn.getListAsync(basedn, self.scope, filter, sattrs, 0, None, None, timelimit, searchlimit)
|
results = conn.getListAsync(basedn, self.scope, filter, sattrs, 0, None, None, timelimit, sizelimit)
|
||||||
except ipaerror.exception_for(ipaerror.LDAP_NOT_FOUND):
|
except ipaerror.exception_for(ipaerror.LDAP_NOT_FOUND):
|
||||||
results = [0]
|
results = [0]
|
||||||
finally:
|
finally:
|
||||||
@@ -801,7 +801,7 @@ class IPAServer:
|
|||||||
self.releaseConnection(conn)
|
self.releaseConnection(conn)
|
||||||
return res
|
return res
|
||||||
|
|
||||||
def find_radius_profiles(self, uids, user_profile=True, sattrs=None, searchlimit=0, timelimit=-1, opts=None):
|
def find_radius_profiles(self, uids, user_profile=True, sattrs=None, sizelimit=-1, timelimit=-1, opts=None):
|
||||||
def gen_filter(objectclass, attr, values):
|
def gen_filter(objectclass, attr, values):
|
||||||
'''Given ('myclass', 'myattr', [v1, v2]) returns
|
'''Given ('myclass', 'myattr', [v1, v2]) returns
|
||||||
(&(objectclass=myclass)(|(myattr=v1)(myattr=v2)))
|
(&(objectclass=myclass)(|(myattr=v1)(myattr=v2)))
|
||||||
@@ -822,7 +822,7 @@ class IPAServer:
|
|||||||
conn = self.getConnection(opts)
|
conn = self.getConnection(opts)
|
||||||
try:
|
try:
|
||||||
try:
|
try:
|
||||||
results = conn.getListAsync(basedn, self.scope, filter, sattrs, 0, None, None, timelimit, searchlimit)
|
results = conn.getListAsync(basedn, self.scope, filter, sattrs, 0, None, None, timelimit, sizelimit)
|
||||||
except ipaerror.exception_for(ipaerror.LDAP_NOT_FOUND):
|
except ipaerror.exception_for(ipaerror.LDAP_NOT_FOUND):
|
||||||
results = [0]
|
results = [0]
|
||||||
finally:
|
finally:
|
||||||
@@ -888,7 +888,7 @@ class IPAServer:
|
|||||||
|
|
||||||
return users
|
return users
|
||||||
|
|
||||||
def find_users (self, criteria, sattrs, searchlimit=-1, timelimit=-1,
|
def find_users (self, criteria, sattrs, sizelimit=-1, timelimit=-1,
|
||||||
opts=None):
|
opts=None):
|
||||||
"""Returns a list: counter followed by the results.
|
"""Returns a list: counter followed by the results.
|
||||||
If the results are truncated, counter will be set to -1."""
|
If the results are truncated, counter will be set to -1."""
|
||||||
@@ -897,7 +897,7 @@ class IPAServer:
|
|||||||
raise ipaerror.gen_exception(ipaerror.INPUT_INVALID_PARAMETER)
|
raise ipaerror.gen_exception(ipaerror.INPUT_INVALID_PARAMETER)
|
||||||
if sattrs is not None and not isinstance(sattrs, list):
|
if sattrs is not None and not isinstance(sattrs, list):
|
||||||
raise ipaerror.gen_exception(ipaerror.INPUT_INVALID_PARAMETER)
|
raise ipaerror.gen_exception(ipaerror.INPUT_INVALID_PARAMETER)
|
||||||
if not isinstance(searchlimit,int):
|
if not isinstance(sizelimit,int):
|
||||||
raise ipaerror.gen_exception(ipaerror.INPUT_INVALID_PARAMETER)
|
raise ipaerror.gen_exception(ipaerror.INPUT_INVALID_PARAMETER)
|
||||||
if not isinstance(timelimit,int):
|
if not isinstance(timelimit,int):
|
||||||
raise ipaerror.gen_exception(ipaerror.INPUT_INVALID_PARAMETER)
|
raise ipaerror.gen_exception(ipaerror.INPUT_INVALID_PARAMETER)
|
||||||
@@ -906,8 +906,8 @@ class IPAServer:
|
|||||||
config = self.get_ipa_config(opts)
|
config = self.get_ipa_config(opts)
|
||||||
if timelimit < 0:
|
if timelimit < 0:
|
||||||
timelimit = float(config.get('ipasearchtimelimit'))
|
timelimit = float(config.get('ipasearchtimelimit'))
|
||||||
if searchlimit < 0:
|
if sizelimit < 0:
|
||||||
searchlimit = float(config.get('ipasearchrecordslimit'))
|
sizelimit = int(config.get('ipasearchrecordslimit'))
|
||||||
|
|
||||||
# Assume the list of fields to search will come from a central
|
# Assume the list of fields to search will come from a central
|
||||||
# configuration repository. A good format for that would be
|
# configuration repository. A good format for that would be
|
||||||
@@ -937,14 +937,14 @@ class IPAServer:
|
|||||||
try:
|
try:
|
||||||
exact_results = conn.getListAsync(self.basedn, self.scope,
|
exact_results = conn.getListAsync(self.basedn, self.scope,
|
||||||
exact_match_filter, sattrs, 0, None, None, timelimit,
|
exact_match_filter, sattrs, 0, None, None, timelimit,
|
||||||
searchlimit)
|
sizelimit)
|
||||||
except ipaerror.exception_for(ipaerror.LDAP_NOT_FOUND):
|
except ipaerror.exception_for(ipaerror.LDAP_NOT_FOUND):
|
||||||
exact_results = [0]
|
exact_results = [0]
|
||||||
|
|
||||||
try:
|
try:
|
||||||
partial_results = conn.getListAsync(self.basedn, self.scope,
|
partial_results = conn.getListAsync(self.basedn, self.scope,
|
||||||
partial_match_filter, sattrs, 0, None, None, timelimit,
|
partial_match_filter, sattrs, 0, None, None, timelimit,
|
||||||
searchlimit)
|
sizelimit)
|
||||||
except ipaerror.exception_for(ipaerror.LDAP_NOT_FOUND):
|
except ipaerror.exception_for(ipaerror.LDAP_NOT_FOUND):
|
||||||
partial_results = [0]
|
partial_results = [0]
|
||||||
finally:
|
finally:
|
||||||
@@ -1270,7 +1270,7 @@ class IPAServer:
|
|||||||
finally:
|
finally:
|
||||||
self.releaseConnection(conn)
|
self.releaseConnection(conn)
|
||||||
|
|
||||||
def find_groups (self, criteria, sattrs, searchlimit=-1, timelimit=-1,
|
def find_groups (self, criteria, sattrs, sizelimit=-1, timelimit=-1,
|
||||||
opts=None):
|
opts=None):
|
||||||
"""Return a list containing a User object for each
|
"""Return a list containing a User object for each
|
||||||
existing group that matches the criteria.
|
existing group that matches the criteria.
|
||||||
@@ -1279,7 +1279,7 @@ class IPAServer:
|
|||||||
raise ipaerror.gen_exception(ipaerror.INPUT_INVALID_PARAMETER)
|
raise ipaerror.gen_exception(ipaerror.INPUT_INVALID_PARAMETER)
|
||||||
if sattrs is not None and not isinstance(sattrs, list):
|
if sattrs is not None and not isinstance(sattrs, list):
|
||||||
raise ipaerror.gen_exception(ipaerror.INPUT_INVALID_PARAMETER)
|
raise ipaerror.gen_exception(ipaerror.INPUT_INVALID_PARAMETER)
|
||||||
if not isinstance(searchlimit,int):
|
if not isinstance(sizelimit,int):
|
||||||
raise ipaerror.gen_exception(ipaerror.INPUT_INVALID_PARAMETER)
|
raise ipaerror.gen_exception(ipaerror.INPUT_INVALID_PARAMETER)
|
||||||
if not isinstance(timelimit,int):
|
if not isinstance(timelimit,int):
|
||||||
raise ipaerror.gen_exception(ipaerror.INPUT_INVALID_PARAMETER)
|
raise ipaerror.gen_exception(ipaerror.INPUT_INVALID_PARAMETER)
|
||||||
@@ -1289,8 +1289,8 @@ class IPAServer:
|
|||||||
config = self.get_ipa_config(opts)
|
config = self.get_ipa_config(opts)
|
||||||
if timelimit < 0:
|
if timelimit < 0:
|
||||||
timelimit = float(config.get('ipasearchtimelimit'))
|
timelimit = float(config.get('ipasearchtimelimit'))
|
||||||
if searchlimit < 0:
|
if sizelimit < 0:
|
||||||
searchlimit = float(config.get('ipasearchrecordslimit'))
|
sizelimit = int(config.get('ipasearchrecordslimit'))
|
||||||
|
|
||||||
# Assume the list of fields to search will come from a central
|
# Assume the list of fields to search will come from a central
|
||||||
# configuration repository. A good format for that would be
|
# configuration repository. A good format for that would be
|
||||||
@@ -1323,14 +1323,14 @@ class IPAServer:
|
|||||||
try:
|
try:
|
||||||
exact_results = conn.getListAsync(self.basedn, self.scope,
|
exact_results = conn.getListAsync(self.basedn, self.scope,
|
||||||
exact_match_filter, sattrs, 0, None, None, timelimit,
|
exact_match_filter, sattrs, 0, None, None, timelimit,
|
||||||
searchlimit)
|
sizelimit)
|
||||||
except ipaerror.exception_for(ipaerror.LDAP_NOT_FOUND):
|
except ipaerror.exception_for(ipaerror.LDAP_NOT_FOUND):
|
||||||
exact_results = [0]
|
exact_results = [0]
|
||||||
|
|
||||||
try:
|
try:
|
||||||
partial_results = conn.getListAsync(self.basedn, self.scope,
|
partial_results = conn.getListAsync(self.basedn, self.scope,
|
||||||
partial_match_filter, sattrs, 0, None, None, timelimit,
|
partial_match_filter, sattrs, 0, None, None, timelimit,
|
||||||
searchlimit)
|
sizelimit)
|
||||||
except ipaerror.exception_for(ipaerror.LDAP_NOT_FOUND):
|
except ipaerror.exception_for(ipaerror.LDAP_NOT_FOUND):
|
||||||
partial_results = [0]
|
partial_results = [0]
|
||||||
finally:
|
finally:
|
||||||
@@ -1822,7 +1822,7 @@ class IPAServer:
|
|||||||
|
|
||||||
logging.debug("IPA: group_members: %s %s %s" % (groupdn, attr_list, membertype))
|
logging.debug("IPA: group_members: %s %s %s" % (groupdn, attr_list, membertype))
|
||||||
|
|
||||||
searchlimit = float(config.get('ipasearchrecordslimit'))
|
sizelimit = int(config.get('ipasearchrecordslimit'))
|
||||||
|
|
||||||
groupdn = self.__safe_filter(groupdn)
|
groupdn = self.__safe_filter(groupdn)
|
||||||
searchfilter = "(memberOf=%s)" % groupdn
|
searchfilter = "(memberOf=%s)" % groupdn
|
||||||
@@ -1836,7 +1836,7 @@ class IPAServer:
|
|||||||
try:
|
try:
|
||||||
results = conn.getListAsync(self.basedn, self.scope,
|
results = conn.getListAsync(self.basedn, self.scope,
|
||||||
searchfilter, attr_list, 0, None, None, timelimit,
|
searchfilter, attr_list, 0, None, None, timelimit,
|
||||||
searchlimit)
|
sizelimit)
|
||||||
except ipaerror.exception_for(ipaerror.LDAP_NOT_FOUND):
|
except ipaerror.exception_for(ipaerror.LDAP_NOT_FOUND):
|
||||||
results = [0]
|
results = [0]
|
||||||
finally:
|
finally:
|
||||||
@@ -1982,7 +1982,7 @@ class IPAServer:
|
|||||||
self.releaseConnection(conn)
|
self.releaseConnection(conn)
|
||||||
return res
|
return res
|
||||||
|
|
||||||
def find_service_principal(self, criteria, sattrs, searchlimit=-1,
|
def find_service_principal(self, criteria, sattrs, sizelimit=-1,
|
||||||
timelimit=-1, opts=None):
|
timelimit=-1, opts=None):
|
||||||
"""Returns a list: counter followed by the results.
|
"""Returns a list: counter followed by the results.
|
||||||
If the results are truncated, counter will be set to -1."""
|
If the results are truncated, counter will be set to -1."""
|
||||||
@@ -1990,7 +1990,7 @@ class IPAServer:
|
|||||||
raise ipaerror.gen_exception(ipaerror.INPUT_INVALID_PARAMETER)
|
raise ipaerror.gen_exception(ipaerror.INPUT_INVALID_PARAMETER)
|
||||||
if sattrs is not None and not isinstance(sattrs, list):
|
if sattrs is not None and not isinstance(sattrs, list):
|
||||||
raise ipaerror.gen_exception(ipaerror.INPUT_INVALID_PARAMETER)
|
raise ipaerror.gen_exception(ipaerror.INPUT_INVALID_PARAMETER)
|
||||||
if not isinstance(searchlimit,int):
|
if not isinstance(sizelimit,int):
|
||||||
raise ipaerror.gen_exception(ipaerror.INPUT_INVALID_PARAMETER)
|
raise ipaerror.gen_exception(ipaerror.INPUT_INVALID_PARAMETER)
|
||||||
if not isinstance(timelimit,int):
|
if not isinstance(timelimit,int):
|
||||||
raise ipaerror.gen_exception(ipaerror.INPUT_INVALID_PARAMETER)
|
raise ipaerror.gen_exception(ipaerror.INPUT_INVALID_PARAMETER)
|
||||||
@@ -1998,8 +1998,8 @@ class IPAServer:
|
|||||||
config = self.get_ipa_config(opts)
|
config = self.get_ipa_config(opts)
|
||||||
if timelimit < 0:
|
if timelimit < 0:
|
||||||
timelimit = float(config.get('ipasearchtimelimit'))
|
timelimit = float(config.get('ipasearchtimelimit'))
|
||||||
if searchlimit < 0:
|
if sizelimit < 0:
|
||||||
searchlimit = float(config.get('ipasearchrecordslimit'))
|
sizelimit = int(config.get('ipasearchrecordslimit'))
|
||||||
|
|
||||||
search_fields = ["krbprincipalname"]
|
search_fields = ["krbprincipalname"]
|
||||||
|
|
||||||
@@ -2026,14 +2026,14 @@ class IPAServer:
|
|||||||
try:
|
try:
|
||||||
exact_results = conn.getListAsync(self.basedn, self.scope,
|
exact_results = conn.getListAsync(self.basedn, self.scope,
|
||||||
exact_match_filter, sattrs, 0, None, None, timelimit,
|
exact_match_filter, sattrs, 0, None, None, timelimit,
|
||||||
searchlimit)
|
sizelimit)
|
||||||
except ipaerror.exception_for(ipaerror.LDAP_NOT_FOUND):
|
except ipaerror.exception_for(ipaerror.LDAP_NOT_FOUND):
|
||||||
exact_results = [0]
|
exact_results = [0]
|
||||||
|
|
||||||
try:
|
try:
|
||||||
partial_results = conn.getListAsync(self.basedn, self.scope,
|
partial_results = conn.getListAsync(self.basedn, self.scope,
|
||||||
partial_match_filter, sattrs, 0, None, None, timelimit,
|
partial_match_filter, sattrs, 0, None, None, timelimit,
|
||||||
searchlimit)
|
sizelimit)
|
||||||
except ipaerror.exception_for(ipaerror.LDAP_NOT_FOUND):
|
except ipaerror.exception_for(ipaerror.LDAP_NOT_FOUND):
|
||||||
partial_results = [0]
|
partial_results = [0]
|
||||||
finally:
|
finally:
|
||||||
|
|||||||
Reference in new issue
Block a user