From 502d00e463ad39b9d8843bd3539fdedfa56add38 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 31 May 2010 15:00:38 +0200 Subject: s3:net: remove the "net idmap secret alloc" functionality. This is now not available any more, since allocation is moved below the id mapping layer. The functionality could be reintroduced on a per domain basis as an e.g "net idmap secret alloc" command. --- source3/utils/net_idmap.c | 57 +++++++++++++++-------------------------------- 1 file changed, 18 insertions(+), 39 deletions(-) (limited to 'source3/utils') diff --git a/source3/utils/net_idmap.c b/source3/utils/net_idmap.c index 46014cab7c..cd3a68db3c 100644 --- a/source3/utils/net_idmap.c +++ b/source3/utils/net_idmap.c @@ -322,12 +322,10 @@ static int net_idmap_secret(struct net_context *c, int argc, const char **argv) if (argc != 2 || c->display_usage) { d_printf("%s\n%s", - _("Usage:"), - _("net idmap secret {|alloc} \n" - " Set the secret for the specified domain " - "(or alloc module)\n" + _("Usage:\n"), + _("net idmap secret \n" + " Set the secret for the specified domain\n" " DOMAIN\tDomain to set secret for.\n" - " alloc\tSet secret for the alloc module\n" " secret\tNew secret to set.\n")); return c->display_usage?0:-1; } @@ -337,19 +335,14 @@ static int net_idmap_secret(struct net_context *c, int argc, const char **argv) ctx = talloc_new(NULL); ALLOC_CHECK(ctx); - if (strcmp(argv[0], "alloc") == 0) { - domain = NULL; - backend = lp_idmap_alloc_backend(); - } else { - domain = talloc_strdup(ctx, argv[0]); - ALLOC_CHECK(domain); + domain = talloc_strdup(ctx, argv[0]); + ALLOC_CHECK(domain); - opt = talloc_asprintf(ctx, "idmap config %s", domain); - ALLOC_CHECK(opt); + opt = talloc_asprintf(ctx, "idmap config %s", domain); + ALLOC_CHECK(opt); - backend = talloc_strdup(ctx, lp_parm_const_string(-1, opt, "backend", "tdb")); - ALLOC_CHECK(backend); - } + backend = talloc_strdup(ctx, lp_parm_const_string(-1, opt, "backend", "tdb")); + ALLOC_CHECK(backend); if ( ( ! backend) || ( ! strequal(backend, "ldap"))) { d_fprintf(stderr, @@ -358,31 +351,17 @@ static int net_idmap_secret(struct net_context *c, int argc, const char **argv) return -1; } - if (domain) { - - dn = lp_parm_const_string(-1, opt, "ldap_user_dn", NULL); - if ( ! dn) { - d_fprintf(stderr, - _("Missing ldap_user_dn option for domain " - "%s\n"), domain); - talloc_free(ctx); - return -1; - } - - ret = idmap_store_secret("ldap", false, domain, dn, secret); - } else { - dn = lp_parm_const_string(-1, "idmap alloc config", "ldap_user_dn", NULL); - if ( ! dn) { - d_fprintf(stderr, - _("Missing ldap_user_dn option for alloc " - "backend\n")); - talloc_free(ctx); - return -1; - } - - ret = idmap_store_secret("ldap", true, NULL, dn, secret); + dn = lp_parm_const_string(-1, opt, "ldap_user_dn", NULL); + if ( ! dn) { + d_fprintf(stderr, + _("Missing ldap_user_dn option for domain %s\n"), + domain); + talloc_free(ctx); + return -1; } + ret = idmap_store_secret("ldap", false, domain, dn, secret); + if ( ! ret) { d_fprintf(stderr, _("Failed to store secret\n")); talloc_free(ctx); -- cgit