r23406: Evn if not strictly currently necessary do check for correct
authorSimo Sorce <idra@samba.org>
Sat, 9 Jun 2007 19:29:35 +0000 (19:29 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:23:13 +0000 (12:23 -0500)
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
source3/nsswitch/idmap_passdb.c

index e3e425f105f4e5e14fe03f2dc43e4a20f32aab7e..fbdd391965c6d57e2c116aca9e7ce15a772dcf32 100644 (file)
@@ -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"));
index 665ead5bb104737918539bf891e788b49c1ec13d..c4533aa3a5374daa8787dd417d55e0265abfd343 100644 (file)
@@ -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;