samba-tool group edit: use binary encoded group name
authorBjörn Baumbach <bb@sernet.de>
Wed, 26 Feb 2020 12:56:14 +0000 (13:56 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 28 Feb 2020 03:08:45 +0000 (03:08 +0000)
Allows to edit 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>
python/samba/netcmd/group.py

index c063657a5ae39ebd85f882d5601ec44b2c579a8a..7670510096044d5c0588646688b91266c69728f6 100644 (file)
@@ -873,7 +873,8 @@ class cmd_group_edit(Command):
         samdb = SamDB(url=H, session_info=system_session(),
                       credentials=creds, lp=lp)
 
-        filter = ("(&(sAMAccountName=%s)(objectClass=group))" % groupname)
+        filter = ("(&(sAMAccountName=%s)(objectClass=group))" %
+                  ldb.binary_encode(groupname))
 
         domaindn = samdb.domain_dn()