mirror of
https://github.com/samba-team/samba.git
synced 2025-07-27 07:42:04 +03:00
samba-tool: use ldb.binary_encode() on search expression elements
this allows us to deal with search elements containing characters that must be escaped in LDAP Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org> Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
@ -287,8 +287,9 @@ class cmd_drs_replicate(Command):
|
||||
|
||||
# we need to find the NTDS GUID of the source DC
|
||||
msg = self.samdb.search(base=self.samdb.get_config_basedn(),
|
||||
expression="(&(objectCategory=server)(|(name=%s)(dNSHostName=%s)))" % (SOURCE_DC,
|
||||
SOURCE_DC),
|
||||
expression="(&(objectCategory=server)(|(name=%s)(dNSHostName=%s)))" % (
|
||||
ldb.binary_encode(SOURCE_DC),
|
||||
ldb.binary_encode(SOURCE_DC)),
|
||||
attrs=[])
|
||||
if len(msg) == 0:
|
||||
raise CommandError("Failed to find source DC %s" % SOURCE_DC)
|
||||
|
Reference in New Issue
Block a user