diff options
author | Andrew Bartlett <abartlet@samba.org> | 2012-05-02 16:44:27 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2012-05-03 01:57:41 +0200 |
commit | 86b1dd845a595bd6f3a70176a155ee0187584a5e (patch) | |
tree | b1240ca31176a7f63f732eb98d09a3ee148716cf /source4 | |
parent | a0a83802fbcb5e4d415315e4ea3a35db827785a3 (diff) | |
download | samba-86b1dd845a595bd6f3a70176a155ee0187584a5e.tar.gz samba-86b1dd845a595bd6f3a70176a155ee0187584a5e.tar.bz2 samba-86b1dd845a595bd6f3a70176a155ee0187584a5e.zip |
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
Diffstat (limited to 'source4')
-rw-r--r-- | source4/scripting/python/samba/netcmd/group.py | 4 | ||||
-rw-r--r-- | source4/scripting/python/samba/tests/samba_tool/group.py | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/source4/scripting/python/samba/netcmd/group.py b/source4/scripting/python/samba/netcmd/group.py index 5cd9ba8701..265170d2d2 100644 --- a/source4/scripting/python/samba/netcmd/group.py +++ b/source4/scripting/python/samba/netcmd/group.py @@ -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) diff --git a/source4/scripting/python/samba/tests/samba_tool/group.py b/source4/scripting/python/samba/tests/samba_tool/group.py index b7f751747d..2c0c46e5dc 100644 --- a/source4/scripting/python/samba/tests/samba_tool/group.py +++ b/source4/scripting/python/samba/tests/samba_tool/group.py @@ -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={}): |