From: Simo Sorce Date: Sat, 9 Jun 2007 19:29:35 +0000 (+0000) Subject: r23406: Evn if not strictly currently necessary do check for correct X-Git-Tag: samba-misc-tags/initial-v3-0-unstable~237 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=86f532c1b0cf7961b8331bb212c3ed2084fda3fc;p=thirdparty%2Fsamba.git 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 --- diff --git a/source/nsswitch/idmap_nss.c b/source/nsswitch/idmap_nss.c index e3e425f105f..fbdd391965c 100644 --- a/source/nsswitch/idmap_nss.c +++ b/source/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/source/nsswitch/idmap_passdb.c b/source/nsswitch/idmap_passdb.c index 665ead5bb10..c4533aa3a53 100644 --- a/source/nsswitch/idmap_passdb.c +++ b/source/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;