From 22a7d90bfe94a1bb16c1d3d1070d1aad8dc4803f Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Sat, 9 Jun 2007 19:29:35 +0000 Subject: r23406: Evn if not strictly currently necessary do check for correct init also in idmap_nss and idmap_passdb for coherency and to prevent errors in future if we change the init functions to actually do something and not just return NT_STATUS_OK (This used to be commit 86f532c1b0cf7961b8331bb212c3ed2084fda3fc) --- source3/nsswitch/idmap_nss.c | 8 ++++++++ source3/nsswitch/idmap_passdb.c | 8 ++++++++ 2 files changed, 16 insertions(+) (limited to 'source3/nsswitch') diff --git a/source3/nsswitch/idmap_nss.c b/source3/nsswitch/idmap_nss.c index e3e425f105..fbdd391965 100644 --- a/source3/nsswitch/idmap_nss.c +++ b/source3/nsswitch/idmap_nss.c @@ -45,6 +45,10 @@ static NTSTATUS idmap_nss_unixids_to_sids(struct idmap_domain *dom, struct id_ma TALLOC_CTX *ctx; int i; + if (! dom->initialized) { + return NT_STATUS_UNSUCCESSFUL; + } + ctx = talloc_new(dom); if ( ! ctx) { DEBUG(0, ("Out of memory!\n")); @@ -131,6 +135,10 @@ static NTSTATUS idmap_nss_sids_to_unixids(struct idmap_domain *dom, struct id_ma TALLOC_CTX *ctx; int i; + if (! dom->initialized) { + return NT_STATUS_UNSUCCESSFUL; + } + ctx = talloc_new(dom); if ( ! ctx) { DEBUG(0, ("Out of memory!\n")); diff --git a/source3/nsswitch/idmap_passdb.c b/source3/nsswitch/idmap_passdb.c index 665ead5bb1..c4533aa3a5 100644 --- a/source3/nsswitch/idmap_passdb.c +++ b/source3/nsswitch/idmap_passdb.c @@ -43,6 +43,10 @@ static NTSTATUS idmap_pdb_unixids_to_sids(struct idmap_domain *dom, struct id_ma { int i; + if (! dom->initialized) { + return NT_STATUS_UNSUCCESSFUL; + } + for (i = 0; ids[i]; i++) { /* unmapped by default */ @@ -75,6 +79,10 @@ static NTSTATUS idmap_pdb_sids_to_unixids(struct idmap_domain *dom, struct id_ma { int i; + if (! dom->initialized) { + return NT_STATUS_UNSUCCESSFUL; + } + for (i = 0; ids[i]; i++) { enum lsa_SidType type; union unid_t id; -- cgit