s3:net: remove the "net idmap secret alloc" functionality.
authorMichael Adam <obnox@samba.org>
Mon, 31 May 2010 13:00:38 +0000 (15:00 +0200)
committerMichael Adam <obnox@samba.org>
Mon, 31 May 2010 15:34:08 +0000 (17:34 +0200)
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.

Michael

source3/utils/net_idmap.c

index c12726259486b7e01ab70af3dde3a3636ad71a39..106a9a593ccb2136f4b2587d62f78b78df7170f4 100644 (file)
@@ -246,11 +246,9 @@ static int net_idmap_secret(struct net_context *c, int argc, const char **argv)
 
        if (argc != 2 || c->display_usage) {
                d_printf("Usage:\n"
-                        "net idmap secret {<DOMAIN>|alloc} <secret>\n"
-                        "  Set the secret for the specified domain "
-                        "(or alloc module)\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;
        }
@@ -260,19 +258,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, "The only currently supported backend is LDAP\n");
@@ -280,27 +273,15 @@ 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);