r26426: Remove uses of global_loadparm.
authorJelmer Vernooij <jelmer@samba.org>
Thu, 13 Dec 2007 10:41:47 +0000 (11:41 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 21 Dec 2007 04:49:52 +0000 (05:49 +0100)
(This used to be commit e1d177c8c1101965479f7ade2270490cd6fae4f2)

source4/lib/ldb/tools/ad2oLschema.c
source4/libcli/resolve/nbtlist.c
source4/nbt_server/wins/winswack.c
source4/torture/nbt/winsbench.c
source4/torture/rpc/spoolss_notify.c
source4/torture/rpc/spoolss_win.c

index 5fcf75257824d5a7d4577168bde89c58f9dd1d69..c8974d7e7dd771ca7de5701848ab9fbef5ccd32f 100644 (file)
@@ -37,6 +37,7 @@
 #include "tools/cmdline.h"
 #include "tools/convert.h"
 #include "param/param.h"
+#include "lib/cmdline/popt_common.h"
 
 struct schema_conv {
        int count;
@@ -677,7 +678,7 @@ static struct schema_conv process_convert(struct ldb_context *ldb, enum convert_
                }
        }
 
-       target_str = lp_parm_string(global_loadparm, NULL, "convert", "target");
+       target_str = lp_parm_string(cmdline_lp_ctx, NULL, "convert", "target");
 
        if (!target_str || strcasecmp(target_str, "openldap") == 0) {
                target = TARGET_OPENLDAP;
index 595743e69324491d73aa058228d8e024b5dad07d..21792a665a48f773e73f73f1a848480149e60835 100644 (file)
@@ -38,6 +38,7 @@ struct nbtlist_state {
        struct nbt_name_request **queries;
        struct nbt_name_query *io_queries;
        const char *reply_addr;
+       struct interface *ifaces;
 };
 
 /*
@@ -49,7 +50,6 @@ static void nbtlist_handler(struct nbt_name_request *req)
                                                      struct composite_context);
        struct nbtlist_state *state = talloc_get_type(c->private_data, struct nbtlist_state);
        struct nbt_name_query *q;
-       struct interface *ifaces;
        int i;
 
        for (i=0;i<state->num_queries;i++) {
@@ -76,16 +76,14 @@ static void nbtlist_handler(struct nbt_name_request *req)
        }
 
        /* favor a local address if possible */
-       load_interfaces(NULL, lp_interfaces(global_loadparm), &ifaces);
        state->reply_addr = NULL;
        for (i=0;i<q->out.num_addrs;i++) {
-               if (iface_is_local(ifaces, q->out.reply_addrs[i])) {
+               if (iface_is_local(state->ifaces, q->out.reply_addrs[i])) {
                        state->reply_addr = talloc_steal(state, 
                                                         q->out.reply_addrs[i]);
                        break;
                }
        }
-       talloc_free(ifaces);
 
        if (state->reply_addr == NULL) {
                state->reply_addr = talloc_steal(state, 
@@ -129,6 +127,8 @@ struct composite_context *resolve_name_nbtlist_send(TALLOC_CTX *mem_ctx,
                if (composite_nomem(state->name.scope, c)) return c;
        }
 
+       load_interfaces(state, lp_interfaces(global_loadparm), &state->ifaces);
+
        /*
         * we can't push long names on the wire,
         * so bail out here to give a useful error message
@@ -200,7 +200,8 @@ NTSTATUS resolve_name_nbtlist(struct nbt_name *name,
                              bool broadcast, bool wins_lookup,
                              const char **reply_addr)
 {
-       struct composite_context *c = resolve_name_nbtlist_send(mem_ctx, NULL, name, address_list, 
+       struct composite_context *c = resolve_name_nbtlist_send(mem_ctx, NULL, 
+                                                               name, address_list, 
                                                                broadcast, wins_lookup);
        return resolve_name_nbtlist_recv(c, mem_ctx, reply_addr);
 }
index 3ffa2df79c09d0d69d9d0d39204f1336b1bd7646..929155c842959ed0106852dc289956a7814fb919 100644 (file)
@@ -223,7 +223,7 @@ static struct composite_context *wins_release_demand_send(TALLOC_CTX *mem_ctx, s
         *   with 2 retries
         */
        state->release.in.name        = *state->io->in.name;
-       state->release.in.dest_port   = lp_nbt_port(global_loadparm);
+       state->release.in.dest_port   = lp_nbt_port(state->io->in.nbtd_server->task->lp_ctx);
        state->release.in.dest_addr   = state->io->in.addresses[state->current_address];
        state->release.in.address     = state->release.in.dest_addr;
        state->release.in.broadcast   = false;
index 5d7dbaf93e37711a9ac5339793ca78920b0106d9..1488c17757eaf8e13b67a64a1a8953b741721c90 100644 (file)
@@ -139,7 +139,7 @@ static void generate_release(struct nbt_name_socket *nbtsock, struct wins_state
        istate->state = state;
 
        io.in.name            = generate_name(tmp_ctx, idx);
-       io.in.dest_port       = lp_nbt_port(global_loadparm);
+       io.in.dest_port       = state->wins_port;
        io.in.dest_addr       = state->wins_server;
        io.in.address         = state->my_ip;
        io.in.nb_flags        = NBT_NODE_H;
index 559c50df4535bea9826830b21d899305871576da..00651014470f5bcf5cbd19b09d90a20737c78633 100644 (file)
@@ -195,6 +195,8 @@ static bool test_RFFPCNEx(struct torture_context *tctx,
        const char *address;
        struct interface *ifaces;
 
+       ntvfs_init(tctx->lp_ctx);
+
        ZERO_STRUCT(q);
 
        q.in.printername        = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p));
@@ -291,7 +293,6 @@ struct torture_suite *torture_rpc_spoolss_notify(TALLOC_CTX *mem_ctx)
        struct torture_rpc_tcase *tcase = torture_suite_add_rpc_iface_tcase(suite, 
                                                        "notify", &ndr_table_spoolss);
 
-       ntvfs_init(global_loadparm);
        torture_rpc_tcase_add_test(tcase, "testRFFPCNEx", test_RFFPCNEx);
        
        return suite;
index 8f70284ed39ef26a637196f4f79287242deac8b2..1bc8aeb07433c130632c79fb28c8d039ff37d4ef 100644 (file)
@@ -420,6 +420,8 @@ static bool test_WinXP(struct torture_context *tctx, struct dcerpc_pipe *p)
        char *server_name;
        char *key_pointer;
 
+       ntvfs_init(tctx->lp_ctx);
+
        ctx = talloc_zero(tctx, struct test_spoolss_win_context);
        tmp_ctx = talloc_zero(tctx, struct test_spoolss_win_context);
 
@@ -570,7 +572,6 @@ struct torture_suite *torture_rpc_spoolss_win(TALLOC_CTX *mem_ctx)
        struct torture_rpc_tcase *tcase = torture_suite_add_rpc_iface_tcase(suite, 
                                                        "win", &ndr_table_spoolss);
 
-       ntvfs_init(global_loadparm);
        torture_rpc_tcase_add_test(tcase, "testWinXP", test_WinXP);
 
        return suite;