r26295: Remove use of global_loadparm for net and wb_pam_auth.
authorJelmer Vernooij <jelmer@samba.org>
Tue, 4 Dec 2007 18:33:00 +0000 (19:33 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 21 Dec 2007 04:48:12 +0000 (05:48 +0100)
(This used to be commit 47696b42987ea67ae1c6c09a4bec5858e5db4542)

.bzrignore
source4/utils/net/net.c
source4/utils/net/net.h
source4/utils/net/net_join.c
source4/utils/net/net_vampire.c
source4/winbind/wb_pam_auth.c

index 935b886710a5f1f805f45d52fc1d8570a67d0afd..76232aa6c54e3e1c4013c9a48d74d4663554f5db 100644 (file)
@@ -213,3 +213,4 @@ source/tdbtest.ldb
 source/tdbtest.ldb.2
 source/templates.ldb
 source/tmpccache
+source/lib/util/util_ldb.h
index 64e82e226a1ecac924a921a5e1e0e4c43a387ebc..2741f485cc38c75dba49905bb7b488dbd470f6f2 100644 (file)
@@ -45,6 +45,7 @@
 #include "lib/cmdline/popt_common.h"
 #include "lib/ldb/include/ldb.h"
 #include "librpc/rpc/dcerpc.h"
+#include "param/param.h"
 
 /*
   run a function from a function table. If not found then
@@ -192,6 +193,7 @@ static int binary_net(int argc, const char **argv)
 
        ZERO_STRUCTP(ctx);
        ctx->mem_ctx = mem_ctx;
+       ctx->lp_ctx = global_loadparm;
        ctx->credentials = cmdline_credentials;
 
        rc = net_run_function(ctx, argc_new-1, argv_new+1, net_functable, net_usage);
index d9b5923dad189b4bd6a90f88184f1f419f315673..8c4fbd7fddbc766149c7a6b204a7fdb59ad955a0 100644 (file)
@@ -24,6 +24,7 @@
 struct net_context {
        TALLOC_CTX *mem_ctx;
        struct cli_credentials *credentials;
+       struct loadparm_context *lp_ctx;
 };
 
 struct net_functable {
index 1352fb7d9bfa59a9f2651c9e91d8158c4fb7c8fd..6d833f8e93c95406cccb5075394cb1327bf21af5 100644 (file)
@@ -67,7 +67,7 @@ int net_join(struct net_context *ctx, int argc, const char **argv)
                return -1;
        }
        /* prepare parameters for the join */
-       r->in.netbios_name              = lp_netbios_name(global_loadparm);
+       r->in.netbios_name              = lp_netbios_name(ctx->lp_ctx);
        r->in.domain_name               = domain_name;
        r->in.join_type                 = secure_channel_type;
        r->in.level                     = LIBNET_JOIN_AUTOMATIC;
index dc11917fa47c4ce464595a31ae8e6c4b276a42d5..4e0f1501d94b63f55ae3350c191e5a498886ab93 100644 (file)
@@ -152,7 +152,7 @@ int net_samsync_ldb(struct net_context *ctx, int argc, const char **argv)
        r.in.binding_string = NULL;
 
        /* Needed to override the ACLs on ldb */
-       r.in.session_info = system_session(libnetctx, global_loadparm);
+       r.in.session_info = system_session(libnetctx, ctx->lp_ctx);
 
        status = libnet_samsync_ldb(libnetctx, libnetctx, &r);
        if (!NT_STATUS_IS_OK(status)) {
index 9045c63d63b38c6c431537e0cffda08442ec4e5b..c8e81e09f2bb0341f335e07212bf819c75abc759 100644 (file)
@@ -35,6 +35,7 @@
 struct pam_auth_crap_state {
        struct composite_context *ctx;
        struct event_context *event_ctx;
+       struct loadparm_context *lp_ctx;
 
        struct winbind_SamLogon *req;
        char *unix_username;
@@ -77,6 +78,7 @@ struct composite_context *wb_cmd_pam_auth_crap_send(TALLOC_CTX *mem_ctx,
        state = talloc(result, struct pam_auth_crap_state);
        if (state == NULL) goto failed;
        state->ctx = result;
+       state->lp_ctx = service->task->lp_ctx;
        result->private_data = state;
 
        state->req = talloc(state, struct winbind_SamLogon);
@@ -176,7 +178,7 @@ static void pam_auth_crap_recv_logon(struct composite_context *ctx)
 
        state->unix_username = talloc_asprintf(state, "%s%s%s", 
                                               state->domain_name,
-                                              lp_winbind_separator(global_loadparm),
+                                              lp_winbind_separator(state->lp_ctx),
                                               state->user_name);
        if (composite_nomem(state->unix_username, state->ctx)) return;