summaryrefslogtreecommitdiff
path: root/source3/utils/net_idmap.c
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2010-05-31 15:00:38 +0200
committerMichael Adam <obnox@samba.org>2010-08-14 02:10:41 +0200
commit502d00e463ad39b9d8843bd3539fdedfa56add38 (patch)
treedad41a8b8ad2524038283bd789ca29fd21f653d0 /source3/utils/net_idmap.c
parent8496c663ff2c93911b0221e24fdf4f4b31e9e563 (diff)
downloadsamba-502d00e463ad39b9d8843bd3539fdedfa56add38.tar.gz
samba-502d00e463ad39b9d8843bd3539fdedfa56add38.tar.bz2
samba-502d00e463ad39b9d8843bd3539fdedfa56add38.zip
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 <domain> alloc" command.
Diffstat (limited to 'source3/utils/net_idmap.c')
-rw-r--r--source3/utils/net_idmap.c57
1 files changed, 18 insertions, 39 deletions
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 {<DOMAIN>|alloc} <secret>\n"
- " Set the secret for the specified domain "
- "(or alloc module)\n"
+ _("Usage:\n"),
+ _("net idmap secret <DOMAIN> <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);