s3:winbindd/idmap make idmap modules loadable again
[kai/samba.git] / source3 / winbindd / idmap_adex / idmap_adex.c
index ea6d688b72f84ea1abdf537eab531f43f9252266..56e025d8014ae301c3d4ae9b5e317b7e573bee8b 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "includes.h"
 #include "ads.h"
+#include "idmap.h"
 #include "idmap_adex.h"
 #include "nss_info.h"
 #include "secrets.h"
@@ -41,8 +42,7 @@ NTSTATUS init_module(void);
  it will be dropped from the idmap backend list.
  *******************************************************************/
 
-static NTSTATUS _idmap_adex_init(struct idmap_domain *dom,
-                                    const char *params)
+static NTSTATUS _idmap_adex_init(struct idmap_domain *dom)
 {
        ADS_STRUCT *ads = NULL;
        ADS_STATUS status;
@@ -167,7 +167,7 @@ static NTSTATUS _idmap_adex_get_sid_from_id(struct
                ids[i]->status = ID_UNKNOWN;
        }
        
-       nt_status = _idmap_adex_init(dom, NULL);
+       nt_status = _idmap_adex_init(dom);
        if (!NT_STATUS_IS_OK(nt_status))
                return nt_status;
 
@@ -220,7 +220,7 @@ static NTSTATUS _idmap_adex_get_id_from_sid(struct
                ids[i]->status = ID_UNKNOWN;
        }
        
-       nt_status = _idmap_adex_init(dom, NULL);
+       nt_status = _idmap_adex_init(dom);
        if (!NT_STATUS_IS_OK(nt_status))
                return nt_status;
 
@@ -253,52 +253,6 @@ static NTSTATUS _idmap_adex_get_id_from_sid(struct
        return NT_STATUS_OK;
 }
 
-/**********************************************************************
- *********************************************************************/
-
-static NTSTATUS _idmap_adex_set_mapping(struct
-                                           idmap_domain
-                                           *dom, const struct
-                                           id_map *map)
-{
-       DEBUG(0, ("_idmap_adex_set_mapping: not implemented\n"));
-       return NT_STATUS_NOT_IMPLEMENTED;
-}
-
-/**********************************************************************
- *********************************************************************/
-
-static NTSTATUS _idmap_adex_remove_mapping(struct
-                                              idmap_domain
-                                              *dom, const
-                                              struct
-                                              id_map
-                                              *map)
-{
-       DEBUG(0, ("_idmap_adex_remove_mapping: not implemented\n"));
-       return NT_STATUS_NOT_IMPLEMENTED;
-}
-
-/**********************************************************************
- *********************************************************************/
-
-static NTSTATUS _idmap_adex_dump(struct idmap_domain
-                                    *dom, struct id_map **maps, int *num_map)
-{
-       return NT_STATUS_NOT_IMPLEMENTED;
-}
-
-/**********************************************************************
- *********************************************************************/
-
-static NTSTATUS _idmap_adex_close(struct idmap_domain
-                                     *dom)
-{
-       /* FIXME!  need to do cleanup here */
-
-       return NT_STATUS_OK;
-}
-
 /*
  * IdMap NSS plugin
  */
@@ -309,7 +263,7 @@ static NTSTATUS _idmap_adex_close(struct idmap_domain
 static NTSTATUS _nss_adex_init(struct nss_domain_entry
                                  *e)
 {
-       return _idmap_adex_init(NULL, NULL);
+       return _idmap_adex_init(NULL);
 }
 
 /**********************************************************************
@@ -319,8 +273,6 @@ static NTSTATUS _nss_adex_get_info(struct
                                      nss_domain_entry *e,
                                      const struct dom_sid * sid,
                                      TALLOC_CTX * ctx,
-                                     ADS_STRUCT * ads,
-                                     LDAPMessage * msg,
                                      const char **homedir,
                                      const char **shell,
                                      const char **gecos, gid_t * p_gid)
@@ -328,7 +280,7 @@ static NTSTATUS _nss_adex_get_info(struct
        NTSTATUS nt_status;
         struct likewise_cell *cell;
 
-       nt_status = _idmap_adex_init(NULL, NULL);
+       nt_status = _idmap_adex_init(NULL);
        if (!NT_STATUS_IS_OK(nt_status))
                return nt_status;
 
@@ -350,7 +302,7 @@ static NTSTATUS _nss_adex_map_to_alias(TALLOC_CTX * mem_ctx,
        NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL;
         struct likewise_cell *cell = NULL;
 
-       nt_status = _idmap_adex_init(NULL, NULL);
+       nt_status = _idmap_adex_init(NULL);
        BAIL_ON_NTSTATUS_ERROR(nt_status);
 
        if ((cell = cell_list_head()) == NULL) {
@@ -381,7 +333,7 @@ static NTSTATUS _nss_adex_map_from_alias(TALLOC_CTX * mem_ctx,
        NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL;
         struct likewise_cell *cell = NULL;
 
-       nt_status = _idmap_adex_init(NULL, NULL);
+       nt_status = _idmap_adex_init(NULL);
        BAIL_ON_NTSTATUS_ERROR(nt_status);
 
        if ((cell = cell_list_head()) == NULL) {
@@ -419,10 +371,6 @@ static struct idmap_methods adex_idmap_methods = {
        .init             = _idmap_adex_init,
        .unixids_to_sids  = _idmap_adex_get_sid_from_id,
        .sids_to_unixids  = _idmap_adex_get_id_from_sid,
-       .set_mapping      = _idmap_adex_set_mapping,
-       .remove_mapping   = _idmap_adex_remove_mapping,
-       .dump_data        = _idmap_adex_dump,
-       .close_fn         = _idmap_adex_close
 };
 static struct nss_info_methods adex_nss_methods = {
        .init           = _nss_adex_init,
@@ -437,7 +385,7 @@ static struct nss_info_methods adex_nss_methods = {
  against the idmap and nss_info interfaces being in a half-registered
  state.
  **********************************************************************/
-NTSTATUS idmap_adex_init(void)
+NTSTATUS samba_init_module(void)
 {
        static NTSTATUS idmap_status = NT_STATUS_UNSUCCESSFUL;
        static NTSTATUS nss_status = NT_STATUS_UNSUCCESSFUL;
@@ -467,8 +415,3 @@ NTSTATUS idmap_adex_init(void)
 
        return NT_STATUS_OK;
 }
-
-static NTSTATUS nss_info_adex_init(void)
-{
-       return idmap_adex_init();
-}