Allows to find groups with names like e.g. 'group1 (xy)'.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14296
Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
samdb = SamDB(url=H, session_info=system_session(),
credentials=creds, lp=lp)
- search_filter = "(&(objectClass=group)(samaccountname=%s))" % groupname
+ search_filter = ("(&(objectClass=group)(sAMAccountName=%s))" %
+ ldb.binary_encode(groupname))
try:
res = samdb.search(samdb.domain_dn(), scope=ldb.SCOPE_SUBTREE,
expression=(search_filter),