r26277: Move loadparm context higher up the stack.
authorJelmer Vernooij <jelmer@samba.org>
Tue, 4 Dec 2007 00:51:36 +0000 (01:51 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 21 Dec 2007 04:48:03 +0000 (05:48 +0100)
(This used to be commit 38fa08310ce573e9b46e76c840ddda6f18863573)

source4/client/smbmount.c
source4/kdc/hdb-ldb.c
source4/lib/ldb/tools/cmdline.c
source4/libcli/ldap/ldap_bind.c
source4/libnet/libnet_become_dc.c
source4/librpc/rpc/dcerpc.h
source4/librpc/rpc/dcerpc_connect.c

index 907405535e4b295f89b4ff09862516b8339d7075..36271c9a2e5d0df76b1f401980c5c6ccd087f7c5 100644 (file)
@@ -409,7 +409,7 @@ static void send_fs_socket(struct loadparm_context *lp_ctx,
                        DEBUG(2,("mount.smbfs[%d]: got signal, getting new socket\n", sys_getpid()));
                        c = do_connection(the_service, 
                                          lp_unicode(lp_ctx), 
-                                         lp_cli_maxprotocol(global_loadparm));
+                                         lp_cli_maxprotocol(lp_ctx));
                }
        }
 
@@ -422,7 +422,7 @@ static void send_fs_socket(struct loadparm_context *lp_ctx,
 /**
  * Mount a smbfs
  **/
-static void init_mount(void)
+static void init_mount(struct loadparm_context *lp_ctx)
 {
        char mount_point[MAXPATHLEN+1];
        pstring tmp;
@@ -437,7 +437,7 @@ static void init_mount(void)
        }
 
 
-       c = do_connection(service, lp_unicode(global_loadparm), lp_cli_maxprotocol(global_loadparm));
+       c = do_connection(service, lp_unicode(lp_ctx), lp_cli_maxprotocol(lp_ctx));
        if (!c) {
                fprintf(stderr,"SMB connection failed\n");
                exit(1);
@@ -530,7 +530,7 @@ static void init_mount(void)
           for any reason, we will have to unmount the mount point.  There
           is no exit from the next call...
        */
-       send_fs_socket(global_loadparm, service, mount_point, c);
+       send_fs_socket(lp_ctx, service, mount_point, c);
 }
 
 
@@ -923,6 +923,6 @@ static void parse_mount_smb(int argc, char **argv)
        }
        strupper(my_netbios_name);
 
-       init_mount();
+       init_mount(global_loadparm);
        return 0;
 }
index 95a6b502a4b28f7f6ed66675cf2d314b0ab95262..7448b6fba51b0b4f458ca48b64e70daa8d203fbe 100644 (file)
@@ -1134,7 +1134,7 @@ NTSTATUS kdc_hdb_ldb_create(TALLOC_CTX *mem_ctx,
                                           CRED_DONT_USE_KERBEROS);
 
        /* Setup the link to LDB */
-       (*db)->hdb_db = samdb_connect(*db, global_loadparm, session_info);
+       (*db)->hdb_db = samdb_connect(*db, lp_ctx, session_info);
        if ((*db)->hdb_db == NULL) {
                DEBUG(1, ("hdb_ldb_create: Cannot open samdb for KDC backend!"));
                return NT_STATUS_CANT_ACCESS_DOMAIN_INFO;
index e2df0a1b6637ab237b773b804f21d4aeb3088ee4..aff730c1780f3556fe0202b8e1ff19718833e799 100644 (file)
@@ -39,7 +39,8 @@
 /**
   process command line options
 */
-struct ldb_cmdline *ldb_cmdline_process(struct ldb_context *ldb, int argc, const char **argv,
+struct ldb_cmdline *ldb_cmdline_process(struct ldb_context *ldb, 
+                                       int argc, const char **argv,
                                        void (*usage)(void))
 {
        static struct ldb_cmdline options; /* needs to be static for older compilers */
index 60bfb52e2d7da169e243ff80595dcf22ea34d37e..99b471e9a60c03fa62749155ea03dca4cc763bd3 100644 (file)
@@ -199,7 +199,8 @@ static struct ldap_message *new_ldap_sasl_bind_msg(struct ldap_connection *conn,
 /*
   perform a sasl bind using the given credentials
 */
-NTSTATUS ldap_bind_sasl(struct ldap_connection *conn, struct cli_credentials *creds)
+NTSTATUS ldap_bind_sasl(struct ldap_connection *conn, 
+                       struct cli_credentials *creds)
 {
        NTSTATUS status;
        TALLOC_CTX *tmp_ctx = NULL;
index e8b1632e732ea98a92be025fb343847687ea92da..0f8b86fddf840263a0fb7958f4d05849927c028a 100644 (file)
@@ -784,7 +784,8 @@ static void becomeDC_recv_cldap(struct cldap_request *req)
        becomeDC_connect_ldap1(s);
 }
 
-static NTSTATUS becomeDC_ldap_connect(struct libnet_BecomeDC_state *s, struct becomeDC_ldap *ldap)
+static NTSTATUS becomeDC_ldap_connect(struct libnet_BecomeDC_state *s, 
+                                     struct becomeDC_ldap *ldap)
 {
        char *url;
 
index b53f7866180bd7d1f1721651276ae0943030a077..ff827e50f2322e571ff45bcd303b31494c04569a 100644 (file)
@@ -177,6 +177,7 @@ struct dcerpc_pipe_connect {
        const char *pipe_name;
        const struct ndr_interface_table *interface;
        struct cli_credentials *creds;
+       const char **name_resolve_order;
 };
 
 
index 6c6441790b9bc8ead3f82b0668418e657c0d4516..4870b8d54aba8456fcfb330a89e4d39cedbf24fb 100644 (file)
@@ -205,8 +205,9 @@ static void continue_smb2_connect(struct composite_context *ctx)
    Initiate async open of a rpc connection request on SMB2 using
    the binding structure to determine the endpoint and options
 */
-static struct composite_context *dcerpc_pipe_connect_ncacn_np_smb2_send(TALLOC_CTX *mem_ctx,
-                                                                       struct dcerpc_pipe_connect *io)
+static struct composite_context *dcerpc_pipe_connect_ncacn_np_smb2_send(
+                                       TALLOC_CTX *mem_ctx,
+                                       struct dcerpc_pipe_connect *io)
 {
        struct composite_context *c;
        struct pipe_np_smb2_state *s;
@@ -235,7 +236,7 @@ static struct composite_context *dcerpc_pipe_connect_ncacn_np_smb2_send(TALLOC_C
 
        /* send smb2 connect request */
        conn_req = smb2_connect_send(mem_ctx, s->io.binding->host, "IPC$", 
-                                    lp_name_resolve_order(global_loadparm),
+                                    s->io.name_resolve_order,
                                     s->io.creds,
                                     c->event_ctx);
        composite_continue(c, conn_req, continue_smb2_connect, c);
@@ -518,6 +519,7 @@ static void continue_connect(struct composite_context *c, struct pipe_connect_st
        pc.binding      = s->binding;
        pc.interface    = s->table;
        pc.creds        = s->credentials;
+       pc.name_resolve_order = lp_name_resolve_order(global_loadparm);
 
        /* connect dcerpc pipe depending on required transport */
        switch (s->binding->transport) {