s3:idmap_ldap: remove unused idmap_ldap_alloc_init().
authorMichael Adam <obnox@samba.org>
Tue, 7 Dec 2010 23:06:50 +0000 (00:06 +0100)
committerMichael Adam <obnox@samba.org>
Sun, 2 Jan 2011 11:51:54 +0000 (12:51 +0100)
source3/winbindd/idmap_ldap.c

index cb5f67d913b800a96da995452c9f3113a8651581..b6674ee02bc0e7acdbcabf349f818e1b57422a89 100644 (file)
@@ -251,88 +251,6 @@ static int idmap_ldap_alloc_close_destructor(struct idmap_ldap_alloc_context *ct
        return 0;
 }
 
-static NTSTATUS idmap_ldap_alloc_init(struct idmap_domain *dom,
-                                     const char *params)
-{
-       NTSTATUS ret = NT_STATUS_UNSUCCESSFUL;
-       const char *tmp;
-       struct idmap_ldap_context *ctx;
-
-       /* Only do init if we are online */
-       if (idmap_is_offline()) {
-               return NT_STATUS_FILE_IS_OFFLINE;
-       }
-
-       ctx = talloc_get_type(dom->private_data, struct idmap_ldap_context);
-
-       ctx->alloc = talloc_zero(ctx, struct idmap_ldap_alloc_context);
-        CHECK_ALLOC_DONE(ctx->alloc);
-
-       if (params && *params) {
-               /* assume location is the only parameter */
-               ctx->alloc->url = talloc_strdup(ctx->alloc, params);
-       } else {
-               tmp = lp_parm_const_string(-1, "idmap alloc config",
-                                          "ldap_url", NULL);
-
-               if ( ! tmp) {
-                       DEBUG(1, ("ERROR: missing idmap ldap url\n"));
-                       ret = NT_STATUS_UNSUCCESSFUL;
-                       goto done;
-               }
-
-               ctx->alloc->url = talloc_strdup(ctx->alloc, tmp);
-       }
-       CHECK_ALLOC_DONE(ctx->alloc->url);
-
-       trim_char(ctx->alloc->url, '\"', '\"');
-
-       tmp = lp_parm_const_string(-1, "idmap alloc config",
-                                  "ldap_base_dn", NULL);
-       if ( ! tmp || ! *tmp) {
-               tmp = lp_ldap_idmap_suffix();
-               if ( ! tmp) {
-                       DEBUG(1, ("ERROR: missing idmap ldap suffix\n"));
-                       ret = NT_STATUS_UNSUCCESSFUL;
-                       goto done;
-               }
-       }
-
-       ctx->alloc->suffix = talloc_strdup(ctx->alloc, tmp);
-       CHECK_ALLOC_DONE(ctx->alloc->suffix);
-
-       ret = smbldap_init(ctx->alloc, winbind_event_context(),
-                          ctx->alloc->url,
-                          &ctx->alloc->smbldap_state);
-       if (!NT_STATUS_IS_OK(ret)) {
-               DEBUG(1, ("ERROR: smbldap_init (%s) failed!\n",
-                         ctx->alloc->url));
-               goto done;
-       }
-
-       talloc_set_destructor(ctx->alloc, idmap_ldap_alloc_close_destructor);
-
-       ret = get_credentials(ctx->alloc,
-                             ctx->alloc->smbldap_state,
-                             "idmap alloc config", NULL,
-                             &ctx->alloc->user_dn);
-       if ( !NT_STATUS_IS_OK(ret) ) {
-               DEBUG(1,("idmap_ldap_alloc_init: Failed to get connection "
-                        "credentials (%s)\n", nt_errstr(ret)));
-               goto done;
-       }
-
-       /* see if the idmap suffix and sub entries exists */
-
-       ret = verify_idpool(dom);
-
- done:
-       if ( !NT_STATUS_IS_OK( ret ) )
-               TALLOC_FREE(ctx->alloc);
-
-       return ret;
-}
-
 /********************************
  Allocate a new uid or gid
 ********************************/