1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

samba-tool group listmembers: use binary encoded group names

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>
This commit is contained in:
Björn Baumbach 2020-02-26 13:38:50 +01:00 committed by Andrew Bartlett
parent 1d2e9f27fa
commit d0f8e83365

View File

@ -516,7 +516,8 @@ samba-tool group listmembers \"Domain Users\" -H ldap://samba.samdom.example.com
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),