1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-02 00:22:11 +03:00

s4-samba-tool: make new samba-tool group listmembers use samAccountName

This is the unique username value.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Thu May  3 01:57:41 CEST 2012 on sn-devel-104
This commit is contained in:
Andrew Bartlett
2012-05-02 16:44:27 +10:00
parent a0a83802fb
commit 86b1dd845a
2 changed files with 4 additions and 4 deletions

View File

@ -346,13 +346,13 @@ samba-tool group listmembers \"Domain Users\" -H ldap://samba.samdom.example.com
search_filter = "(|(primaryGroupID=%s)(memberOf=%s))" % (rid, group_dn)
res = samdb.search(samdb.domain_dn(), scope=ldb.SCOPE_SUBTREE,
expression=(search_filter),
attrs=["cn"])
attrs=["samAccountName"])
if (len(res) == 0):
return
for msg in res:
self.outf.write("%s\n" % msg.get("cn", idx=0))
self.outf.write("%s\n" % msg.get("samAccountName", idx=0))
except Exception, e:
raise CommandError('Failed to list members of "%s" group ' % groupname, e)

View File

@ -130,12 +130,12 @@ class GroupCmdTestCase(SambaToolCmdTest):
grouplist = self.samdb.search(base=self.samdb.domain_dn(),
scope=ldb.SCOPE_SUBTREE,
expression=search_filter,
attrs=["cn"])
attrs=["samAccountName"])
self.assertTrue(len(grouplist) > 0, "no groups found in samdb")
for groupobj in grouplist:
name = groupobj.get("cn", idx=0)
name = groupobj.get("samAccountName", idx=0)
found = self.assertMatch(out, name, "group '%s' not found" % name)
def _randomGroup(self, base={}):