diff options
author | Michael Adam <obnox@samba.org> | 2014-02-20 16:57:21 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2014-02-25 11:17:18 +0100 |
commit | e35b1d8dc43e63d8932e8e0e3cd274e9de6963e3 (patch) | |
tree | 37f1716751f7b63ca6a6e4b0ab2f3b6a50fb3f5f /source3/passdb | |
parent | 0cb15c169f134026e0dae40994640f76e64f99d9 (diff) | |
download | samba-e35b1d8dc43e63d8932e8e0e3cd274e9de6963e3.tar.gz samba-e35b1d8dc43e63d8932e8e0e3cd274e9de6963e3.tar.xz samba-e35b1d8dc43e63d8932e8e0e3cd274e9de6963e3.zip |
passdb: spare superfluous call to lookup_rids() in lookup_sids()
If we have no name indexes for a domain, all names were domain
names and have been resolved earlier, including the domain name.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10463
Change-Id: I5a7a387fa89d2b2bdd465c13b3dca0e18ca0482c
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Feb 25 11:17:18 CET 2014 on sn-devel-104
Diffstat (limited to 'source3/passdb')
-rw-r--r-- | source3/passdb/lookup_sid.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/source3/passdb/lookup_sid.c b/source3/passdb/lookup_sid.c index 6ec6ce8e47..fa44f3efbd 100644 --- a/source3/passdb/lookup_sid.c +++ b/source3/passdb/lookup_sid.c @@ -899,13 +899,18 @@ NTSTATUS lookup_sids(TALLOC_CTX *mem_ctx, int num_sids, break; } - if (dom->num_idxs) { - if (!(rids = talloc_array(tmp_ctx, uint32, dom->num_idxs))) { - result = NT_STATUS_NO_MEMORY; - goto fail; - } - } else { - rids = NULL; + if (dom->num_idxs == 0) { + /* + * This happens only if the only sid related to + * this domain is the domain sid itself, which + * is mapped to SID_NAME_DOMAIN above. + */ + continue; + } + + if (!(rids = talloc_array(tmp_ctx, uint32, dom->num_idxs))) { + result = NT_STATUS_NO_MEMORY; + goto fail; } for (j=0; j<dom->num_idxs; j++) { |