MCPcopy Create free account
hub / github.com/XiaoliChan/LDAPShell / do_search

Method do_search

utils/ldap_shell.py:404–416  ·  view source on GitHub ↗
(self, line)

Source from the content-addressed store, hash-verified

402 raise Exception('The server returned an error: %s', self.client.result['message'])
403
404 def do_search(self, line):
405 arguments = shlex.split(line)
406 if len(arguments) == 0:
407 raise Exception("A query is required.")
408
409 filter_attributes = ['name', 'distinguishedName', 'sAMAccountName']
410 attributes = filter_attributes[:]
411 attributes.append('objectSid')
412 for argument in arguments[1:]:
413 attributes.append(argument)
414
415 search_query = "".join("(%s=*%s*)" % (attribute, escape_filter_chars(arguments[0])) for attribute in filter_attributes)
416 self.search('(|%s)' % search_query, *attributes)
417
418 def do_set_dontreqpreauth(self, line):
419 UF_DONT_REQUIRE_PREAUTH = 4194304

Callers

nothing calls this directly

Calls 1

searchMethod · 0.95

Tested by

no test coverage detected