r25398: Parse loadparm context to all lp_*() functions.
authorJelmer Vernooij <jelmer@samba.org>
Fri, 28 Sep 2007 01:17:46 +0000 (01:17 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 20:07:25 +0000 (15:07 -0500)
164 files changed:
source/auth/auth.c
source/auth/auth_sam.c
source/auth/auth_unix.c
source/auth/auth_util.c
source/auth/credentials/credentials.c
source/auth/credentials/credentials.h
source/auth/gensec/gensec_gssapi.c
source/auth/gensec/gensec_krb5.c
source/auth/kerberos/krb5_init_context.c
source/auth/ntlm_check.c
source/auth/ntlmssp/ntlmssp.h
source/auth/ntlmssp/ntlmssp_client.c
source/auth/ntlmssp/ntlmssp_server.c
source/auth/sam.c
source/cldap_server/cldap_server.c
source/cldap_server/netlogon.c
source/client/cifsdd.c
source/client/client.c
source/client/smbmount.c
source/client/smbspool.c
source/dsdb/repl/drepl_service.c
source/dsdb/samdb/ldb_modules/update_keytab.c
source/dsdb/samdb/samdb.c
source/kdc/kdc.c
source/kdc/kpasswdd.c
source/ldap_server/ldap_backend.c
source/ldap_server/ldap_server.c
source/lib/cmdline/popt_common.c
source/lib/db_wrap.c
source/lib/registry/samba.c
source/lib/socket/connect.c
source/lib/socket/connect_multi.c
source/lib/socket/interface.c
source/lib/tls/tls.c
source/libcli/cldap/cldap.c
source/libcli/cliconnect.c
source/libcli/dgram/browse.c
source/libcli/dgram/mailslot.c
source/libcli/dgram/netlogon.c
source/libcli/dgram/ntlogon.c
source/libcli/finddcs.c
source/libcli/nbt/namequery.c
source/libcli/nbt/namerefresh.c
source/libcli/nbt/nameregister.c
source/libcli/nbt/namerelease.c
source/libcli/raw/clisocket.c
source/libcli/raw/clitransport.c
source/libcli/raw/clitree.c
source/libcli/raw/rawnegotiate.c
source/libcli/raw/smb_signing.c
source/libcli/resolve/resolve.c
source/libcli/resolve/wins.c
source/libcli/smb2/connect.c
source/libcli/smb_composite/connect.c
source/libcli/smb_composite/sesssetup.c
source/libcli/util/errormap.c
source/libnet/libnet.c
source/libnet/libnet_join.c
source/libnet/libnet_samdump_keytab.c
source/libnet/libnet_samsync_ldb.c
source/libnet/libnet_vampire.c
source/librpc/rpc/dcerpc_connect.c
source/librpc/rpc/dcerpc_sock.c
source/librpc/rpc/dcerpc_util.c
source/nbt_server/dgram/netlogon.c
source/nbt_server/dgram/ntlogon.c
source/nbt_server/dgram/request.c
source/nbt_server/interfaces.c
source/nbt_server/packet.c
source/nbt_server/query.c
source/nbt_server/register.c
source/nbt_server/wins/wins_hook.c
source/nbt_server/wins/winsclient.c
source/nbt_server/wins/winsdb.c
source/nbt_server/wins/winsserver.c
source/nsswitch/wbinfo.c
source/ntptr/simple_ldb/ntptr_simple_ldb.c
source/ntvfs/cifs/vfs_cifs.c
source/ntvfs/print/vfs_print.c
source/param/loadparm.c
source/param/secrets.c
source/param/share.c
source/param/util.c
source/rpc_server/common/server_info.c
source/rpc_server/dcerpc_server.c
source/rpc_server/dcesrv_auth.c
source/rpc_server/lsa/dcesrv_lsa.c
source/rpc_server/netlogon/dcerpc_netlogon.c
source/rpc_server/remote/dcesrv_remote.c
source/rpc_server/samr/dcesrv_samr.c
source/rpc_server/service_rpc.c
source/rpc_server/spoolss/dcesrv_spoolss.c
source/rpc_server/srvsvc/dcesrv_srvsvc.c
source/script/mkproto.pl
source/scripting/ejs/ejsnet/net_ctx.c
source/scripting/ejs/smbcalls.c
source/scripting/ejs/smbcalls_cli.c
source/scripting/ejs/smbcalls_config.c
source/scripting/ejs/smbcalls_creds.c
source/scripting/ejs/smbscript.c
source/smb_server/smb/negprot.c
source/smb_server/smb/receive.c
source/smb_server/smb/service.c
source/smb_server/smb/sesssetup.c
source/smb_server/smb/signing.c
source/smb_server/smb2/negprot.c
source/smb_server/smb2/receive.c
source/smb_server/smb_server.c
source/smbd/pidfile.c
source/smbd/server.c
source/smbd/service_stream.c
source/torture/basic/base.c
source/torture/basic/misc.c
source/torture/basic/secleak.c
source/torture/gentest.c
source/torture/libnet/domain.c
source/torture/libnet/groupinfo.c
source/torture/libnet/groupman.c
source/torture/libnet/libnet_BecomeDC.c
source/torture/libnet/libnet_domain.c
source/torture/libnet/libnet_group.c
source/torture/libnet/libnet_lookup.c
source/torture/libnet/libnet_rpc.c
source/torture/libnet/libnet_user.c
source/torture/libnet/userinfo.c
source/torture/libnet/userman.c
source/torture/locktest.c
source/torture/locktest2.c
source/torture/masktest.c
source/torture/nbt/dgram.c
source/torture/nbt/winsreplication.c
source/torture/raw/composite.c
source/torture/raw/context.c
source/torture/raw/lock.c
source/torture/raw/lockbench.c
source/torture/raw/openbench.c
source/torture/raw/samba3misc.c
source/torture/rpc/dssync.c
source/torture/rpc/netlogon.c
source/torture/rpc/samba3rpc.c
source/torture/rpc/samlogon.c
source/torture/rpc/samr_accessmask.c
source/torture/rpc/samsync.c
source/torture/rpc/schannel.c
source/torture/rpc/testjoin.c
source/torture/util_smb.c
source/torture/winbind/struct_based.c
source/utils/net/net_join.c
source/utils/ntlm_auth.c
source/utils/testparm.c
source/web_server/http.c
source/web_server/web_server.c
source/winbind/wb_cmd_getpwnam.c
source/winbind/wb_cmd_getpwuid.c
source/winbind/wb_dom_info.c
source/winbind/wb_dom_info_trusted.c
source/winbind/wb_init_domain.c
source/winbind/wb_pam_auth.c
source/winbind/wb_samba3_cmd.c
source/winbind/wb_server.c
source/winbind/wb_sid2domain.c
source/winbind/wb_utils.c
source/wrepl_server/wrepl_in_connection.c
source/wrepl_server/wrepl_server.c

index 1ad5332b28aaf80d1da1fa0ab83f4269dafd717f..04aa5f5c91dcaab50a426367dd4da052a564367c 100644 (file)
@@ -417,7 +417,7 @@ NTSTATUS auth_context_create(TALLOC_CTX *mem_ctx,
                             struct auth_context **auth_ctx)
 {
        const char **auth_methods = NULL;
-       switch (lp_server_role()) {
+       switch (lp_server_role(global_loadparm)) {
        case ROLE_STANDALONE:
                auth_methods = lp_parm_string_list(NULL, "auth methods", "standalone", NULL);
                break;
index e9b24d5f60bd23e002a2d54f2a559a5664e765b4..be8225f0dced66a35227acb14ead0216902dc6fe 100644 (file)
@@ -151,7 +151,7 @@ static NTSTATUS authsam_password_ok(struct auth_context *auth_context,
        NTSTATUS status;
 
        if (acct_flags & ACB_PWNOTREQ) {
-               if (lp_null_passwords()) {
+               if (lp_null_passwords(global_loadparm)) {
                        DEBUG(3,("Account for user '%s' has no password and null passwords are allowed.\n", 
                                 user_info->mapped.account_name));
                        return NT_STATUS_OK;
@@ -349,10 +349,10 @@ static NTSTATUS authsam_want_check(struct auth_method_context *ctx,
        }
 
        is_local_name = is_myname(user_info->mapped.domain_name);
-       is_my_domain  = strequal(user_info->mapped.domain_name, lp_workgroup());
+       is_my_domain  = strequal(user_info->mapped.domain_name, lp_workgroup(global_loadparm));
 
        /* check whether or not we service this domain/workgroup name */
-       switch (lp_server_role()) {
+       switch (lp_server_role(global_loadparm)) {
                case ROLE_STANDALONE:
                        return NT_STATUS_OK;
 
@@ -388,14 +388,14 @@ static NTSTATUS authsam_check_password(struct auth_method_context *ctx,
        const char *domain;
 
        /* check whether or not we service this domain/workgroup name */
-       switch (lp_server_role()) {
+       switch (lp_server_role(global_loadparm)) {
                case ROLE_STANDALONE:
                case ROLE_DOMAIN_MEMBER:
-                       domain = lp_netbios_name();
+                       domain = lp_netbios_name(global_loadparm);
                        break;
 
                case ROLE_DOMAIN_CONTROLLER:
-                       domain = lp_workgroup();
+                       domain = lp_workgroup(global_loadparm);
                        break;
 
                default:
index dd000e94459690ffc2d0a41b8e5a18a6427b24ca..bc2fddee064af32b6c78b00fcedda0f2eac9d7ea 100644 (file)
@@ -319,7 +319,7 @@ static NTSTATUS smb_pam_auth(pam_handle_t *pamh, const char *user)
        
        DEBUG(4,("smb_pam_auth: PAM: Authenticate User: %s\n", user));
 
-       pam_error = pam_authenticate(pamh, PAM_SILENT | lp_null_passwords() ? 0 : PAM_DISALLOW_NULL_AUTHTOK);
+       pam_error = pam_authenticate(pamh, PAM_SILENT | lp_null_passwords(global_loadparm) ? 0 : PAM_DISALLOW_NULL_AUTHTOK);
        switch( pam_error ){
                case PAM_AUTH_ERR:
                        DEBUG(2, ("smb_pam_auth: PAM: Authentication Error for user %s\n", user));
index 6597c79b848e1f949c927961cf3c1f95d451ff1b..69de01aefd883875f4f835c6defeb7309fe8f206 100644 (file)
@@ -73,7 +73,7 @@ NTSTATUS map_user_info(TALLOC_CTX *mem_ctx,
                d++;
                domain = d;
        } else {
-               domain = lp_workgroup();
+               domain = lp_workgroup(global_loadparm);
        }
 
        *user_info_mapped = talloc(mem_ctx, struct auth_usersupplied_info);
@@ -138,8 +138,8 @@ NTSTATUS map_user_info(TALLOC_CTX *mem_ctx,
                        }
                        
                        chall_blob = data_blob_talloc(mem_ctx, challenge, 8);
-                       if (lp_client_ntlmv2_auth()) {
-                               DATA_BLOB names_blob = NTLMv2_generate_names_blob(mem_ctx, lp_netbios_name(), lp_workgroup());
+                       if (lp_client_ntlmv2_auth(global_loadparm)) {
+                               DATA_BLOB names_blob = NTLMv2_generate_names_blob(mem_ctx, lp_netbios_name(global_loadparm), lp_workgroup(global_loadparm));
                                DATA_BLOB lmv2_response, ntlmv2_response, lmv2_session_key, ntlmv2_session_key;
                                
                                if (!SMBNTLMv2encrypt_hash(user_info_temp,
@@ -163,7 +163,7 @@ NTSTATUS map_user_info(TALLOC_CTX *mem_ctx,
                                SMBOWFencrypt(user_info_in->password.hash.nt->hash, challenge, blob.data);
 
                                user_info_temp->password.response.nt = blob;
-                               if (lp_client_lanman_auth() && user_info_in->password.hash.lanman) {
+                               if (lp_client_lanman_auth(global_loadparm) && user_info_in->password.hash.lanman) {
                                        DATA_BLOB lm_blob = data_blob_talloc(mem_ctx, NULL, 24);
                                        SMBOWFencrypt(user_info_in->password.hash.lanman->hash, challenge, blob.data);
                                        user_info_temp->password.response.lanman = lm_blob;
@@ -413,7 +413,7 @@ NTSTATUS auth_anonymous_server_info(TALLOC_CTX *mem_ctx, struct auth_serversuppl
        server_info->home_drive = talloc_strdup(server_info, "");
        NT_STATUS_HAVE_NO_MEMORY(server_info->home_drive);
 
-       server_info->logon_server = talloc_strdup(server_info, lp_netbios_name());
+       server_info->logon_server = talloc_strdup(server_info, lp_netbios_name(global_loadparm));
        NT_STATUS_HAVE_NO_MEMORY(server_info->logon_server);
 
        server_info->last_logon = 0;
@@ -483,7 +483,7 @@ NTSTATUS auth_system_server_info(TALLOC_CTX *mem_ctx, struct auth_serversupplied
        server_info->home_drive = talloc_strdup(server_info, "");
        NT_STATUS_HAVE_NO_MEMORY(server_info->home_drive);
 
-       server_info->logon_server = talloc_strdup(server_info, lp_netbios_name());
+       server_info->logon_server = talloc_strdup(server_info, lp_netbios_name(global_loadparm));
        NT_STATUS_HAVE_NO_MEMORY(server_info->logon_server);
 
        server_info->last_logon = 0;
@@ -562,7 +562,7 @@ NTSTATUS auth_anonymous_session_info(TALLOC_CTX *parent_ctx,
                return NT_STATUS_NO_MEMORY;
        }
 
-       cli_credentials_set_conf(session_info->credentials);
+       cli_credentials_set_conf(session_info->credentials, global_loadparm);
        cli_credentials_set_anonymous(session_info->credentials);
        
        *_session_info = session_info;
@@ -608,7 +608,7 @@ static NTSTATUS _auth_system_session_info(TALLOC_CTX *parent_ctx,
                return NT_STATUS_NO_MEMORY;
        }
 
-       cli_credentials_set_conf(session_info->credentials);
+       cli_credentials_set_conf(session_info->credentials, global_loadparm);
 
        if (anonymous_credentials) {
                cli_credentials_set_anonymous(session_info->credentials);
index 2899bc56052228ddefde251fc7c398cbf816eca3..e88e05cfb0f418e1162871dd4cde18f92a60aa14 100644 (file)
@@ -82,7 +82,7 @@ struct cli_credentials *cli_credentials_init_anon(TALLOC_CTX *mem_ctx)
        struct cli_credentials *anon_credentials;
 
        anon_credentials = cli_credentials_init(mem_ctx);
-       cli_credentials_set_conf(anon_credentials);
+       cli_credentials_set_conf(anon_credentials, global_loadparm);
        cli_credentials_set_anonymous(anon_credentials);
 
        return anon_credentials;
@@ -621,12 +621,13 @@ const char *cli_credentials_get_unparsed_name(struct cli_credentials *credential
  *
  * @param cred Credentials structure to fill in
  */
-void cli_credentials_set_conf(struct cli_credentials *cred)
+void cli_credentials_set_conf(struct cli_credentials *cred, 
+                             struct loadparm_context *lp_ctx)
 {
        cli_credentials_set_username(cred, "", CRED_UNINITIALISED);
-       cli_credentials_set_domain(cred, lp_workgroup(), CRED_UNINITIALISED);
-       cli_credentials_set_workstation(cred, lp_netbios_name(), CRED_UNINITIALISED);
-       cli_credentials_set_realm(cred, lp_realm(), CRED_UNINITIALISED);
+       cli_credentials_set_domain(cred, lp_workgroup(lp_ctx), CRED_UNINITIALISED);
+       cli_credentials_set_workstation(cred, lp_netbios_name(lp_ctx), CRED_UNINITIALISED);
+       cli_credentials_set_realm(cred, lp_realm(lp_ctx), CRED_UNINITIALISED);
 }
 
 /**
@@ -639,7 +640,7 @@ void cli_credentials_guess(struct cli_credentials *cred)
 {
        char *p;
 
-       cli_credentials_set_conf(cred);
+       cli_credentials_set_conf(cred, global_loadparm);
        
        if (getenv("LOGNAME")) {
                cli_credentials_set_username(cred, getenv("LOGNAME"), CRED_GUESS_ENV);
@@ -657,7 +658,8 @@ void cli_credentials_guess(struct cli_credentials *cred)
        }
 
        if (getenv("PASSWD_FD")) {
-               cli_credentials_parse_password_fd(cred, atoi(getenv("PASSWD_FD")), CRED_GUESS_FILE);
+               cli_credentials_parse_password_fd(cred, atoi(getenv("PASSWD_FD")), 
+                                                 CRED_GUESS_FILE);
        }
        
        p = getenv("PASSWD_FILE");
index 0fd9ce46be107ca629cd112657714a4e0288fd21..7ea37e40d15fbb2d165ffa85aa6546cc798e5b8f 100644 (file)
@@ -127,6 +127,7 @@ struct cli_credentials {
 };
 
 struct ldb_context;
+struct loadparm_context;
 #include "auth/credentials/credentials_proto.h"
 
 #endif /* __CREDENTIALS_H__ */
index 8a7e8090ebb726c5fd1659d0f4e97cd562905ce6..69e87cf555a48e6dc97da311f5c489fb8cd81c67 100644 (file)
@@ -213,10 +213,10 @@ static NTSTATUS gensec_gssapi_start(struct gensec_security *gensec_security)
                talloc_free(gensec_gssapi_state);
                return NT_STATUS_INTERNAL_ERROR;
        }
-       if (lp_realm() && *lp_realm()) {
-               char *upper_realm = strupper_talloc(gensec_gssapi_state, lp_realm());
+       if (lp_realm(global_loadparm) && *lp_realm(global_loadparm)) {
+               char *upper_realm = strupper_talloc(gensec_gssapi_state, lp_realm(global_loadparm));
                if (!upper_realm) {
-                       DEBUG(1,("gensec_krb5_start: could not uppercase realm: %s\n", lp_realm()));
+                       DEBUG(1,("gensec_krb5_start: could not uppercase realm: %s\n", lp_realm(global_loadparm)));
                        talloc_free(gensec_gssapi_state);
                        return NT_STATUS_NO_MEMORY;
                }
@@ -332,7 +332,7 @@ static NTSTATUS gensec_gssapi_client_start(struct gensec_security *gensec_securi
        gensec_gssapi_state->gss_oid = gss_mech_krb5;
 
        principal = gensec_get_target_principal(gensec_security);
-       if (principal && lp_client_use_spnego_principal()) {
+       if (principal && lp_client_use_spnego_principal(global_loadparm)) {
                name_type = GSS_C_NULL_OID;
        } else {
                principal = talloc_asprintf(gensec_gssapi_state, "%s@%s", 
@@ -1359,7 +1359,7 @@ static NTSTATUS gensec_gssapi_session_info(struct gensec_security *gensec_securi
                }
 
                cli_credentials_set_event_context(session_info->credentials, gensec_security->event_ctx);
-               cli_credentials_set_conf(session_info->credentials);
+               cli_credentials_set_conf(session_info->credentials, global_loadparm);
                /* Just so we don't segfault trying to get at a username */
                cli_credentials_set_anonymous(session_info->credentials);
                
index c0348441edf7f0e9629de07853bf0e1f0d6c00fe..66a463eef4c28c13e6d6c5fce7f06b0a04edc697 100644 (file)
@@ -261,7 +261,7 @@ static NTSTATUS gensec_krb5_client_start(struct gensec_security *gensec_security
        }
        in_data.length = 0;
        
-       if (principal && lp_client_use_spnego_principal()) {
+       if (principal && lp_client_use_spnego_principal(global_loadparm)) {
                krb5_principal target_principal;
                ret = krb5_parse_name(gensec_krb5_state->smb_krb5_context->krb5_context, principal,
                                      &target_principal);
index 06a80e44e48ce485e0c8febcd4fd1d7989b6a77b..6b3cf8cb37dd436e3c6ceff6225abd4b295491d8 100644 (file)
@@ -418,10 +418,10 @@ krb5_error_code smb_krb5_init_context(void *parent_ctx,
                return ret;
        }
                                                
-       if (lp_realm() && *lp_realm()) {
-               char *upper_realm = strupper_talloc(tmp_ctx, lp_realm());
+       if (lp_realm(global_loadparm) && *lp_realm(global_loadparm)) {
+               char *upper_realm = strupper_talloc(tmp_ctx, lp_realm(global_loadparm));
                if (!upper_realm) {
-                       DEBUG(1,("gensec_krb5_start: could not uppercase realm: %s\n", lp_realm()));
+                       DEBUG(1,("gensec_krb5_start: could not uppercase realm: %s\n", lp_realm(global_loadparm)));
                        talloc_free(tmp_ctx);
                        return ENOMEM;
                }
index d3dbc3ce663e37c3847deeb27c1ef9962ec6a9ff..51488ec882079d5469fe91d0e624c698f432e9ff 100644 (file)
@@ -240,7 +240,7 @@ NTSTATUS hash_password_check(TALLOC_CTX *mem_ctx,
                }
 
        } else if (client_lanman && stored_lanman) {
-               if (!lp_lanman_auth()) {
+               if (!lp_lanman_auth(global_loadparm)) {
                        DEBUG(3,("ntlm_password_check: Interactive logon: only LANMAN password supplied for user %s, and LM passwords are disabled!\n",
                                 username));
                        return NT_STATUS_WRONG_PASSWORD;
@@ -392,7 +392,7 @@ NTSTATUS ntlm_password_check(TALLOC_CTX *mem_ctx,
                        DEBUG(3,("ntlm_password_check: NTLMv2 password check failed\n"));
                }
        } else if (nt_response->length == 24 && stored_nt) {
-               if (lp_ntlm_auth()) {           
+               if (lp_ntlm_auth(global_loadparm)) {            
                        /* We have the NT MD4 hash challenge available - see if we can
                           use it (ie. does it exist in the smbpasswd file).
                        */
@@ -404,7 +404,7 @@ NTSTATUS ntlm_password_check(TALLOC_CTX *mem_ctx,
                                /* The LM session key for this response is not very secure, 
                                   so use it only if we otherwise allow LM authentication */
                                
-                               if (lp_lanman_auth() && stored_lanman) {
+                               if (lp_lanman_auth(global_loadparm) && stored_lanman) {
                                        *lm_sess_key = data_blob_talloc(mem_ctx, stored_lanman->hash, 8);
                                }
                                return NT_STATUS_OK;
@@ -432,7 +432,7 @@ NTSTATUS ntlm_password_check(TALLOC_CTX *mem_ctx,
                return NT_STATUS_WRONG_PASSWORD;
        }
                
-       if (!lp_lanman_auth()) {
+       if (!lp_lanman_auth(global_loadparm)) {
                DEBUG(3,("ntlm_password_check: Lanman passwords NOT PERMITTED for user %s\n",
                         username));
        } else if (!stored_lanman) {
@@ -451,7 +451,7 @@ NTSTATUS ntlm_password_check(TALLOC_CTX *mem_ctx,
                           It not very secure, so use it only if we otherwise 
                           allow LM authentication */
 
-                       if (lp_lanman_auth() && stored_lanman) {
+                       if (lp_lanman_auth(global_loadparm) && stored_lanman) {
                                uint8_t first_8_lm_hash[16];
                                memcpy(first_8_lm_hash, stored_lanman->hash, 8);
                                memset(first_8_lm_hash + 8, '\0', 8);
@@ -567,7 +567,7 @@ NTSTATUS ntlm_password_check(TALLOC_CTX *mem_ctx,
           - I think this is related to Win9X pass-though authentication
        */
        DEBUG(4,("ntlm_password_check: Checking NT MD4 password in LM field\n"));
-       if (lp_ntlm_auth()) {
+       if (lp_ntlm_auth(global_loadparm)) {
                if (smb_pwd_check_ntlmv1(mem_ctx, 
                                         lm_response, 
                                         stored_nt->hash, challenge,
@@ -576,7 +576,7 @@ NTSTATUS ntlm_password_check(TALLOC_CTX *mem_ctx,
                           It not very secure, so use it only if we otherwise 
                           allow LM authentication */
 
-                       if (lp_lanman_auth() && stored_lanman) {
+                       if (lp_lanman_auth(global_loadparm) && stored_lanman) {
                                uint8_t first_8_lm_hash[16];
                                memcpy(first_8_lm_hash, stored_lanman->hash, 8);
                                memset(first_8_lm_hash + 8, '\0', 8);
index 282fcbc51056e4ae3637247ae6670ce5976678cd..e39e2d9407a3e70d38fb2044e25fb3f58160819f 100644 (file)
@@ -93,7 +93,7 @@ struct gensec_ntlmssp_state
                                                  style 'challenge caching' */
 
        char *user;
-       char *domain;
+       const char *domain;
        const char *workstation;
        char *server_domain;
 
@@ -156,7 +156,6 @@ struct gensec_ntlmssp_state
                                   DATA_BLOB *nt_session_key, DATA_BLOB *lm_session_key);
 
        const char *server_name;
-       const char *(*get_domain)(void);
 
        bool doing_ntlm2; 
 
index d2f28a394c87a79e5ac49559a41a2c44926e6d58..f988facb608ef4f3f7c36b01c5e93f50ee91e5a5 100644 (file)
@@ -66,7 +66,7 @@ NTSTATUS ntlmssp_client_initial(struct gensec_security *gensec_security,
                  "NTLMSSP",
                  NTLMSSP_NEGOTIATE,
                  gensec_ntlmssp_state->neg_flags,
-                 gensec_ntlmssp_state->get_domain()
+                 gensec_ntlmssp_state->domain
                  cli_credentials_get_workstation(gensec_security->credentials));
 
        gensec_ntlmssp_state->expected_state = NTLMSSP_CHALLENGE;
@@ -181,7 +181,7 @@ NTSTATUS ntlmssp_client_challenge(struct gensec_security *gensec_security,
        if (gensec_ntlmssp_state->use_nt_response) {
                flags |= CLI_CRED_NTLM_AUTH;
        }
-       if (lp_client_lanman_auth()) {
+       if (lp_client_lanman_auth(global_loadparm)) {
                flags |= CLI_CRED_LANMAN_AUTH;
        }
 
@@ -206,7 +206,7 @@ NTSTATUS ntlmssp_client_challenge(struct gensec_security *gensec_security,
        }
        
        if ((gensec_ntlmssp_state->neg_flags & NTLMSSP_NEGOTIATE_LM_KEY) 
-           && lp_client_lanman_auth() && lm_session_key.length == 16) {
+           && lp_client_lanman_auth(global_loadparm) && lm_session_key.length == 16) {
                DATA_BLOB new_session_key = data_blob_talloc(mem_ctx, NULL, 16);
                if (lm_response.length == 24) {
                        SMBsesskeygen_lm_sess_key(lm_session_key.data, lm_response.data, 
@@ -297,17 +297,17 @@ NTSTATUS gensec_ntlmssp_client_start(struct gensec_security *gensec_security)
 
        gensec_ntlmssp_state->role = NTLMSSP_CLIENT;
 
-       gensec_ntlmssp_state->get_domain = lp_workgroup;
+       gensec_ntlmssp_state->domain = lp_workgroup(global_loadparm);
 
        gensec_ntlmssp_state->unicode = lp_parm_bool(NULL, "ntlmssp_client", "unicode", true);
 
        gensec_ntlmssp_state->use_nt_response = lp_parm_bool(NULL, "ntlmssp_client", "send_nt_reponse", true);
 
-       gensec_ntlmssp_state->allow_lm_key = (lp_client_lanman_auth() 
+       gensec_ntlmssp_state->allow_lm_key = (lp_client_lanman_auth(global_loadparm
                                              && (lp_parm_bool(NULL, "ntlmssp_client", "allow_lm_key", false)
                                                  || lp_parm_bool(NULL, "ntlmssp_client", "lm_key", false)));
 
-       gensec_ntlmssp_state->use_ntlmv2 = lp_client_ntlmv2_auth();
+       gensec_ntlmssp_state->use_ntlmv2 = lp_client_ntlmv2_auth(global_loadparm);
 
        gensec_ntlmssp_state->expected_state = NTLMSSP_INITIAL;
 
index 954c9ea2ac8339b37556f0bb5167b893e0b3ad5a..dcef5035cbbeccf938347c1dc17d105385370195 100644 (file)
@@ -98,7 +98,7 @@ static const char *ntlmssp_target_name(struct gensec_ntlmssp_state *gensec_ntlms
                        return gensec_ntlmssp_state->server_name;
                } else {
                        *chal_flags |= NTLMSSP_TARGET_TYPE_DOMAIN;
-                       return gensec_ntlmssp_state->get_domain();
+                       return gensec_ntlmssp_state->domain;
                };
        } else {
                return "";
@@ -744,13 +744,13 @@ NTSTATUS gensec_ntlmssp_server_start(struct gensec_security *gensec_security)
        gensec_ntlmssp_state->role = NTLMSSP_SERVER;
 
        gensec_ntlmssp_state->workstation = NULL;
-       gensec_ntlmssp_state->server_name = lp_netbios_name();
+       gensec_ntlmssp_state->server_name = lp_netbios_name(global_loadparm);
 
-       gensec_ntlmssp_state->get_domain = lp_workgroup;
+       gensec_ntlmssp_state->domain = lp_workgroup(global_loadparm);
 
        gensec_ntlmssp_state->expected_state = NTLMSSP_NEGOTIATE;
 
-       gensec_ntlmssp_state->allow_lm_key = (lp_lanman_auth() 
+       gensec_ntlmssp_state->allow_lm_key = (lp_lanman_auth(global_loadparm
                                          && lp_parm_bool(NULL, "ntlmssp_server", "allow_lm_key", false));
 
        gensec_ntlmssp_state->server_multiple_authentications = False;
@@ -799,7 +799,7 @@ NTSTATUS gensec_ntlmssp_server_start(struct gensec_security *gensec_security)
        gensec_ntlmssp_state->may_set_challenge = auth_ntlmssp_may_set_challenge;
        gensec_ntlmssp_state->set_challenge = auth_ntlmssp_set_challenge;
        gensec_ntlmssp_state->check_password = auth_ntlmssp_check_password;
-       gensec_ntlmssp_state->server_role = lp_server_role();
+       gensec_ntlmssp_state->server_role = lp_server_role(global_loadparm);
 
        return NT_STATUS_OK;
 }
index ed01c0bd9356621c2f1625f3d584eccbc19ef8f3..ec019b3fe60c0c23870b567372a7d203cc9babff 100644 (file)
@@ -344,7 +344,7 @@ _PUBLIC_ NTSTATUS authsam_make_server_info(TALLOC_CTX *mem_ctx, struct ldb_conte
        server_info->home_drive = talloc_strdup(server_info, str);
        NT_STATUS_HAVE_NO_MEMORY(server_info->home_drive);
 
-       server_info->logon_server = talloc_strdup(server_info, lp_netbios_name());
+       server_info->logon_server = talloc_strdup(server_info, lp_netbios_name(global_loadparm));
        NT_STATUS_HAVE_NO_MEMORY(server_info->logon_server);
 
        server_info->last_logon = samdb_result_nttime(msg, "lastLogon", 0);
index fbf6f786dbac3b3a8654218e7662df9cd1d356e4..466444ace81b0e420930212c42f087b57aa01454 100644 (file)
@@ -95,7 +95,7 @@ static NTSTATUS cldapd_add_socket(struct cldapd_server *cldapd, const char *addr
        NT_STATUS_HAVE_NO_MEMORY(cldapsock);
 
        socket_address = socket_address_from_strings(cldapsock, cldapsock->sock->backend_name, 
-                                                    address, lp_cldap_port());
+                                                    address, lp_cldap_port(global_loadparm));
        if (!socket_address) {
                talloc_free(cldapsock);
                return NT_STATUS_NO_MEMORY;
@@ -104,7 +104,7 @@ static NTSTATUS cldapd_add_socket(struct cldapd_server *cldapd, const char *addr
        status = socket_listen(cldapsock->sock, socket_address, 0, 0);
        if (!NT_STATUS_IS_OK(status)) {
                DEBUG(0,("Failed to bind to %s:%d - %s\n", 
-                        address, lp_cldap_port(), nt_errstr(status)));
+                        address, lp_cldap_port(global_loadparm), nt_errstr(status)));
                talloc_free(cldapsock);
                return status;
        }
@@ -128,7 +128,7 @@ static NTSTATUS cldapd_startup_interfaces(struct cldapd_server *cldapd)
 
        /* if we are allowing incoming packets from any address, then
           we need to bind to the wildcard address */
-       if (!lp_bind_interfaces_only()) {
+       if (!lp_bind_interfaces_only(global_loadparm)) {
                status = cldapd_add_socket(cldapd, "0.0.0.0");
                NT_STATUS_NOT_OK_RETURN(status);
        } else {
index 5eef4de4cdfc301a602428a64f3c5a7475ac0eaf..6b398a4144ed51a5ed0f247df67ccc06da296ed2 100644 (file)
@@ -51,7 +51,7 @@ static NTSTATUS cldapd_netlogon_fill(struct cldapd_server *cldapd,
        const char *dom_attrs[] = {"objectGUID", NULL};
        struct ldb_message **ref_res, **dom_res;
        int ret, count = 0;
-       const char **services = lp_server_services();
+       const char **services = lp_server_services(global_loadparm);
        uint32_t server_type;
        const char *pdc_name;
        struct GUID domain_uuid;
@@ -136,15 +136,17 @@ static NTSTATUS cldapd_netlogon_fill(struct cldapd_server *cldapd,
                server_type |= NBT_SERVER_KDC;
        }
 
-       pdc_name         = talloc_asprintf(mem_ctx, "\\\\%s", lp_netbios_name());
+       pdc_name         = talloc_asprintf(mem_ctx, "\\\\%s", lp_netbios_name(global_loadparm));
        domain_uuid      = samdb_result_guid(dom_res[0], "objectGUID");
-       realm            = samdb_result_string(ref_res[0], "dnsRoot", lp_realm());
-       dns_domain       = samdb_result_string(ref_res[0], "dnsRoot", lp_realm());
+       realm            = samdb_result_string(ref_res[0], "dnsRoot", lp_realm(global_loadparm));
+       dns_domain       = samdb_result_string(ref_res[0], "dnsRoot", lp_realm(global_loadparm));
        pdc_dns_name     = talloc_asprintf(mem_ctx, "%s.%s", 
-                                          strlower_talloc(mem_ctx, lp_netbios_name()), 
+                                          strlower_talloc(mem_ctx, 
+                                                          lp_netbios_name(global_loadparm)), 
                                           dns_domain);
 
-       flatname         = samdb_result_string(ref_res[0], "nETBIOSName", lp_workgroup());
+       flatname         = samdb_result_string(ref_res[0], "nETBIOSName", 
+                                              lp_workgroup(global_loadparm));
        server_site      = "Default-First-Site-Name";
        client_site      = "Default-First-Site-Name";
        pdc_ip           = iface_best_ip(src_address);
@@ -188,7 +190,7 @@ static NTSTATUS cldapd_netlogon_fill(struct cldapd_server *cldapd,
                netlogon->logon5.dns_domain   = dns_domain;
                netlogon->logon5.pdc_dns_name = pdc_dns_name;
                netlogon->logon5.domain       = flatname;
-               netlogon->logon5.pdc_name     = lp_netbios_name();
+               netlogon->logon5.pdc_name     = lp_netbios_name(global_loadparm);
                netlogon->logon5.user_name    = user;
                netlogon->logon5.server_site  = server_site;
                netlogon->logon5.client_site  = client_site;
@@ -203,7 +205,7 @@ static NTSTATUS cldapd_netlogon_fill(struct cldapd_server *cldapd,
                netlogon->logon13.dns_domain   = dns_domain;
                netlogon->logon13.pdc_dns_name = pdc_dns_name;
                netlogon->logon13.domain       = flatname;
-               netlogon->logon13.pdc_name     = lp_netbios_name();
+               netlogon->logon13.pdc_name     = lp_netbios_name(global_loadparm);
                netlogon->logon13.user_name    = user;
                netlogon->logon13.server_site  = server_site;
                netlogon->logon13.client_site  = client_site;
@@ -287,7 +289,7 @@ void cldapd_netlogon_request(struct cldap_socket *cldap,
        }
 
        if (domain_guid == NULL && domain == NULL) {
-               domain = lp_realm();
+               domain = lp_realm(global_loadparm);
        }
 
        if (version == -1) {
index cb42e992ce0698dba0545dd5bf9c4017b77659b4..b4407a7902f180913f11a4d733c00e859846e409 100644 (file)
@@ -429,7 +429,7 @@ static int copy_files(void)
        set_max_xmit(MAX(ibs, obs));
 
        DEBUG(4, ("IO buffer size is %llu, max xmit is %d\n",
-                       (unsigned long long)iomax, lp_max_xmit()));
+                       (unsigned long long)iomax, lp_max_xmit(global_loadparm)));
 
        if (!(ifile = open_file("if"))) {
                return(FILESYS_EXIT_CODE);
@@ -443,7 +443,7 @@ static int copy_files(void)
        ifile->io_seek(ifile, check_arg_numeric("skip") * ibs);
        ofile->io_seek(ofile, check_arg_numeric("seek") * obs);
 
-       DEBUG(4, ("max xmit was negotiated to be %d\n", lp_max_xmit()));
+       DEBUG(4, ("max xmit was negotiated to be %d\n", lp_max_xmit(global_loadparm)));
 
        for (data_size = 0;;) {
 
index f63315a05bb853e75bfe041938a69ae6236f9de3..60030a1d27d2ed283a4c1be26c193bd72cbe1338 100644 (file)
@@ -3072,7 +3072,7 @@ static int do_message_op(const char *desthost, const char *destip, int name_type
        const char *server_name;
        struct smbcli_state *cli;
 
-       make_nbt_name_client(&calling, lp_netbios_name());
+       make_nbt_name_client(&calling, lp_netbios_name(global_loadparm));
 
        nbt_choose_called_name(NULL, &called, desthost, name_type);
 
@@ -3219,7 +3219,7 @@ static int do_message_op(const char *desthost, const char *destip, int name_type
        }
   
        if (query_host) {
-               return do_host_query(query_host, lp_workgroup());
+               return do_host_query(query_host, lp_workgroup(global_loadparm));
        }
 
        if (message) {
index 7bd42b84cff98e06aedea53e90844008c249a220..9d505be4a682e027b34d0c9cb7932e807be716f4 100644 (file)
@@ -893,7 +893,7 @@ static void parse_mount_smb(int argc, char **argv)
                pstrcpy(username,getenv("LOGNAME"));
        }
 
-       if (!lp_load()) {
+       if (!lp_load(dyn_CONFIGFILE)) {
                fprintf(stderr, "Can't load %s - run testparm to debug it\n", 
                        lp_config_file());
        }
index 45407b1accffa192d6cba699dfab1d4df0f8195a..72709420371f7c4da5a631f3b6438f27fc2ef71c 100644 (file)
@@ -176,7 +176,7 @@ static int          smb_print(struct smbcli_state *, char *, FILE *);
 
   setup_logging(argv[0], DEBUG_STDOUT);
 
-  if (!lp_load()) {
+  if (!lp_load(dyn_CONFIGFILE)) {
          fprintf(stderr, "ERROR: Can't load %s - run testparm to debug it\n", lp_config_file());
          return (1);
   }
index 2896050ddc70c6f62c84e49a7c9527472ad19f10..f4ee5445f976ec4595f1c8751efbfe8ff9ca6b62 100644 (file)
@@ -118,7 +118,7 @@ static void dreplsrv_task_init(struct task_server *task)
        struct dreplsrv_service *service;
        uint32_t periodic_startup_interval;
 
-       switch (lp_server_role()) {
+       switch (lp_server_role(global_loadparm)) {
        case ROLE_STANDALONE:
                task_server_terminate(task, "dreplsrv: no DSDB replication required in standalone configuration");
                return;
index 8fb1a0a25f270a57645c488b38710c3c81492b5f..27b50a453a738de85a255640926be2e48b1a2c32 100644 (file)
@@ -32,6 +32,7 @@
 #include "auth/credentials/credentials.h"
 #include "auth/credentials/credentials_krb5.h"
 #include "system/kerberos.h"
+#include "param/param.h"
 
 struct dn_list {
        struct cli_credentials *creds;
@@ -88,7 +89,7 @@ static int add_modified(struct ldb_module *module, struct ldb_dn *dn, BOOL delet
                return LDB_ERR_OPERATIONS_ERROR;
        }
 
-       cli_credentials_set_conf(item->creds);
+       cli_credentials_set_conf(item->creds, global_loadparm);
        status = cli_credentials_set_secrets(item->creds, module->ldb, NULL, filter);
        talloc_free(filter);
        if (NT_STATUS_IS_OK(status)) {
index 01c311b1dc87105cec138be12cb66adf5be965d9..38be2825ea56bcd9a0ad07eedc9bd9be145bce90 100644 (file)
@@ -45,7 +45,7 @@ struct ldb_context *samdb_connect(TALLOC_CTX *mem_ctx,
                                  struct auth_session_info *session_info)
 {
        struct ldb_context *ldb;
-       ldb = ldb_wrap_connect(mem_ctx, lp_sam_url(), session_info,
+       ldb = ldb_wrap_connect(mem_ctx, lp_sam_url(global_loadparm), session_info,
                               NULL, 0, NULL);
        if (!ldb) {
                return NULL;
index b3d5ccdb5e6ef263e9240def585bfd06e6606a49..04540e3ef1b9449aadb65b1049ea6faf32752102 100644 (file)
@@ -526,8 +526,8 @@ static NTSTATUS kdc_startup_interfaces(struct kdc_server *kdc)
        
        for (i=0; i<num_interfaces; i++) {
                const char *address = talloc_strdup(tmp_ctx, iface_n_ip(i));
-               status = kdc_add_socket(kdc, address, lp_krb5_port(), 
-                                       lp_kpasswd_port());
+               status = kdc_add_socket(kdc, address, lp_krb5_port(global_loadparm), 
+                                       lp_kpasswd_port(global_loadparm));
                NT_STATUS_NOT_OK_RETURN(status);
        }
 
@@ -555,7 +555,7 @@ static void kdc_task_init(struct task_server *task)
        NTSTATUS status;
        krb5_error_code ret;
 
-       switch (lp_server_role()) {
+       switch (lp_server_role(global_loadparm)) {
        case ROLE_STANDALONE:
                task_server_terminate(task, "kdc: no KDC required in standalone configuration");
                return;
index 7c26675713802bd093fca4b53cb14816cb6856b3..b4608c5983b1537f72acb7e97cc25bbbf6366083 100644 (file)
@@ -38,6 +38,7 @@
 #include "rpc_server/dcerpc_server.h"
 #include "rpc_server/samr/proto.h"
 #include "libcli/security/security.h"
+#include "param/param.h"
 
 /* hold information about one kdc socket */
 struct kpasswd_socket {
@@ -472,7 +473,7 @@ BOOL kpasswdd_process(struct kdc_server *kdc,
        /* We want the credentials subsystem to use the krb5 context
         * we already have, rather than a new context */        
        cli_credentials_set_krb5_context(server_credentials, kdc->smb_krb5_context);
-       cli_credentials_set_conf(server_credentials);
+       cli_credentials_set_conf(server_credentials, global_loadparm);
        nt_status = cli_credentials_set_stored_principal(server_credentials, "kadmin/changepw");
        if (!NT_STATUS_IS_OK(nt_status)) {
                ret = kpasswdd_make_unauth_error_reply(kdc, mem_ctx, 
index 5afcf8cd12595e9191a4524afd333bac6d7a4196..e81c5bf445e05c9bb0c8ac9a2a71bef8b8029f3d 100644 (file)
@@ -55,7 +55,7 @@ static int map_ldb_error(struct ldb_context *ldb, int err, const char **errstrin
 */
 NTSTATUS ldapsrv_backend_Init(struct ldapsrv_connection *conn) 
 {
-       conn->ldb = ldb_wrap_connect(conn, lp_sam_url(), conn->session_info,
+       conn->ldb = ldb_wrap_connect(conn, lp_sam_url(global_loadparm), conn->session_info,
                                     NULL, conn->global_catalog ? LDB_FLG_RDONLY : 0, NULL);
        if (conn->ldb == NULL) {
                return NT_STATUS_INTERNAL_DB_CORRUPTION;
index f2ffc401cbfc8251af21b0bcb9fa971ba5ef8011..8522c59de477884b5d8552cf70d2f344b70c54a2 100644 (file)
@@ -396,7 +396,7 @@ static void ldapsrv_accept(struct stream_connection *c)
                return;
        }
        
-       cli_credentials_set_conf(server_credentials);
+       cli_credentials_set_conf(server_credentials, global_loadparm);
        status = cli_credentials_set_machine_account(server_credentials);
        if (!NT_STATUS_IS_OK(status)) {
                stream_terminate_connection(c, talloc_asprintf(conn, "Failed to obtain server credentials, perhaps a standalone server?: %s\n", nt_errstr(status)));
@@ -513,7 +513,7 @@ static void ldapsrv_task_init(struct task_server *task)
        NTSTATUS status;
        const struct model_ops *model_ops;
 
-       switch (lp_server_role()) {
+       switch (lp_server_role(global_loadparm)) {
        case ROLE_STANDALONE:
                task_server_terminate(task, "ldap_server: no LDAP server required in standalone configuration");
                return;
@@ -537,7 +537,7 @@ static void ldapsrv_task_init(struct task_server *task)
        ldap_service->tls_params = tls_initialise(ldap_service);
        if (ldap_service->tls_params == NULL) goto failed;
 
-       if (lp_interfaces() && lp_bind_interfaces_only()) {
+       if (lp_interfaces(global_loadparm) && lp_bind_interfaces_only(global_loadparm)) {
                int num_interfaces = iface_count();
                int i;
 
@@ -552,7 +552,7 @@ static void ldapsrv_task_init(struct task_server *task)
                }
        } else {
                status = add_socket(task->event_ctx, model_ops, 
-                                   lp_socket_address(), ldap_service);
+                                   lp_socket_address(global_loadparm), ldap_service);
                if (!NT_STATUS_IS_OK(status)) goto failed;
        }
 
index 6e0573e7ef154c114a2c068acc994a733fc86293..41eb70094ecea482cfde4277c4b896acdb9dfb08 100644 (file)
@@ -23,6 +23,7 @@
 #include "version.h"
 #include "lib/cmdline/popt_common.h"
 #include "param/param.h"
+#include "dynconfig.h"
 
 /* Handle command line options:
  *             -d,--debuglevel 
@@ -40,8 +41,6 @@ enum {OPT_OPTION=1,OPT_LEAK_REPORT,OPT_LEAK_REPORT_FULL,OPT_DEBUG_STDERR};
 
 struct cli_credentials *cmdline_credentials = NULL;
 
-static bool PrintSambaVersionString;
-
 static void popt_common_callback(poptContext con, 
                           enum poptCallbackReason reason,
                           const struct poptOption *opt,
@@ -50,12 +49,12 @@ static void popt_common_callback(poptContext con,
        const char *pname;
 
        if (reason == POPT_CALLBACK_REASON_POST) {
-               if (PrintSambaVersionString) {
-                       printf( "Version %s\n", SAMBA_VERSION_STRING );
-                       exit(0);
+               if (!lp_loaded()) {
+                       if (getenv("SMB_CONF_PATH"))
+                               lp_load(getenv("SMB_CONF_PATH"));
+                       else
+                               lp_load(dyn_CONFIGFILE);
                }
-
-               lp_load();
                /* Hook any 'every Samba program must do this, after
                 * the smb.conf is setup' functions here */
                return;
@@ -77,9 +76,6 @@ static void popt_common_callback(poptContext con,
                /* and logging */
                setup_logging(pname, DEBUG_STDOUT);
 
-               if (getenv("SMB_CONF_PATH")) {
-                       lp_set_cmdline(global_loadparm, "config file", getenv("SMB_CONF_PATH"));
-               }
                return;
        }
 
@@ -93,8 +89,8 @@ static void popt_common_callback(poptContext con,
                break;
 
        case 'V':
-               PrintSambaVersionString = true;
-               break;
+               printf("Version %s\n", SAMBA_VERSION_STRING );
+               exit(0);
 
        case 'O':
                if (arg) {
@@ -104,7 +100,7 @@ static void popt_common_callback(poptContext con,
 
        case 's':
                if (arg) {
-                       lp_set_cmdline(global_loadparm, "config file", arg);
+                       lp_load(arg);
                }
                break;
 
index 92e4758f44e46133205bd12a6073e69fbae457bd..82521f2e7eada29f3aae8010277546a353a228e7 100644 (file)
@@ -121,7 +121,7 @@ struct ldb_context *ldb_wrap_connect(TALLOC_CTX *mem_ctx,
        }
 
        ldb_set_modules_dir(ldb, 
-                           talloc_asprintf(ldb, "%s/ldb", lp_modulesdir()));
+                           talloc_asprintf(ldb, "%s/ldb", lp_modulesdir(global_loadparm)));
 
        /* we want to use the existing event context if possible. This
           relies on the fact that in smbd, everything is a child of
@@ -143,7 +143,7 @@ struct ldb_context *ldb_wrap_connect(TALLOC_CTX *mem_ctx,
                return NULL;
        }
        
-       if (strcmp(lp_sam_url(), url) == 0) {
+       if (strcmp(lp_sam_url(global_loadparm), url) == 0) {
                dsdb_set_global_schema(ldb);
        }
 
index dfb69abb3385f8d30261d73a271b620874572a89..48eb043306879074913a947493ff4dcfaa4b0168 100644 (file)
@@ -35,7 +35,7 @@ static WERROR mount_samba_hive(struct registry_context *ctx,
        struct hive_key *hive;
        const char *location;
 
-       location = talloc_asprintf(ctx, "%s/%s.ldb", lp_private_dir(), name);
+       location = talloc_asprintf(ctx, "%s/%s.ldb", lp_private_dir(global_loadparm), name);
 
 
        error = reg_open_hive(ctx, location, auth_info, creds, &hive);
index fe8bc5cf13244ee4e0070f04c524f62e0c1861ca..eca2067df163b1fe2664eeaa910a76664ffd512f 100644 (file)
@@ -127,7 +127,7 @@ struct composite_context *socket_connect_send(struct socket_context *sock,
                struct composite_context *creq;
                make_nbt_name_client(&name, server_address->addr);
                creq = resolve_name_send(&name, result->event_ctx,
-                                        lp_name_resolve_order());
+                                        lp_name_resolve_order(global_loadparm));
                if (composite_nomem(creq, result)) return result;
                composite_continue(result, creq, continue_resolve_name, result);
                return result;
index 445a1da7825f9e9835fae02a5a8be212ce6598fd..6d301414590e0391b7c709c46d3b43af6b2c7d62 100644 (file)
@@ -104,7 +104,7 @@ _PUBLIC_ struct composite_context *socket_connect_multi_send(
                struct composite_context *creq;
                make_nbt_name_client(&name, server_address);
                creq = resolve_name_send(&name, result->event_ctx,
-                                        lp_name_resolve_order());
+                                        lp_name_resolve_order(global_loadparm));
                if (composite_nomem(creq, result)) goto failed;
                composite_continue(result, creq, continue_resolve_name, result);
                return result;
index 992476fe2234c50821549f216545a342f9dc8c25..a30e4b8af7532d0129a3dd09bb1fd46af79e28f3 100644 (file)
@@ -200,7 +200,7 @@ static void load_interfaces(void)
                return;
        }
 
-       ptr = lp_interfaces();
+       ptr = lp_interfaces(global_loadparm);
        loopback_ip = interpret_addr2("127.0.0.1");
 
        /* probe the kernel for interfaces */
index 71b120dc3c42a7d331e664309be415a950cbb6e8..8be818433dc23d760815744344b9a2620e538c17 100644 (file)
@@ -357,11 +357,11 @@ struct tls_params *tls_initialise(TALLOC_CTX *mem_ctx)
        struct tls_params *params;
        int ret;
        TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx);
-       const char *keyfile = private_path(tmp_ctx, lp_tls_keyfile());
-       const char *certfile = private_path(tmp_ctx, lp_tls_certfile());
-       const char *cafile = private_path(tmp_ctx, lp_tls_cafile());
-       const char *crlfile = private_path(tmp_ctx, lp_tls_crlfile());
-       const char *dhpfile = private_path(tmp_ctx, lp_tls_dhpfile());
+       const char *keyfile = private_path(tmp_ctx, lp_tls_keyfile(global_loadparm));
+       const char *certfile = private_path(tmp_ctx, lp_tls_certfile(global_loadparm));
+       const char *cafile = private_path(tmp_ctx, lp_tls_cafile(global_loadparm));
+       const char *crlfile = private_path(tmp_ctx, lp_tls_crlfile(global_loadparm));
+       const char *dhpfile = private_path(tmp_ctx, lp_tls_dhpfile(global_loadparm));
        void tls_cert_generate(TALLOC_CTX *, const char *, const char *, const char *);
 
        params = talloc(mem_ctx, struct tls_params);
@@ -370,7 +370,7 @@ struct tls_params *tls_initialise(TALLOC_CTX *mem_ctx)
                return NULL;
        }
 
-       if (!lp_tls_enabled() || keyfile == NULL || *keyfile == 0) {
+       if (!lp_tls_enabled(global_loadparm) || keyfile == NULL || *keyfile == 0) {
                params->tls_enabled = False;
                talloc_free(tmp_ctx);
                return params;
@@ -565,7 +565,7 @@ struct socket_context *tls_init_client(struct socket_context *socket,
        }
        new_sock->private_data    = tls;
 
-       cafile = private_path(tls, lp_tls_cafile());
+       cafile = private_path(tls, lp_tls_cafile(global_loadparm));
        if (!cafile || !*cafile) {
                goto failed;
        }
index 9381e80934dc3dd72406c2c5fb67af2aed1ac356..8ef511ed79ed6f9e433eb657644dc1955cf7d6b6 100644 (file)
@@ -317,7 +317,7 @@ struct cldap_request *cldap_search_send(struct cldap_socket *cldap,
 
        req->dest = socket_address_from_strings(req, cldap->sock->backend_name,
                                                io->in.dest_address, 
-                                               lp_cldap_port());
+                                               lp_cldap_port(global_loadparm));
        if (!req->dest) goto failed;
 
        req->message_id = idr_get_new_random(cldap->idr, req, UINT16_MAX);
index a91157cf5dc8d9c8cd97fb06b1f02282d1fe4629..715eb875fee0045fa6ad0d9bee2018cb3063b941 100644 (file)
@@ -57,7 +57,7 @@ BOOL smbcli_transport_establish(struct smbcli_state *cli,
 /* wrapper around smb_raw_negotiate() */
 NTSTATUS smbcli_negprot(struct smbcli_state *cli)
 {
-       return smb_raw_negotiate(cli->transport, lp_cli_maxprotocol());
+       return smb_raw_negotiate(cli->transport, lp_cli_maxprotocol(global_loadparm));
 }
 
 /* wrapper around smb_raw_sesssetup() */
@@ -73,7 +73,7 @@ NTSTATUS smbcli_session_setup(struct smbcli_state *cli,
        setup.in.sesskey = cli->transport->negotiate.sesskey;
        setup.in.capabilities = cli->transport->negotiate.capabilities;
        setup.in.credentials = credentials;
-       setup.in.workgroup = lp_workgroup();
+       setup.in.workgroup = lp_workgroup(global_loadparm);
 
        status = smb_composite_sesssetup(cli->session, &setup);
 
index 78bd4319ee08df551eb47d12ef9ec3dbabb35a9c..fc1162e6446cadaff5852f38b71c3038a0fb503b 100644 (file)
@@ -70,7 +70,7 @@ NTSTATUS dgram_mailslot_browse_reply(struct nbt_dgram_socket *dgmsock,
                return status;
        }
 
-       make_nbt_name_client(&myname, lp_netbios_name());
+       make_nbt_name_client(&myname, lp_netbios_name(global_loadparm));
 
        dest = socket_address_from_strings(tmp_ctx, dgmsock->sock->backend_name, 
                                           request->src_addr, request->src_port);
index 7a325ebe38d1d32956783015a60c4fd555c1010a..4e94e5ee5bcfababd7cbc6e218ae320182d79811 100644 (file)
@@ -165,7 +165,7 @@ NTSTATUS dgram_mailslot_send(struct nbt_dgram_socket *dgmsock,
 
        if (_dest->port == 0) {
                dest = socket_address_from_strings(tmp_ctx, _dest->family, 
-                                                  _dest->addr, lp_dgram_port());
+                                                  _dest->addr, lp_dgram_port(global_loadparm));
        } else {
                dest = _dest;
        }
index 79acf609f61469e0c1bc9513472bcb54648986e3..46f6e50e7ba017bcdf9949b3eecfb4184a92fce0 100644 (file)
@@ -77,7 +77,7 @@ NTSTATUS dgram_mailslot_netlogon_reply(struct nbt_dgram_socket *dgmsock,
                return status;
        }
 
-       make_nbt_name_client(&myname, lp_netbios_name());
+       make_nbt_name_client(&myname, lp_netbios_name(global_loadparm));
 
        dest = socket_address_from_strings(tmp_ctx, dgmsock->sock->backend_name, 
                                           request->src_addr, request->src_port);
index 6b9b17485dec7f13c026130bf16310a5e30a71c8..25f767688a70e2b04e738b9d02312bd800abc19d 100644 (file)
@@ -78,7 +78,7 @@ NTSTATUS dgram_mailslot_ntlogon_reply(struct nbt_dgram_socket *dgmsock,
                return status;
        }
 
-       make_nbt_name_client(&myname, lp_netbios_name());
+       make_nbt_name_client(&myname, lp_netbios_name(global_loadparm));
 
        dest = socket_address_from_strings(tmp_ctx, 
                                           dgmsock->sock->backend_name, 
index edd9a92693b8b5b4a4d6a6ebb689dcd68bc5b5cd..2ac1358197f3aef55fcaaca79b0df78346b34ad7 100644 (file)
@@ -145,9 +145,9 @@ static void finddcs_name_resolved(struct composite_context *ctx)
 
        state->r.in.domainname = state->domain_name;
        state->r.in.ip_address = state->dcs[0].address;
-       state->r.in.my_computername = lp_netbios_name();
+       state->r.in.my_computername = lp_netbios_name(global_loadparm);
        state->r.in.my_accountname = talloc_asprintf(state, "%s$",
-                                                    lp_netbios_name());
+                                                    lp_netbios_name(global_loadparm));
        if (composite_nomem(state->r.in.my_accountname, state->ctx)) return;
        state->r.in.account_control = ACB_WSTRUST;
        state->r.in.domain_sid = state->domain_sid;
index ab26a7b2d2d6afedab9b294da7648fb8c26b4fa2..a55d743efb9736132f798b262d204a0950986d94 100644 (file)
@@ -54,7 +54,7 @@ _PUBLIC_ struct nbt_name_request *nbt_name_query_send(struct nbt_name_socket *nb
        packet->questions[0].question_class = NBT_QCLASS_IP;
 
        dest = socket_address_from_strings(packet, nbtsock->sock->backend_name,
-                                          io->in.dest_addr, lp_nbt_port());
+                                          io->in.dest_addr, lp_nbt_port(global_loadparm));
        if (dest == NULL) goto failed;
        req = nbt_name_request_send(nbtsock, dest, packet,
                                    io->in.timeout, io->in.retries, False);
@@ -158,7 +158,7 @@ _PUBLIC_ struct nbt_name_request *nbt_name_status_send(struct nbt_name_socket *n
        packet->questions[0].question_class = NBT_QCLASS_IP;
 
        dest = socket_address_from_strings(packet, nbtsock->sock->backend_name,
-                                          io->in.dest_addr, lp_nbt_port());
+                                          io->in.dest_addr, lp_nbt_port(global_loadparm));
        if (dest == NULL) goto failed;
        req = nbt_name_request_send(nbtsock, dest, packet,
                                    io->in.timeout, io->in.retries, False);
index d68cdb536580d25394dbd416bd0871bb530439cf..3114cb2b10028854cabc63502b95baeb1459886c 100644 (file)
@@ -69,7 +69,7 @@ struct nbt_name_request *nbt_name_refresh_send(struct nbt_name_socket *nbtsock,
 
        dest = socket_address_from_strings(nbtsock, 
                                           nbtsock->sock->backend_name, 
-                                          io->in.dest_addr, lp_nbt_port());
+                                          io->in.dest_addr, lp_nbt_port(global_loadparm));
        if (dest == NULL) goto failed;
        req = nbt_name_request_send(nbtsock, dest, packet,
                                    io->in.timeout, io->in.retries, False);
index 62c4a19b291d63d1c0f6238df3d0d857a9fc0998..b8fe36269446d13a05de78ac5bb4f44b5dac36e7 100644 (file)
@@ -77,7 +77,7 @@ struct nbt_name_request *nbt_name_register_send(struct nbt_name_socket *nbtsock,
        if (packet->additional[0].rdata.netbios.addresses[0].ipaddr == NULL) goto failed;
 
        dest = socket_address_from_strings(packet, nbtsock->sock->backend_name, 
-                                          io->in.dest_addr, lp_nbt_port());
+                                          io->in.dest_addr, lp_nbt_port(global_loadparm));
        if (dest == NULL) goto failed;
        req = nbt_name_request_send(nbtsock, dest, packet,
                                    io->in.timeout, io->in.retries, False);
index efc31b1501b63f3ef098baa1d4439c1dc2371203..a72a5c706f3393a5c6dfc0531ce24ea35d4ba210 100644 (file)
@@ -67,7 +67,7 @@ struct nbt_name_request *nbt_name_release_send(struct nbt_name_socket *nbtsock,
                talloc_strdup(packet->additional, io->in.address);
 
        dest = socket_address_from_strings(packet, nbtsock->sock->backend_name, 
-                                          io->in.dest_addr, lp_nbt_port());
+                                          io->in.dest_addr, lp_nbt_port(global_loadparm));
        if (dest == NULL) goto failed;
        req = nbt_name_request_send(nbtsock, dest, packet,
                                    io->in.timeout, io->in.retries, False);
index 51f631eb67fe1ea74eee2f206519b699b648256c..a748b40a322f5677a77722aa564330dba3cac245 100644 (file)
@@ -73,7 +73,7 @@ struct composite_context *smbcli_sock_connect_send(TALLOC_CTX *mem_ctx,
        if (state->host_name == NULL) goto failed;
 
        if (port == 0) {
-               const char **ports = lp_smb_ports();
+               const char **ports = lp_smb_ports(global_loadparm);
                int i;
 
                for (i=0;ports[i];i++) /* noop */ ;
@@ -120,7 +120,7 @@ static void smbcli_sock_connect_recv_conn(struct composite_context *ctx)
        if (!composite_is_ok(state->ctx)) return;
 
        state->ctx->status =
-               socket_set_option(sock, lp_socket_options(), NULL);
+               socket_set_option(sock, lp_socket_options(global_loadparm), NULL);
        if (!composite_is_ok(state->ctx)) return;
 
 
index 90f51b296959d7dfb5d3c5f50ef917e6b962398f..6b2c4c37fe0f26ca00818459c2a35dece9346eb7 100644 (file)
@@ -85,9 +85,10 @@ struct smbcli_transport *smbcli_transport_init(struct smbcli_socket *sock,
                transport->socket = talloc_reference(transport, sock);
        }
        transport->negotiate.protocol = PROTOCOL_NT1;
-       transport->options.use_spnego = lp_use_spnego() && lp_nt_status_support();
-       transport->options.max_xmit = lp_max_xmit();
-       transport->options.max_mux = lp_maxmux();
+       transport->options.use_spnego = lp_use_spnego(global_loadparm) && 
+                                       lp_nt_status_support(global_loadparm);
+       transport->options.max_xmit = lp_max_xmit(global_loadparm);
+       transport->options.max_mux = lp_maxmux(global_loadparm);
        transport->options.request_timeout = SMB_REQUEST_TIMEOUT;
 
        transport->negotiate.max_xmit = transport->options.max_xmit;
index 6a15c25eb9fa8363b78aaedfba369ef56a88a308..4ff11f3a691349fb6b73faa42ee39e794977bd64 100644 (file)
@@ -190,7 +190,7 @@ NTSTATUS smbcli_tree_full_connection(TALLOC_CTX *parent_ctx,
        io.in.service_type = service_type;
        io.in.credentials = credentials;
        io.in.fallback_to_anonymous = False;
-       io.in.workgroup = lp_workgroup();
+       io.in.workgroup = lp_workgroup(global_loadparm);
        
        status = smb_composite_connect(&io, parent_ctx, ev);
        if (NT_STATUS_IS_OK(status)) {
index eff22ee8bcec39309be0c49114d45570e0f1d652..c58ac1f0df4ecd79ae19e9953ab1f8538a6947ec 100644 (file)
@@ -58,7 +58,7 @@ struct smbcli_request *smb_raw_negotiate_send(struct smbcli_transport *transport
        }
 
        flags2 |= FLAGS2_32_BIT_ERROR_CODES;
-       if (lp_unicode()) {
+       if (lp_unicode(global_loadparm)) {
                flags2 |= FLAGS2_UNICODE_STRINGS;
        }
        flags2 |= FLAGS2_EXTENDED_ATTRIBUTES;
@@ -174,11 +174,11 @@ NTSTATUS smb_raw_negotiate_recv(struct smbcli_request *req)
        }
 
        /* a way to force ascii SMB */
-       if (!lp_unicode()) {
+       if (!lp_unicode(global_loadparm)) {
                transport->negotiate.capabilities &= ~CAP_UNICODE;
        }
 
-       if (!lp_nt_status_support()) {
+       if (!lp_nt_status_support(global_loadparm)) {
                transport->negotiate.capabilities &= ~CAP_STATUS32;
        }
 
index 1a82ea053695a2e6b9277232c69c43936e5774f3..59c13bbeb68a546752f22d43e2c76961f243f505 100644 (file)
@@ -383,7 +383,7 @@ bool smbcli_init_signing(struct smbcli_transport *transport)
                return False;
        }
        
-       switch (lp_client_signing()) {
+       switch (lp_client_signing(global_loadparm)) {
        case SMB_SIGNING_OFF:
                transport->negotiate.sign_info.allow_smb_signing = False;
                break;
index 9315c0f354387aae5d976aedd8e597f5e8ea2bc4..02e1fbdc04bae9a460a88f5f379ec9ec4c7f8385 100644 (file)
@@ -190,7 +190,7 @@ NTSTATUS resolve_name(struct nbt_name *name, TALLOC_CTX *mem_ctx, const char **r
                      struct event_context *ev)
 {
        struct composite_context *c = resolve_name_send(name, ev, 
-                                               lp_name_resolve_order());
+                                               lp_name_resolve_order(global_loadparm));
        return resolve_name_recv(c, mem_ctx, reply_addr);
 }
 
index 8c88950f53210d300ec3e56f809b0bded7544e0d..05a2d4da31784a7a22ec2594f89707225f680c45 100644 (file)
@@ -32,7 +32,7 @@ struct composite_context *resolve_name_wins_send(
                                struct event_context *event_ctx,
                                struct nbt_name *name)
 {
-       const char **address_list = lp_wins_server_list();
+       const char **address_list = lp_wins_server_list(global_loadparm);
        if (address_list == NULL) return NULL;
        return resolve_name_nbtlist_send(mem_ctx, event_ctx, name, address_list, False, True);
 }
index 0edf64c5df5c4d14fd28eacd8d2a99a4c177644d..6a2e9d09e99afa38468d44c1bc5006ce74838c50 100644 (file)
@@ -187,7 +187,7 @@ struct composite_context *smb2_connect_send(TALLOC_CTX *mem_ctx,
        ZERO_STRUCT(name);
        name.name = host;
 
-       creq = resolve_name_send(&name, c->event_ctx, lp_name_resolve_order());
+       creq = resolve_name_send(&name, c->event_ctx, lp_name_resolve_order(global_loadparm));
        composite_continue(c, creq, continue_resolve, c);
        return c;
 }
index 27b16ecc41e7ea8cdd190d2c3194453b72911de1..22b2cdb0e2106d86023163b8c76896433ddddc2b 100644 (file)
@@ -63,7 +63,7 @@ static NTSTATUS connect_send_negprot(struct composite_context *c,
 {
        struct connect_state *state = talloc_get_type(c->private_data, struct connect_state);
 
-       state->req = smb_raw_negotiate_send(state->transport, lp_cli_maxprotocol());
+       state->req = smb_raw_negotiate_send(state->transport, lp_cli_maxprotocol(global_loadparm));
        NT_STATUS_HAVE_NO_MEMORY(state->req);
 
        state->req->async.fn = request_handler;
@@ -172,7 +172,7 @@ static NTSTATUS connect_session_setup(struct composite_context *c,
 
                state->io_setup->in.credentials = cli_credentials_init(state);
                NT_STATUS_HAVE_NO_MEMORY(state->io_setup->in.credentials);
-               cli_credentials_set_conf(state->io_setup->in.credentials);
+               cli_credentials_set_conf(state->io_setup->in.credentials, global_loadparm);
                cli_credentials_set_anonymous(state->io_setup->in.credentials);
 
                /* If the preceding attempt was with extended security, we
@@ -459,7 +459,7 @@ struct composite_context *smb_composite_connect_send(struct smb_composite_connec
 
        state->stage = CONNECT_RESOLVE;
        make_nbt_name_server(&name, io->in.dest_host);
-       state->creq = resolve_name_send(&name, c->event_ctx, lp_name_resolve_order());
+       state->creq = resolve_name_send(&name, c->event_ctx, lp_name_resolve_order(global_loadparm));
 
        if (state->creq == NULL) goto failed;
        state->creq->async.private_data = c;
index 6a14e57ad070f883771440d2fddb5b4ad3233079..6f9e6b0de3c16dfe52c1da3aca801f004ffefba8 100644 (file)
@@ -223,14 +223,14 @@ static NTSTATUS session_setup_nt1(struct composite_context *c,
        NTSTATUS nt_status;
        struct sesssetup_state *state = talloc_get_type(c->private_data, struct sesssetup_state);
        const char *password = cli_credentials_get_password(io->in.credentials);
-       DATA_BLOB names_blob = NTLMv2_generate_names_blob(state, session->transport->socket->hostname, lp_workgroup());
+       DATA_BLOB names_blob = NTLMv2_generate_names_blob(state, session->transport->socket->hostname, lp_workgroup(global_loadparm));
        DATA_BLOB session_key;
        int flags = CLI_CRED_NTLM_AUTH;
-       if (lp_client_lanman_auth()) {
+       if (lp_client_lanman_auth(global_loadparm)) {
                flags |= CLI_CRED_LANMAN_AUTH;
        }
 
-       if (lp_client_ntlmv2_auth()) {
+       if (lp_client_ntlmv2_auth(global_loadparm)) {
                flags |= CLI_CRED_NTLMv2_AUTH;
        }
 
@@ -263,7 +263,7 @@ static NTSTATUS session_setup_nt1(struct composite_context *c,
                set_user_session_key(session, &session_key);
                
                data_blob_free(&session_key);
-       } else if (lp_client_plaintext_auth()) {
+       } else if (lp_client_plaintext_auth(global_loadparm)) {
                state->setup.nt1.in.password1 = data_blob_talloc(state, password, strlen(password));
                state->setup.nt1.in.password2 = data_blob(NULL, 0);
        } else {
@@ -290,14 +290,14 @@ static NTSTATUS session_setup_old(struct composite_context *c,
        NTSTATUS nt_status;
        struct sesssetup_state *state = talloc_get_type(c->private_data, struct sesssetup_state);
        const char *password = cli_credentials_get_password(io->in.credentials);
-       DATA_BLOB names_blob = NTLMv2_generate_names_blob(state, session->transport->socket->hostname, lp_workgroup());
+       DATA_BLOB names_blob = NTLMv2_generate_names_blob(state, session->transport->socket->hostname, lp_workgroup(global_loadparm));
        DATA_BLOB session_key;
        int flags = 0;
-       if (lp_client_lanman_auth()) {
+       if (lp_client_lanman_auth(global_loadparm)) {
                flags |= CLI_CRED_LANMAN_AUTH;
        }
 
-       if (lp_client_ntlmv2_auth()) {
+       if (lp_client_ntlmv2_auth(global_loadparm)) {
                flags |= CLI_CRED_NTLMv2_AUTH;
        }
 
@@ -324,7 +324,7 @@ static NTSTATUS session_setup_old(struct composite_context *c,
                set_user_session_key(session, &session_key);
                
                data_blob_free(&session_key);
-       } else if (lp_client_plaintext_auth()) {
+       } else if (lp_client_plaintext_auth(global_loadparm)) {
                state->setup.old.in.password = data_blob_talloc(state, password, strlen(password));
        } else {
                /* could match windows client and return 'cannot logon from this workstation', but it just confuses everybody */
index 347d513e9c7a313cb420d67eac00455e5a7b78c6..49384817b683d61f342c619685e00a4ca96010f7 100644 (file)
@@ -1168,7 +1168,7 @@ BOOL ntstatus_dos_equal(NTSTATUS status1, NTSTATUS status2)
           the mapping of dos codes, as we want to catch the cases where
           a forced dos code is needed
        */
-       if (lp_nt_status_support()) {
+       if (lp_nt_status_support(global_loadparm)) {
                return NT_STATUS_V(status1) == NT_STATUS_V(status2);
        }
 
index 1994b68df035e6c177f9ed4d33f1e97c5369bd12..86804df1ea40b938d9eca8f5ae4ec95f3194eb90 100644 (file)
@@ -43,7 +43,7 @@ struct libnet_context *libnet_context_init(struct event_context *ev)
        ctx->event_ctx = ev;
 
        /* name resolution methods */
-       ctx->name_res_methods = str_list_copy(ctx, lp_name_resolve_order());
+       ctx->name_res_methods = str_list_copy(ctx, lp_name_resolve_order(global_loadparm));
 
        /* connected services' params */
        ZERO_STRUCT(ctx->samr);
index 9404bc874d9077921a17152bd13e1fd3d1123de4..553bde615be3e07df2978b6998a865e8ed164e0f 100644 (file)
@@ -535,8 +535,8 @@ NTSTATUS libnet_JoinDomain(struct libnet_context *ctx, TALLOC_CTX *mem_ctx, stru
                        connect_with_info->out.domain_name = talloc_strdup(tmp_ctx, r->in.domain_name);
                } else {
                        /* Bugger, we just lost our way to automaticly find the domain name */
-                       connect_with_info->out.domain_name = talloc_strdup(tmp_ctx, lp_workgroup());
-                       connect_with_info->out.realm = talloc_strdup(tmp_ctx, lp_realm());
+                       connect_with_info->out.domain_name = talloc_strdup(tmp_ctx, lp_workgroup(global_loadparm));
+                       connect_with_info->out.realm = talloc_strdup(tmp_ctx, lp_realm(global_loadparm));
                }
        }
 
@@ -888,7 +888,7 @@ static NTSTATUS libnet_Join_primary_domain(struct libnet_context *ctx,
        if (r->in.netbios_name != NULL) {
                netbios_name = r->in.netbios_name;
        } else {
-               netbios_name = talloc_reference(tmp_mem, lp_netbios_name());
+               netbios_name = talloc_reference(tmp_mem, lp_netbios_name(global_loadparm));
                if (!netbios_name) {
                        r->out.error_string = NULL;
                        talloc_free(tmp_mem);
index 0eae9de039cad9c1b6879e89822cacbb90149c53..c235df6d2511d319d1d718e34a5f01f786a79e8c 100644 (file)
@@ -25,6 +25,7 @@
 #include "system/kerberos.h"
 #include "auth/credentials/credentials.h"
 #include "auth/credentials/credentials_krb5.h"
+#include "param/param.h"
 
 static NTSTATUS samdump_keytab_handle_user(TALLOC_CTX *mem_ctx,
                                            const char *keytab_name,
@@ -44,7 +45,7 @@ static NTSTATUS samdump_keytab_handle_user(TALLOC_CTX *mem_ctx,
        if (!credentials) {
                return NT_STATUS_NO_MEMORY;
        }
-       cli_credentials_set_conf(credentials);
+       cli_credentials_set_conf(credentials, global_loadparm);
        cli_credentials_set_username(credentials, username, CRED_SPECIFIED);
 
        /* We really should consult ldap in the main SamSync code, and
index 1fa4aece19c76d3b0d3d9d581b5225b2900c4e2b..9511989e8c23eed6b78072a323dac7b5c0bf93c0 100644 (file)
@@ -1217,7 +1217,7 @@ NTSTATUS libnet_samsync_ldb(struct libnet_context *ctx, TALLOC_CTX *mem_ctx, str
        state->secrets         = NULL;
        state->trusted_domains = NULL;
 
-       state->sam_ldb         = ldb_wrap_connect(mem_ctx, lp_sam_url(), 
+       state->sam_ldb         = ldb_wrap_connect(mem_ctx, lp_sam_url(global_loadparm), 
                                                  r->in.session_info,
                                                  ctx->cred, 0, NULL);
 
index e21976cb024dd1a5efc4d377985c91956051ed00..c6f85d5b5f4a8cccdf6ce95257ded7d8d7c14fa0 100644 (file)
@@ -28,6 +28,7 @@
 #include "auth/gensec/schannel_proto.h"
 #include "librpc/gen_ndr/ndr_netlogon.h"
 #include "librpc/gen_ndr/ndr_netlogon_c.h"
+#include "param/param.h"
 
 
 /**
@@ -184,7 +185,7 @@ NTSTATUS libnet_SamSync_netlogon(struct libnet_context *ctx, TALLOC_CTX *mem_ctx
                        talloc_free(samsync_ctx);
                        return NT_STATUS_NO_MEMORY;
                }
-               cli_credentials_set_conf(machine_account);
+               cli_credentials_set_conf(machine_account, global_loadparm);
                nt_status = cli_credentials_set_machine_account(machine_account);
                if (!NT_STATUS_IS_OK(nt_status)) {
                        r->out.error_string = talloc_strdup(mem_ctx, "Could not obtain machine account password - are we joined to the domain?");
index edd86b8df440d9d928a701f6b5be534e4f5d1833..2d6237634da78d6cae39d2b5d3b9a9dd29c6c982 100644 (file)
@@ -117,7 +117,7 @@ static struct composite_context *dcerpc_pipe_connect_ncacn_np_smb_send(TALLOC_CT
                conn->in.called_name            = s->io.binding->target_hostname;
        conn->in.service                = "IPC$";
        conn->in.service_type           = NULL;
-       conn->in.workgroup              = lp_workgroup();
+       conn->in.workgroup              = lp_workgroup(global_loadparm);
 
        /*
         * provide proper credentials - user supplied, but allow a
index e9c0c96be6cd08d2461c1e68106459159f8584f5..f7ae377e7b324998c0abe0a5731e4c266e8d74a5 100644 (file)
@@ -479,7 +479,7 @@ struct composite_context* dcerpc_pipe_open_tcp_send(struct dcerpc_connection *co
 
        make_nbt_name_server(&name, server);
        resolve_req = resolve_name_send(&name, c->event_ctx, 
-                                       lp_name_resolve_order());
+                                       lp_name_resolve_order(global_loadparm));
        composite_continue(c, resolve_req, continue_ip_resolve_name, c);
        return c;
 }
@@ -619,7 +619,7 @@ struct composite_context* dcerpc_pipe_open_pipe_send(struct dcerpc_connection *c
        s->conn = conn;
 
        string_replace(canon, '/', '\\');
-       s->full_path = talloc_asprintf(canon, "%s/%s", lp_ncalrpc_dir(), canon);
+       s->full_path = talloc_asprintf(canon, "%s/%s", lp_ncalrpc_dir(global_loadparm), canon);
        if (composite_nomem(s->full_path, c)) return c;
 
        /* prepare server address using path and transport name */
index dffba4aedfd2031a5617848f9db9bbfcb45b87b4..408860c9edb5436c5e400f8d775788bf078df61f 100644 (file)
@@ -930,7 +930,7 @@ struct composite_context *dcerpc_epm_map_binding_send(TALLOC_CTX *mem_ctx,
        /* anonymous credentials for rpc connection used to get endpoint mapping */
        anon_creds = cli_credentials_init(mem_ctx);
        cli_credentials_set_event_context(anon_creds, ev);
-       cli_credentials_set_conf(anon_creds);
+       cli_credentials_set_conf(anon_creds, global_loadparm);
        cli_credentials_set_anonymous(anon_creds);
 
        /*
@@ -1363,7 +1363,7 @@ void dcerpc_log_packet(const struct ndr_interface_table *ndr,
        for (i=0;i<num_examples;i++) {
                char *name=NULL;
                asprintf(&name, "%s/rpclog/%s-%u.%d.%s", 
-                        lp_lockdir(), ndr->name, opnum, i,
+                        lp_lockdir(global_loadparm), ndr->name, opnum, i,
                         (flags&NDR_IN)?"in":"out");
                if (name == NULL) {
                        return;
index eb06abd74ac022707321bfa52ba8e8b03715dd9d..ba32bb123e4e855b470ba8fc47b20d3f1cdd706c 100644 (file)
@@ -75,7 +75,7 @@ static void nbtd_netlogon_getdc(struct dgram_mailslot_handler *dgmslot,
        reply.command = NETLOGON_RESPONSE_FROM_PDC;
        pdc = &reply.req.response;
 
-       pdc->pdc_name         = lp_netbios_name();
+       pdc->pdc_name         = lp_netbios_name(global_loadparm);
        pdc->unicode_pdc_name = pdc->pdc_name;
        pdc->domain_name      = samdb_result_string(ref_res[0], "nETBIOSName", name->name);;
        pdc->nt_version       = 1;
@@ -110,7 +110,7 @@ static void nbtd_netlogon_getdc2(struct dgram_mailslot_handler *dgmslot,
        const char *dom_attrs[] = {"objectGUID", NULL};
        struct ldb_message **ref_res, **dom_res;
        int ret;
-       const char **services = lp_server_services();
+       const char **services = lp_server_services(global_loadparm);
        const char *my_ip = reply_iface->ip_address; 
        struct ldb_dn *partitions_basedn;
        if (!my_ip) {
@@ -183,15 +183,18 @@ static void nbtd_netlogon_getdc2(struct dgram_mailslot_handler *dgmslot,
        }
 
        pdc->domain_uuid      = samdb_result_guid(dom_res[0], "objectGUID");
-       pdc->forest           = samdb_result_string(ref_res[0], "dnsRoot", lp_realm());
-       pdc->dns_domain       = samdb_result_string(ref_res[0], "dnsRoot", lp_realm());
+       pdc->forest           = samdb_result_string(ref_res[0], "dnsRoot", 
+                                                   lp_realm(global_loadparm));
+       pdc->dns_domain       = samdb_result_string(ref_res[0], "dnsRoot", 
+                                                   lp_realm(global_loadparm));
 
        /* TODO: get our full DNS name from somewhere else */
        pdc->pdc_dns_name     = talloc_asprintf(packet, "%s.%s", 
-                                               strlower_talloc(packet, lp_netbios_name()), 
+                                               strlower_talloc(packet, 
+                                                               lp_netbios_name(global_loadparm)), 
                                                pdc->dns_domain);
        pdc->domain           = samdb_result_string(ref_res[0], "nETBIOSName", name->name);;
-       pdc->pdc_name         = lp_netbios_name();
+       pdc->pdc_name         = lp_netbios_name(global_loadparm);
        pdc->user_name        = netlogon->req.pdc2.user_name;
        /* TODO: we need to make sure these are in our DNS zone */
        pdc->server_site      = "Default-First-Site-Name";
index e24dffb4f4a89dbdf8ba9a07899e649fb4a46aa4..9d80a44ce67b1f26440174351641c4dcd8f40eb3 100644 (file)
@@ -49,9 +49,10 @@ static void nbtd_ntlogon_sam_logon(struct dgram_mailslot_handler *dgmslot,
        reply.command = NTLOGON_SAM_LOGON_REPLY;
        logon = &reply.req.reply;
 
-       logon->server           = talloc_asprintf(packet, "\\\\%s", lp_netbios_name());
+       logon->server           = talloc_asprintf(packet, "\\\\%s", 
+                                                 lp_netbios_name(global_loadparm));
        logon->user_name        = ntlogon->req.logon.user_name;
-       logon->domain           = lp_workgroup();
+       logon->domain           = lp_workgroup(global_loadparm);
        logon->nt_version       = 1;
        logon->lmnt_token       = 0xFFFF;
        logon->lm20_token       = 0xFFFF;
index da15340305354362b1074e263b663b21d75affff..48d6e4cb3ab2586b2e265d66b215160ea6c560c4 100644 (file)
@@ -80,7 +80,8 @@ NTSTATUS nbtd_dgram_setup(struct nbtd_interface *iface, const char *bind_address
                }
        
                bcast_addr = socket_address_from_strings(tmp_ctx, bcast_dgmsock->sock->backend_name, 
-                                                        iface->bcast_address, lp_dgram_port());
+                                                        iface->bcast_address, 
+                                                        lp_dgram_port(global_loadparm));
                if (!bcast_addr) {
                        talloc_free(tmp_ctx);
                        return NT_STATUS_NO_MEMORY;
@@ -90,7 +91,8 @@ NTSTATUS nbtd_dgram_setup(struct nbtd_interface *iface, const char *bind_address
                if (!NT_STATUS_IS_OK(status)) {
                        talloc_free(tmp_ctx);
                        DEBUG(0,("Failed to bind to %s:%d - %s\n", 
-                                iface->bcast_address, lp_dgram_port(), nt_errstr(status)));
+                                iface->bcast_address, lp_dgram_port(global_loadparm), 
+                                nt_errstr(status)));
                        return status;
                }
        
@@ -105,7 +107,7 @@ NTSTATUS nbtd_dgram_setup(struct nbtd_interface *iface, const char *bind_address
        }
 
        bind_addr = socket_address_from_strings(tmp_ctx, iface->dgmsock->sock->backend_name, 
-                                               bind_address, lp_dgram_port());
+                                               bind_address, lp_dgram_port(global_loadparm));
        if (!bind_addr) {
                talloc_free(tmp_ctx);
                return NT_STATUS_NO_MEMORY;
@@ -115,7 +117,7 @@ NTSTATUS nbtd_dgram_setup(struct nbtd_interface *iface, const char *bind_address
        if (!NT_STATUS_IS_OK(status)) {
                talloc_free(tmp_ctx);
                DEBUG(0,("Failed to bind to %s:%d - %s\n", 
-                        bind_address, lp_dgram_port(), nt_errstr(status)));
+                        bind_address, lp_dgram_port(global_loadparm), nt_errstr(status)));
                return status;
        }
 
index 40fa605e114650b0e106901086a5026628593c25..27d733aeffbed883d51969b14b277c76f022c254 100644 (file)
@@ -136,7 +136,7 @@ static NTSTATUS nbtd_add_socket(struct nbtd_server *nbtsrv,
                }
 
                bcast_address = socket_address_from_strings(bcast_nbtsock, bcast_nbtsock->sock->backend_name, 
-                                                           bcast, lp_nbt_port());
+                                                           bcast, lp_nbt_port(global_loadparm));
                if (!bcast_address) {
                        talloc_free(iface);
                        return NT_STATUS_NO_MEMORY;
@@ -145,7 +145,7 @@ static NTSTATUS nbtd_add_socket(struct nbtd_server *nbtsrv,
                status = socket_listen(bcast_nbtsock->sock, bcast_address, 0, 0);
                if (!NT_STATUS_IS_OK(status)) {
                        DEBUG(0,("Failed to bind to %s:%d - %s\n", 
-                                bcast, lp_nbt_port(), nt_errstr(status)));
+                                bcast, lp_nbt_port(global_loadparm), nt_errstr(status)));
                        talloc_free(iface);
                        return status;
                }
@@ -161,13 +161,14 @@ static NTSTATUS nbtd_add_socket(struct nbtd_server *nbtsrv,
                return NT_STATUS_NO_MEMORY;
        }
 
-       unicast_address = socket_address_from_strings(iface->nbtsock, iface->nbtsock->sock->backend_name, 
-                                                     bind_address, lp_nbt_port());
+       unicast_address = socket_address_from_strings(iface->nbtsock, 
+                                                     iface->nbtsock->sock->backend_name, 
+                                                     bind_address, lp_nbt_port(global_loadparm));
 
        status = socket_listen(iface->nbtsock->sock, unicast_address, 0, 0);
        if (!NT_STATUS_IS_OK(status)) {
                DEBUG(0,("Failed to bind to %s:%d - %s\n", 
-                        bind_address, lp_nbt_port(), nt_errstr(status)));
+                        bind_address, lp_nbt_port(global_loadparm), nt_errstr(status)));
                talloc_free(iface);
                return status;
        }
@@ -223,7 +224,7 @@ NTSTATUS nbtd_startup_interfaces(struct nbtd_server *nbtsrv)
 
        /* if we are allowing incoming packets from any address, then
           we also need to bind to the wildcard address */
-       if (!lp_bind_interfaces_only()) {
+       if (!lp_bind_interfaces_only(global_loadparm)) {
                const char *primary_address;
 
                /* the primary address is the address we will return
@@ -233,7 +234,7 @@ NTSTATUS nbtd_startup_interfaces(struct nbtd_server *nbtsrv)
                        primary_address = iface_n_ip(0);
                } else {
                        primary_address = sys_inet_ntoa(interpret_addr2(
-                                                               lp_netbios_name()));
+                                                       lp_netbios_name(global_loadparm)));
                }
                primary_address = talloc_strdup(tmp_ctx, primary_address);
                NT_STATUS_HAVE_NO_MEMORY(primary_address);
@@ -261,7 +262,7 @@ NTSTATUS nbtd_startup_interfaces(struct nbtd_server *nbtsrv)
                NT_STATUS_NOT_OK_RETURN(status);
        }
 
-       if (lp_wins_server_list()) {
+       if (lp_wins_server_list(global_loadparm)) {
                status = nbtd_add_wins_socket(nbtsrv);
                NT_STATUS_NOT_OK_RETURN(status);
        }
index 747b41076cfe1c878bf7aa8062f3abaffb2c49e7..5a220d1546b01fc495290fc4b8cbe26d2e3eccd8 100644 (file)
@@ -78,7 +78,7 @@ BOOL nbtd_self_packet(struct nbt_name_socket *nbtsock,
        struct nbtd_server *nbtsrv = iface->nbtsrv;
        
        /* if its not from the nbt port, then it wasn't a broadcast from us */
-       if (src->port != lp_nbt_port()) {
+       if (src->port != lp_nbt_port(global_loadparm)) {
                return False;
        }
 
index 30b3c5f9ce11e53f7c94564b59d77a151e62a805..f57cb7bf76b6a7dc2283f17abd07ae7431f23750 100644 (file)
@@ -81,7 +81,7 @@ void nbtd_request_query(struct nbt_name_socket *nbtsock,
        if (!(packet->operation & NBT_FLAG_BROADCAST) &&
           (packet->operation & NBT_FLAG_RECURSION_DESIRED) &&
           (iname->nb_flags & NBT_NM_GROUP) &&
-          lp_wins_support()) {
+          lp_wins_support(global_loadparm)) {
                nbtd_winsserver_request(nbtsock, packet, src);
                return;
        }
index af067d071c55fe3ee94b82c6207bd63fd3ff50a1..cb831f34437c67bb8d5b3ac00557483f83d08608 100644 (file)
@@ -170,7 +170,7 @@ static void nbtd_register_name_iface(struct nbtd_interface *iface,
                                     uint16_t nb_flags)
 {
        struct nbtd_iface_name *iname;
-       const char *scope = lp_netbios_scope();
+       const char *scope = lp_netbios_scope(global_loadparm);
        struct nbt_name_register_bcast io;
        struct composite_context *creq;
        struct nbtd_server *nbtsrv = iface->nbtsrv;
@@ -260,29 +260,29 @@ void nbtd_register_names(struct nbtd_server *nbtsrv)
 
        /* note that we don't initially mark the names "ACTIVE". They are 
           marked active once registration is successful */
-       nbtd_register_name(nbtsrv, lp_netbios_name(), NBT_NAME_CLIENT, nb_flags);
-       nbtd_register_name(nbtsrv, lp_netbios_name(), NBT_NAME_USER,   nb_flags);
-       nbtd_register_name(nbtsrv, lp_netbios_name(), NBT_NAME_SERVER, nb_flags);
+       nbtd_register_name(nbtsrv, lp_netbios_name(global_loadparm), NBT_NAME_CLIENT, nb_flags);
+       nbtd_register_name(nbtsrv, lp_netbios_name(global_loadparm), NBT_NAME_USER,   nb_flags);
+       nbtd_register_name(nbtsrv, lp_netbios_name(global_loadparm), NBT_NAME_SERVER, nb_flags);
 
-       aliases = lp_netbios_aliases();
+       aliases = lp_netbios_aliases(global_loadparm);
        while (aliases && aliases[0]) {
                nbtd_register_name(nbtsrv, aliases[0], NBT_NAME_CLIENT, nb_flags);
                nbtd_register_name(nbtsrv, aliases[0], NBT_NAME_SERVER, nb_flags);
                aliases++;
        }
 
-       if (lp_server_role() == ROLE_DOMAIN_CONTROLLER) {
-               BOOL is_pdc = samdb_is_pdc(nbtsrv->sam_ctx);
+       if (lp_server_role(global_loadparm) == ROLE_DOMAIN_CONTROLLER)  {
+               bool is_pdc = samdb_is_pdc(nbtsrv->sam_ctx);
                if (is_pdc) {
-                       nbtd_register_name(nbtsrv, lp_workgroup(),
+                       nbtd_register_name(nbtsrv, lp_workgroup(global_loadparm),
                                           NBT_NAME_PDC, nb_flags);
                }
-               nbtd_register_name(nbtsrv, lp_workgroup(),
+               nbtd_register_name(nbtsrv, lp_workgroup(global_loadparm),
                                   NBT_NAME_LOGON, nb_flags | NBT_NM_GROUP);
        }
 
        nb_flags |= NBT_NM_GROUP;
-       nbtd_register_name(nbtsrv, lp_workgroup(),    NBT_NAME_CLIENT, nb_flags);
+       nbtd_register_name(nbtsrv, lp_workgroup(global_loadparm), NBT_NAME_CLIENT, nb_flags);
 
        nb_flags |= NBT_NM_PERMANENT;
        nbtd_register_name(nbtsrv, "__SAMBA__",       NBT_NAME_CLIENT, nb_flags);
index 090621d890d00bd8e2f68d5b7b7e5c3b9e9b60c6..768f9477f6a19bffbc90d113d24ff02eac0807ac 100644 (file)
@@ -40,7 +40,7 @@ static const char *wins_hook_action_string(enum wins_hook_action action)
 void wins_hook(struct winsdb_handle *h, const struct winsdb_record *rec, 
               enum wins_hook_action action)
 {
-       const char *script = lp_wins_hook();
+       const char *script = lp_wins_hook(global_loadparm);
        uint32_t i, length;
        int child;
        char *cmd = NULL;
index e18885c327ac6d653c9d06932f7df2da77dc8bdd..1dd934cc92bea18f2878e6c286a7f553b292f1cc 100644 (file)
@@ -236,7 +236,7 @@ void nbtd_winsclient_register(struct nbtd_iface_name *iname)
 
        /* setup a wins name register request */
        io.in.name            = iname->name;
-       io.in.wins_servers    = lp_wins_server_list();
+       io.in.wins_servers    = lp_wins_server_list(global_loadparm);
        io.in.addresses       = nbtd_address_list(iface, iname);
        io.in.nb_flags        = iname->nb_flags;
        io.in.ttl             = iname->ttl;
index 6b26ba2d634764ba1310274434f45c8b35d81222..f7d149126bddb5fe92a40641e87c18e564183d39 100644 (file)
@@ -992,7 +992,7 @@ static BOOL winsdb_check_or_add_module_list(struct winsdb_handle *h)
                flags |= LDB_FLG_NOSYNC;
        }
 
-       h->ldb = ldb_wrap_connect(h, lock_path(h, lp_wins_url()),
+       h->ldb = ldb_wrap_connect(h, lock_path(h, lp_wins_url(global_loadparm)),
                                  NULL, NULL, flags, NULL);
        if (!h->ldb) goto failed;
 
@@ -1025,7 +1025,7 @@ struct winsdb_handle *winsdb_connect(TALLOC_CTX *mem_ctx, enum winsdb_handle_cal
                flags |= LDB_FLG_NOSYNC;
        }
 
-       h->ldb = ldb_wrap_connect(h, lock_path(h, lp_wins_url()),
+       h->ldb = ldb_wrap_connect(h, lock_path(h, lp_wins_url(global_loadparm)),
                                  NULL, NULL, flags, NULL);
        if (!h->ldb) goto failed;       
 
index fd0188cbf0cd33b44201cc72b1dc71fdb923790e..698d432c75ab157dbd75daa8e4b98927cae3b7a6 100644 (file)
@@ -706,7 +706,7 @@ static void nbtd_winsserver_query(struct nbt_name_socket *nbtsock,
 
        status = winsdb_lookup(winssrv->wins_db, name, packet, &rec);
        if (!NT_STATUS_IS_OK(status)) {
-               if (!lp_wins_dns_proxy()) {
+               if (!lp_wins_dns_proxy(global_loadparm)) {
                        goto notfound;
                }
 
@@ -957,7 +957,7 @@ NTSTATUS nbtd_winsserver_init(struct nbtd_server *nbtsrv)
 {
        uint32_t tmp;
 
-       if (!lp_wins_support()) {
+       if (!lp_wins_support(global_loadparm)) {
                nbtsrv->winssrv = NULL;
                return NT_STATUS_OK;
        }
@@ -965,8 +965,8 @@ NTSTATUS nbtd_winsserver_init(struct nbtd_server *nbtsrv)
        nbtsrv->winssrv = talloc_zero(nbtsrv, struct wins_server);
        NT_STATUS_HAVE_NO_MEMORY(nbtsrv->winssrv);
 
-       nbtsrv->winssrv->config.max_renew_interval = lp_max_wins_ttl();
-       nbtsrv->winssrv->config.min_renew_interval = lp_min_wins_ttl();
+       nbtsrv->winssrv->config.max_renew_interval = lp_max_wins_ttl(global_loadparm);
+       nbtsrv->winssrv->config.min_renew_interval = lp_min_wins_ttl(global_loadparm);
        tmp = lp_parm_int(NULL, "wreplsrv", "tombstone_interval", 6*24*60*60);
        nbtsrv->winssrv->config.tombstone_interval = tmp;
        tmp = lp_parm_int(NULL, "wreplsrv"," tombstone_timeout", 1*24*60*60);
index b4d7b95b6de585d9d0a814f8b07478f7f6fd5f01..cf4dceec6d07abb30f4778d8f85363365611b814 100644 (file)
@@ -52,7 +52,7 @@ static char winbind_separator_int(BOOL strict)
                        return 0;
                }
                /* HACK: (this module should not call lp_ funtions) */
-               return *lp_winbind_separator();
+               return *lp_winbind_separator(global_loadparm);
        }
 
        sep = response.data.info.winbind_separator;
@@ -64,7 +64,7 @@ static char winbind_separator_int(BOOL strict)
                        return 0;
                }
                /* HACK: (this module should not call lp_ funtions) */
-               sep = *lp_winbind_separator();
+               sep = *lp_winbind_separator(global_loadparm);
        }
        
        return sep;
@@ -89,7 +89,7 @@ static const char *get_winbind_domain(void)
                d_fprintf(stderr, "could not obtain winbind domain name!\n");
                
                /* HACK: (this module should not call lp_ funtions) */
-               return lp_workgroup();
+               return lp_workgroup(global_loadparm);
        }
 
        fstrcpy(winbind_domain, response.data.domain_name);
@@ -819,7 +819,7 @@ static BOOL wbinfo_auth_crap(char *username)
 
        generate_random_buffer(request.data.auth_crap.chal, 8);
         
-       if (lp_client_ntlmv2_auth()) {
+       if (lp_client_ntlmv2_auth(global_loadparm)) {
                DATA_BLOB server_chal;
                DATA_BLOB names_blob;   
 
@@ -836,7 +836,7 @@ static BOOL wbinfo_auth_crap(char *username)
                server_chal = data_blob(request.data.auth_crap.chal, 8); 
                
                /* Pretend this is a login to 'us', for blob purposes */
-               names_blob = NTLMv2_generate_names_blob(mem_ctx, lp_netbios_name(), lp_workgroup());
+               names_blob = NTLMv2_generate_names_blob(mem_ctx, lp_netbios_name(global_loadparm), lp_workgroup(global_loadparm));
                
                if (!SMBNTLMv2encrypt(mem_ctx, name_user, name_domain, pass, &server_chal, 
                                      &names_blob,
@@ -862,7 +862,7 @@ static BOOL wbinfo_auth_crap(char *username)
                data_blob_free(&lm_response);
 
        } else {
-               if (lp_client_lanman_auth() 
+               if (lp_client_lanman_auth(global_loadparm
                    && SMBencrypt(pass, request.data.auth_crap.chal, 
                               (unsigned char *)request.data.auth_crap.lm_resp)) {
                        request.data.auth_crap.lm_resp_len = 24;
index f0edd4720670e6223805caf66f3bafaf4583e26c..02808bfbc8ba9ac0ed3689a4e76367c94dda7e2d 100644 (file)
@@ -43,7 +43,7 @@
  */
 static struct ldb_context *sptr_db_connect(TALLOC_CTX *mem_ctx)
 {
-       return ldb_wrap_connect(mem_ctx, lp_spoolss_url(), system_session(mem_ctx), 
+       return ldb_wrap_connect(mem_ctx, lp_spoolss_url(global_loadparm), system_session(mem_ctx), 
                                NULL, 0, NULL);
 }
 
@@ -203,12 +203,12 @@ static WERROR sptr_GetPrintServerData(struct ntptr_GenericHandle *server, TALLOC
                r->out.data.binary      = blob;
                return WERR_OK;
        } else if (strcmp("DNSMachineName", r->in.value_name) == 0) {
-               if (!lp_realm()) return WERR_INVALID_PARAM;
+               if (!lp_realm(global_loadparm)) return WERR_INVALID_PARAM;
 
                r->out.type             = SPOOLSS_PRINTER_DATA_TYPE_STRING;
                r->out.data.string      = talloc_asprintf(mem_ctx, "%s.%s",
-                                                                  lp_netbios_name(),
-                                                                  lp_realm());
+                                                                  lp_netbios_name(global_loadparm),
+                                                                  lp_realm(global_loadparm));
                W_ERROR_HAVE_NO_MEMORY(r->out.data.string);
                return WERR_OK;
        }
index d248bd75526df022f6935e7d0e5e2971e72130af..ed7065b3bdaaf96746673dc18e081fb4429b0be7 100644 (file)
@@ -166,7 +166,7 @@ static NTSTATUS cvfs_connect(struct ntvfs_module_context *ntvfs,
                        return NT_STATUS_NO_MEMORY;
                }
                cli_credentials_set_event_context(credentials, ntvfs->ctx->event_ctx);
-               cli_credentials_set_conf(credentials);
+               cli_credentials_set_conf(credentials, global_loadparm);
                cli_credentials_set_username(credentials, user, CRED_SPECIFIED);
                if (domain) {
                        cli_credentials_set_domain(credentials, domain, CRED_SPECIFIED);
@@ -176,7 +176,7 @@ static NTSTATUS cvfs_connect(struct ntvfs_module_context *ntvfs,
                DEBUG(5, ("CIFS backend: Using machine account\n"));
                credentials = cli_credentials_init(private);
                cli_credentials_set_event_context(credentials, ntvfs->ctx->event_ctx);
-               cli_credentials_set_conf(credentials);
+               cli_credentials_set_conf(credentials, global_loadparm);
                if (domain) {
                        cli_credentials_set_domain(credentials, domain, CRED_SPECIFIED);
                }
@@ -198,7 +198,7 @@ static NTSTATUS cvfs_connect(struct ntvfs_module_context *ntvfs,
        io.in.called_name = host;
        io.in.credentials = credentials;
        io.in.fallback_to_anonymous = False;
-       io.in.workgroup = lp_workgroup();
+       io.in.workgroup = lp_workgroup(global_loadparm);
        io.in.service = remote_share;
        io.in.service_type = "?????";
        
index 120f88373cd492660ec5a33b4b4bdf5c14cd781e..f9d3235116e146a2fe14feab01ac698822874b17 100644 (file)
@@ -83,7 +83,7 @@ static NTSTATUS print_ioctl(struct ntvfs_module_context *ntvfs,
 
                p = (char *)io->ioctl.out.blob.data;
                SSVAL(p,0, 1 /* REWRITE: fsp->rap_print_jobid */);
-               push_string(p+2, lp_netbios_name(), 15, STR_TERMINATE|STR_ASCII);
+               push_string(p+2, lp_netbios_name(global_loadparm), 15, STR_TERMINATE|STR_ASCII);
                push_string(p+18, ntvfs->ctx->config->name, 13, STR_TERMINATE|STR_ASCII);
                return NT_STATUS_OK;
        }
index 90abc4abcd101693fd887e7e9413398110b35829..cd990ab088a822861f4d67a3466467fa4e8b9234 100644 (file)
@@ -66,8 +66,6 @@
 
 static bool bLoaded = false;
 
-struct loadparm_context *global_loadparm = NULL;
-
 #define standard_sub_basic talloc_strdup
 
 static bool do_parameter(const char *, const char *, void *);
@@ -87,7 +85,7 @@ struct loadparm_global
 {
        enum server_role server_role;
 
-       char **smb_ports;
+       const char **smb_ports;
        char *ncalrpc_dir;
        char *szLockDir;
        char *szModulesDir;
@@ -96,7 +94,7 @@ struct loadparm_global
        char *szServerString;
        char *szAutoServices;
        char *szPasswdChat;
-       char *szConfigFile;
+       const char *szConfigFile;
        char *szShareBackend;
        char *szSAM_URL;
        char *szSECRETS_URL;
@@ -104,23 +102,23 @@ struct loadparm_global
        char *szWINS_CONFIG_URL;
        char *szWINS_URL;
        char *szPrivateDir;
-       char **jsInclude;
+       const char **jsInclude;
        char *jsonrpcServicesDir;
-       char **szPasswordServers;
+       const char **szPasswordServers;
        char *szSocketOptions;
        char *szRealm;
-       char **szWINSservers;
-       char **szInterfaces;
+       const char **szWINSservers;
+       const char **szInterfaces;
        char *szSocketAddress;
        char *szAnnounceVersion;        /* This is initialised in init_globals */
        char *szWorkgroup;
        char *szNetbiosName;
-       char **szNetbiosAliases;
+       const char **szNetbiosAliases;
        char *szNetbiosScope;
        char *szDomainOtherSIDs;
-       char **szNameResolveOrder;
-       char **dcerpc_ep_servers;
-       char **server_services;
+       const char **szNameResolveOrder;
+       const char **dcerpc_ep_servers;
+       const char **server_services;
        char *ntptr_providor;
        char *szWinbindSeparator;
        char *szWinbinddSocketDirectory;
@@ -277,13 +275,9 @@ static struct loadparm_context {
                char *subfname;
                time_t modtime;
        } *file_lists;
-} loadparm = {
-       .iNumServices = 0,
-       .currentService = NULL,
-       .bInGlobalSection = true,
-       .ServicePtrs = NULL,
-       .file_lists = NULL,
-};
+} loadparm;
+
+struct loadparm_context *global_loadparm = &loadparm;
 
 #define NUMPARAMETERS (sizeof(parm_table) / sizeof(struct parm_struct))
 
@@ -386,6 +380,8 @@ static const struct enum_list enum_server_role[] = {
 static struct parm_struct parm_table[] = {
        {"Base Options", P_SEP, P_SEPARATOR},
 
+       {"config file", P_STRING, P_GLOBAL, &loadparm.Globals.szConfigFile, NULL, NULL, FLAG_HIDE},
+
        {"server role", P_ENUM, P_GLOBAL, &loadparm.Globals.server_role, NULL, enum_server_role, FLAG_BASIC},
 
        {"dos charset", P_STRING, P_GLOBAL, &dos_charset, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER},
@@ -541,7 +537,6 @@ static struct parm_struct parm_table[] = {
 
        {"Miscellaneous Options", P_SEP, P_SEPARATOR},
        
-       {"config file", P_STRING, P_GLOBAL, &loadparm.Globals.szConfigFile, NULL, NULL, FLAG_HIDE},
        {"share backend", P_STRING, P_GLOBAL, &loadparm.Globals.szShareBackend, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER},
        {"preload", P_STRING, P_GLOBAL, &loadparm.Globals.szAutoServices, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER},
        {"auto services", P_STRING, P_GLOBAL, &loadparm.Globals.szAutoServices, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER},
@@ -648,20 +643,20 @@ static const char *lp_string(const char *s)
    parameters from the rest of the program are defined 
 */
 
-#define FN_GLOBAL_STRING(fn_name,ptr) \
- const char *fn_name(void) {return(lp_string(*(char **)(ptr) ? *(char **)(ptr) : ""));}
-#define FN_GLOBAL_CONST_STRING(fn_name,ptr) \
- const char *fn_name(void) {return(*(const char **)(ptr) ? *(const char **)(ptr) : "");}
-#define FN_GLOBAL_LIST(fn_name,ptr) \
- const char **fn_name(void) {return(*(const char ***)(ptr));}
-#define FN_GLOBAL_BOOL(fn_name,ptr) \
- bool fn_name(void) {return((bool)*(int *)(ptr));}
+#define FN_GLOBAL_STRING(fn_name,var_name) \
+ const char *fn_name(struct loadparm_context *lp_ctx) {if (lp_ctx == NULL) return NULL; return lp_ctx->Globals.var_name ? lp_string(lp_ctx->Globals.var_name) : "";}
+#define FN_GLOBAL_CONST_STRING(fn_name,var_name) \
+ const char *fn_name(struct loadparm_context *lp_ctx) {if (lp_ctx == NULL) return NULL; return lp_ctx->Globals.var_name ? lp_ctx->Globals.var_name : "";}
+#define FN_GLOBAL_LIST(fn_name,var_name) \
+ const char **fn_name(struct loadparm_context *lp_ctx) {if (lp_ctx == NULL) return NULL; return lp_ctx->Globals.var_name;}
+#define FN_GLOBAL_BOOL(fn_name,var_name) \
+ bool fn_name(struct loadparm_context *lp_ctx) {if (lp_ctx == NULL) return false; return lp_ctx->Globals.var_name;}
 #if 0 /* unused */
 #define FN_GLOBAL_CHAR(fn_name,ptr) \
  char fn_name(void) {return(*(char *)(ptr));}
 #endif
-#define FN_GLOBAL_INTEGER(fn_name,ptr) \
- int fn_name(void) {return(*(int *)(ptr));}
+#define FN_GLOBAL_INTEGER(fn_name,var_name) \
+ int fn_name(struct loadparm_context *lp_ctx) {if (lp_ctx == NULL) return 0; return lp_ctx->Globals.var_name;}
 
 #define FN_LOCAL_STRING(fn_name,val) \
  const char *fn_name(struct loadparm_service *service) {return(lp_string((const char *)((service != NULL && service->val != NULL) ? service->val : sDefault.val)));}
@@ -674,98 +669,95 @@ static const char *lp_string(const char *s)
 #define FN_LOCAL_INTEGER(fn_name,val) \
  int fn_name(struct loadparm_service *service) {return((service != NULL)? service->val : sDefault.val);}
 
-_PUBLIC_ FN_GLOBAL_INTEGER(lp_server_role, &loadparm.Globals.server_role)
-_PUBLIC_ FN_GLOBAL_LIST(lp_smb_ports, &loadparm.Globals.smb_ports)
-_PUBLIC_ FN_GLOBAL_INTEGER(lp_nbt_port, &loadparm.Globals.nbt_port)
-_PUBLIC_ FN_GLOBAL_INTEGER(lp_dgram_port, &loadparm.Globals.dgram_port)
-_PUBLIC_ FN_GLOBAL_INTEGER(lp_cldap_port, &loadparm.Globals.cldap_port)
-_PUBLIC_ FN_GLOBAL_INTEGER(lp_krb5_port, &loadparm.Globals.krb5_port)
-_PUBLIC_ FN_GLOBAL_INTEGER(lp_kpasswd_port, &loadparm.Globals.kpasswd_port)
-_PUBLIC_ FN_GLOBAL_INTEGER(lp_web_port, &loadparm.Globals.web_port)
-_PUBLIC_ FN_GLOBAL_STRING(lp_dos_charset, &dos_charset)
-_PUBLIC_ FN_GLOBAL_STRING(lp_swat_directory, &loadparm.Globals.swat_directory)
-_PUBLIC_ FN_GLOBAL_BOOL(lp_tls_enabled, &loadparm.Globals.tls_enabled)
-_PUBLIC_ FN_GLOBAL_STRING(lp_tls_keyfile, &loadparm.Globals.tls_keyfile)
-_PUBLIC_ FN_GLOBAL_STRING(lp_tls_certfile, &loadparm.Globals.tls_certfile)
-_PUBLIC_ FN_GLOBAL_STRING(lp_tls_cafile, &loadparm.Globals.tls_cafile)
-_PUBLIC_ FN_GLOBAL_STRING(lp_tls_crlfile, &loadparm.Globals.tls_crlfile)
-_PUBLIC_ FN_GLOBAL_STRING(lp_tls_dhpfile, &loadparm.Globals.tls_dhpfile)
-_PUBLIC_ FN_GLOBAL_STRING(lp_unix_charset, &unix_charset)
-_PUBLIC_ FN_GLOBAL_STRING(lp_display_charset, &display_charset)
-_PUBLIC_ FN_GLOBAL_STRING(lp_configfile, &loadparm.Globals.szConfigFile)
-_PUBLIC_ FN_GLOBAL_STRING(lp_share_backend, &loadparm.Globals.szShareBackend)
-_PUBLIC_ FN_GLOBAL_STRING(lp_sam_url, &loadparm.Globals.szSAM_URL)
-_PUBLIC_ FN_GLOBAL_STRING(lp_secrets_url, &loadparm.Globals.szSECRETS_URL)
-_PUBLIC_ FN_GLOBAL_STRING(lp_spoolss_url, &loadparm.Globals.szSPOOLSS_URL)
-_PUBLIC_ FN_GLOBAL_STRING(lp_wins_config_url, &loadparm.Globals.szWINS_CONFIG_URL)
-_PUBLIC_ FN_GLOBAL_STRING(lp_wins_url, &loadparm.Globals.szWINS_URL)
-_PUBLIC_ FN_GLOBAL_CONST_STRING(lp_winbind_separator, &loadparm.Globals.szWinbindSeparator)
-_PUBLIC_ FN_GLOBAL_CONST_STRING(lp_winbindd_socket_directory, &loadparm.Globals.szWinbinddSocketDirectory)
-_PUBLIC_ FN_GLOBAL_CONST_STRING(lp_template_shell, &loadparm.Globals.szTemplateShell)
-_PUBLIC_ FN_GLOBAL_CONST_STRING(lp_template_homedir, &loadparm.Globals.szTemplateHomedir)
-_PUBLIC_ FN_GLOBAL_BOOL(lp_winbind_sealed_pipes, &loadparm.Globals.bWinbindSealedPipes)
-_PUBLIC_ FN_GLOBAL_STRING(lp_private_dir, &loadparm.Globals.szPrivateDir)
-_PUBLIC_ FN_GLOBAL_STRING(lp_serverstring, &loadparm.Globals.szServerString)
-_PUBLIC_ FN_GLOBAL_STRING(lp_lockdir, &loadparm.Globals.szLockDir)
-_PUBLIC_ FN_GLOBAL_STRING(lp_modulesdir, &loadparm.Globals.szModulesDir)
-_PUBLIC_ FN_GLOBAL_STRING(lp_setupdir, &loadparm.Globals.szSetupDir)
-_PUBLIC_ FN_GLOBAL_STRING(lp_ncalrpc_dir, &loadparm.Globals.ncalrpc_dir)
-_PUBLIC_ FN_GLOBAL_STRING(lp_piddir, &loadparm.Globals.szPidDir)
-_PUBLIC_ FN_GLOBAL_LIST(lp_dcerpc_endpoint_servers, &loadparm.Globals.dcerpc_ep_servers)
-_PUBLIC_ FN_GLOBAL_LIST(lp_server_services, &loadparm.Globals.server_services)
-_PUBLIC_ FN_GLOBAL_STRING(lp_ntptr_providor, &loadparm.Globals.ntptr_providor)
-_PUBLIC_ FN_GLOBAL_STRING(lp_auto_services, &loadparm.Globals.szAutoServices)
-_PUBLIC_ FN_GLOBAL_STRING(lp_passwd_chat, &loadparm.Globals.szPasswdChat)
-_PUBLIC_ FN_GLOBAL_LIST(lp_passwordserver, &loadparm.Globals.szPasswordServers)
-_PUBLIC_ FN_GLOBAL_LIST(lp_name_resolve_order, &loadparm.Globals.szNameResolveOrder)
-_PUBLIC_ FN_GLOBAL_STRING(lp_realm, &loadparm.Globals.szRealm)
-_PUBLIC_ FN_GLOBAL_STRING(lp_socket_options, &loadparm.Globals.socket_options)
-_PUBLIC_ FN_GLOBAL_STRING(lp_workgroup, &loadparm.Globals.szWorkgroup)
-_PUBLIC_ FN_GLOBAL_STRING(lp_netbios_name, &loadparm.Globals.szNetbiosName)
-_PUBLIC_ FN_GLOBAL_STRING(lp_netbios_scope, &loadparm.Globals.szNetbiosScope)
-_PUBLIC_ FN_GLOBAL_LIST(lp_wins_server_list, &loadparm.Globals.szWINSservers)
-_PUBLIC_ FN_GLOBAL_LIST(lp_interfaces, &loadparm.Globals.szInterfaces)
-_PUBLIC_ FN_GLOBAL_STRING(lp_socket_address, &loadparm.Globals.szSocketAddress)
-_PUBLIC_ FN_GLOBAL_LIST(lp_netbios_aliases, &loadparm.Globals.szNetbiosAliases)
-
-_PUBLIC_ FN_GLOBAL_BOOL(lp_disable_netbios, &loadparm.Globals.bDisableNetbios)
-_PUBLIC_ FN_GLOBAL_BOOL(lp_wins_support, &loadparm.Globals.bWINSsupport)
-_PUBLIC_ FN_GLOBAL_BOOL(lp_wins_dns_proxy, &loadparm.Globals.bWINSdnsProxy)
-_PUBLIC_ FN_GLOBAL_STRING(lp_wins_hook, &loadparm.Globals.szWINSHook)
-_PUBLIC_ FN_GLOBAL_BOOL(lp_local_master, &loadparm.Globals.bLocalMaster)
-_PUBLIC_ FN_GLOBAL_BOOL(lp_readraw, &loadparm.Globals.bReadRaw)
-_PUBLIC_ FN_GLOBAL_BOOL(lp_large_readwrite, &loadparm.Globals.bLargeReadwrite)
-_PUBLIC_ FN_GLOBAL_BOOL(lp_writeraw, &loadparm.Globals.bWriteRaw)
-_PUBLIC_ FN_GLOBAL_BOOL(lp_null_passwords, &loadparm.Globals.bNullPasswords)
-_PUBLIC_ FN_GLOBAL_BOOL(lp_obey_pam_restrictions, &loadparm.Globals.bObeyPamRestrictions)
-_PUBLIC_ FN_GLOBAL_BOOL(lp_encrypted_passwords, &loadparm.Globals.bEncryptPasswords)
-_PUBLIC_ FN_GLOBAL_BOOL(lp_time_server, &loadparm.Globals.bTimeServer)
-_PUBLIC_ FN_GLOBAL_BOOL(lp_bind_interfaces_only, &loadparm.Globals.bBindInterfacesOnly)
-_PUBLIC_ FN_GLOBAL_BOOL(lp_unicode, &loadparm.Globals.bUnicode)
-_PUBLIC_ FN_GLOBAL_BOOL(lp_nt_status_support, &loadparm.Globals.bNTStatusSupport)
-_PUBLIC_ FN_GLOBAL_BOOL(lp_lanman_auth, &loadparm.Globals.bLanmanAuth)
-_PUBLIC_ FN_GLOBAL_BOOL(lp_ntlm_auth, &loadparm.Globals.bNTLMAuth)
-_PUBLIC_ FN_GLOBAL_BOOL(lp_client_plaintext_auth, &loadparm.Globals.bClientPlaintextAuth)
-_PUBLIC_ FN_GLOBAL_BOOL(lp_client_lanman_auth, &loadparm.Globals.bClientLanManAuth)
-_PUBLIC_ FN_GLOBAL_BOOL(lp_client_ntlmv2_auth, &loadparm.Globals.bClientNTLMv2Auth)
-_PUBLIC_ FN_GLOBAL_BOOL(lp_client_use_spnego_principal, &loadparm.Globals.client_use_spnego_principal)
-_PUBLIC_ FN_GLOBAL_BOOL(lp_host_msdfs, &loadparm.Globals.bHostMSDfs)
-_PUBLIC_ FN_GLOBAL_BOOL(lp_unix_extensions, &loadparm.Globals.bUnixExtensions)
-_PUBLIC_ FN_GLOBAL_BOOL(lp_use_spnego, &loadparm.Globals.bUseSpnego)
-_PUBLIC_ FN_GLOBAL_BOOL(lp_rpc_big_endian, &loadparm.Globals.bRpcBigEndian)
-_PUBLIC_ FN_GLOBAL_INTEGER(lp_max_wins_ttl, &loadparm.Globals.max_wins_ttl)
-_PUBLIC_ FN_GLOBAL_INTEGER(lp_min_wins_ttl, &loadparm.Globals.min_wins_ttl)
-_PUBLIC_ FN_GLOBAL_INTEGER(lp_maxmux, &loadparm.Globals.max_mux)
-_PUBLIC_ FN_GLOBAL_INTEGER(lp_max_xmit, &loadparm.Globals.max_xmit)
-_PUBLIC_ FN_GLOBAL_INTEGER(lp_passwordlevel, &loadparm.Globals.pwordlevel)
-_PUBLIC_ FN_GLOBAL_INTEGER(lp_srv_maxprotocol, &loadparm.Globals.srv_maxprotocol)
-_PUBLIC_ FN_GLOBAL_INTEGER(lp_srv_minprotocol, &loadparm.Globals.srv_minprotocol)
-_PUBLIC_ FN_GLOBAL_INTEGER(lp_cli_maxprotocol, &loadparm.Globals.cli_maxprotocol)
-_PUBLIC_ FN_GLOBAL_INTEGER(lp_cli_minprotocol, &loadparm.Globals.cli_minprotocol)
-_PUBLIC_ FN_GLOBAL_INTEGER(lp_security, &loadparm.Globals.security)
-_PUBLIC_ FN_GLOBAL_BOOL(lp_paranoid_server_security, &loadparm.Globals.paranoid_server_security)
-_PUBLIC_ FN_GLOBAL_INTEGER(lp_announce_as, &loadparm.Globals.announce_as)
-_PUBLIC_ FN_GLOBAL_LIST(lp_js_include, &loadparm.Globals.jsInclude)
+_PUBLIC_ FN_GLOBAL_INTEGER(lp_server_role, server_role)
+_PUBLIC_ FN_GLOBAL_LIST(lp_smb_ports, smb_ports)
+_PUBLIC_ FN_GLOBAL_INTEGER(lp_nbt_port, nbt_port)
+_PUBLIC_ FN_GLOBAL_INTEGER(lp_dgram_port, dgram_port)
+_PUBLIC_ FN_GLOBAL_INTEGER(lp_cldap_port, cldap_port)
+_PUBLIC_ FN_GLOBAL_INTEGER(lp_krb5_port, krb5_port)
+_PUBLIC_ FN_GLOBAL_INTEGER(lp_kpasswd_port, kpasswd_port)
+_PUBLIC_ FN_GLOBAL_INTEGER(lp_web_port, web_port)
+_PUBLIC_ FN_GLOBAL_STRING(lp_swat_directory, swat_directory)
+_PUBLIC_ FN_GLOBAL_BOOL(lp_tls_enabled, tls_enabled)
+_PUBLIC_ FN_GLOBAL_STRING(lp_tls_keyfile, tls_keyfile)
+_PUBLIC_ FN_GLOBAL_STRING(lp_tls_certfile, tls_certfile)
+_PUBLIC_ FN_GLOBAL_STRING(lp_tls_cafile, tls_cafile)
+_PUBLIC_ FN_GLOBAL_STRING(lp_tls_crlfile, tls_crlfile)
+_PUBLIC_ FN_GLOBAL_STRING(lp_tls_dhpfile, tls_dhpfile)
+_PUBLIC_ FN_GLOBAL_STRING(lp_share_backend, szShareBackend)
+_PUBLIC_ FN_GLOBAL_STRING(lp_sam_url, szSAM_URL)
+_PUBLIC_ FN_GLOBAL_STRING(lp_secrets_url, szSECRETS_URL)
+_PUBLIC_ FN_GLOBAL_STRING(lp_spoolss_url, szSPOOLSS_URL)
+_PUBLIC_ FN_GLOBAL_STRING(lp_wins_config_url, szWINS_CONFIG_URL)
+_PUBLIC_ FN_GLOBAL_STRING(lp_wins_url, szWINS_URL)
+_PUBLIC_ FN_GLOBAL_CONST_STRING(lp_winbind_separator, szWinbindSeparator)
+_PUBLIC_ FN_GLOBAL_CONST_STRING(lp_winbindd_socket_directory, szWinbinddSocketDirectory)
+_PUBLIC_ FN_GLOBAL_CONST_STRING(lp_template_shell, szTemplateShell)
+_PUBLIC_ FN_GLOBAL_CONST_STRING(lp_template_homedir, szTemplateHomedir)
+_PUBLIC_ FN_GLOBAL_BOOL(lp_winbind_sealed_pipes, bWinbindSealedPipes)
+_PUBLIC_ FN_GLOBAL_STRING(lp_private_dir, szPrivateDir)
+_PUBLIC_ FN_GLOBAL_STRING(lp_serverstring, szServerString)
+_PUBLIC_ FN_GLOBAL_STRING(lp_lockdir, szLockDir)
+_PUBLIC_ FN_GLOBAL_STRING(lp_modulesdir, szModulesDir)
+_PUBLIC_ FN_GLOBAL_STRING(lp_setupdir, szSetupDir)
+_PUBLIC_ FN_GLOBAL_STRING(lp_ncalrpc_dir, ncalrpc_dir)
+_PUBLIC_ FN_GLOBAL_STRING(lp_piddir, szPidDir)
+_PUBLIC_ FN_GLOBAL_LIST(lp_dcerpc_endpoint_servers, dcerpc_ep_servers)
+_PUBLIC_ FN_GLOBAL_LIST(lp_server_services, server_services)
+_PUBLIC_ FN_GLOBAL_STRING(lp_ntptr_providor, ntptr_providor)
+_PUBLIC_ FN_GLOBAL_STRING(lp_auto_services, szAutoServices)
+_PUBLIC_ FN_GLOBAL_STRING(lp_passwd_chat, szPasswdChat)
+_PUBLIC_ FN_GLOBAL_LIST(lp_passwordserver, szPasswordServers)
+_PUBLIC_ FN_GLOBAL_LIST(lp_name_resolve_order, szNameResolveOrder)
+_PUBLIC_ FN_GLOBAL_STRING(lp_realm, szRealm)
+_PUBLIC_ FN_GLOBAL_STRING(lp_socket_options, socket_options)
+_PUBLIC_ FN_GLOBAL_STRING(lp_workgroup, szWorkgroup)
+_PUBLIC_ FN_GLOBAL_STRING(lp_netbios_name, szNetbiosName)
+_PUBLIC_ FN_GLOBAL_STRING(lp_netbios_scope, szNetbiosScope)
+_PUBLIC_ FN_GLOBAL_LIST(lp_wins_server_list, szWINSservers)
+_PUBLIC_ FN_GLOBAL_LIST(lp_interfaces, szInterfaces)
+_PUBLIC_ FN_GLOBAL_STRING(lp_socket_address, szSocketAddress)
+_PUBLIC_ FN_GLOBAL_LIST(lp_netbios_aliases, szNetbiosAliases)
+
+_PUBLIC_ FN_GLOBAL_BOOL(lp_disable_netbios, bDisableNetbios)
+_PUBLIC_ FN_GLOBAL_BOOL(lp_wins_support, bWINSsupport)
+_PUBLIC_ FN_GLOBAL_BOOL(lp_wins_dns_proxy, bWINSdnsProxy)
+_PUBLIC_ FN_GLOBAL_STRING(lp_wins_hook, szWINSHook)
+_PUBLIC_ FN_GLOBAL_STRING(lp_configfile, szConfigFile)
+_PUBLIC_ FN_GLOBAL_BOOL(lp_local_master, bLocalMaster)
+_PUBLIC_ FN_GLOBAL_BOOL(lp_readraw, bReadRaw)
+_PUBLIC_ FN_GLOBAL_BOOL(lp_large_readwrite, bLargeReadwrite)
+_PUBLIC_ FN_GLOBAL_BOOL(lp_writeraw, bWriteRaw)
+_PUBLIC_ FN_GLOBAL_BOOL(lp_null_passwords, bNullPasswords)
+_PUBLIC_ FN_GLOBAL_BOOL(lp_obey_pam_restrictions, bObeyPamRestrictions)
+_PUBLIC_ FN_GLOBAL_BOOL(lp_encrypted_passwords, bEncryptPasswords)
+_PUBLIC_ FN_GLOBAL_BOOL(lp_time_server, bTimeServer)
+_PUBLIC_ FN_GLOBAL_BOOL(lp_bind_interfaces_only, bBindInterfacesOnly)
+_PUBLIC_ FN_GLOBAL_BOOL(lp_unicode, bUnicode)
+_PUBLIC_ FN_GLOBAL_BOOL(lp_nt_status_support, bNTStatusSupport)
+_PUBLIC_ FN_GLOBAL_BOOL(lp_lanman_auth, bLanmanAuth)
+_PUBLIC_ FN_GLOBAL_BOOL(lp_ntlm_auth, bNTLMAuth)
+_PUBLIC_ FN_GLOBAL_BOOL(lp_client_plaintext_auth, bClientPlaintextAuth)
+_PUBLIC_ FN_GLOBAL_BOOL(lp_client_lanman_auth, bClientLanManAuth)
+_PUBLIC_ FN_GLOBAL_BOOL(lp_client_ntlmv2_auth, bClientNTLMv2Auth)
+_PUBLIC_ FN_GLOBAL_BOOL(lp_client_use_spnego_principal, client_use_spnego_principal)
+_PUBLIC_ FN_GLOBAL_BOOL(lp_host_msdfs, bHostMSDfs)
+_PUBLIC_ FN_GLOBAL_BOOL(lp_unix_extensions, bUnixExtensions)
+_PUBLIC_ FN_GLOBAL_BOOL(lp_use_spnego, bUseSpnego)
+_PUBLIC_ FN_GLOBAL_BOOL(lp_rpc_big_endian, bRpcBigEndian)
+_PUBLIC_ FN_GLOBAL_INTEGER(lp_max_wins_ttl, max_wins_ttl)
+_PUBLIC_ FN_GLOBAL_INTEGER(lp_min_wins_ttl, min_wins_ttl)
+_PUBLIC_ FN_GLOBAL_INTEGER(lp_maxmux, max_mux)
+_PUBLIC_ FN_GLOBAL_INTEGER(lp_max_xmit, max_xmit)
+_PUBLIC_ FN_GLOBAL_INTEGER(lp_passwordlevel, pwordlevel)
+_PUBLIC_ FN_GLOBAL_INTEGER(lp_srv_maxprotocol, srv_maxprotocol)
+_PUBLIC_ FN_GLOBAL_INTEGER(lp_srv_minprotocol, srv_minprotocol)
+_PUBLIC_ FN_GLOBAL_INTEGER(lp_cli_maxprotocol, cli_maxprotocol)
+_PUBLIC_ FN_GLOBAL_INTEGER(lp_cli_minprotocol, cli_minprotocol)
+_PUBLIC_ FN_GLOBAL_INTEGER(lp_security, security)
+_PUBLIC_ FN_GLOBAL_BOOL(lp_paranoid_server_security, paranoid_server_security)
+_PUBLIC_ FN_GLOBAL_INTEGER(lp_announce_as, announce_as)
+_PUBLIC_ FN_GLOBAL_LIST(lp_js_include, jsInclude)
 _PUBLIC_ FN_LOCAL_STRING(lp_servicename, szService)
 _PUBLIC_ FN_LOCAL_CONST_STRING(lp_const_servicename, szService)
 _PUBLIC_ FN_LOCAL_STRING(lp_pathname, szPath)
@@ -792,8 +784,8 @@ _PUBLIC_ FN_LOCAL_INTEGER(lp_create_mask, iCreate_mask)
 _PUBLIC_ FN_LOCAL_INTEGER(lp_force_create_mode, iCreate_force_mode)
 _PUBLIC_ FN_LOCAL_INTEGER(lp_dir_mask, iDir_mask)
 _PUBLIC_ FN_LOCAL_INTEGER(lp_force_dir_mode, iDir_force_mode)
-_PUBLIC_ FN_GLOBAL_INTEGER(lp_server_signing, &loadparm.Globals.server_signing)
-_PUBLIC_ FN_GLOBAL_INTEGER(lp_client_signing, &loadparm.Globals.client_signing)
+_PUBLIC_ FN_GLOBAL_INTEGER(lp_server_signing, server_signing)
+_PUBLIC_ FN_GLOBAL_INTEGER(lp_client_signing, client_signing)
 
 /* local prototypes */
 static int map_parameter(const char *pszParmName);
@@ -2314,8 +2306,6 @@ bool loadparm_init(struct loadparm_context *lp_ctx)
                }
        }
 
-       lp_do_global_parameter(lp_ctx, "config file", dyn_CONFIGFILE);
-
        lp_do_global_parameter(lp_ctx, "share backend", "classic");
        
        lp_do_global_parameter(lp_ctx, "server role", "standalone");
@@ -2460,16 +2450,16 @@ bool loadparm_init(struct loadparm_context *lp_ctx)
  False on failure.
 ***************************************************************************/
 
-bool lp_load(void)
+bool lp_load(const char *filename)
 {
        char *n2;
        bool bRetval;
        struct param_opt *data;
        struct loadparm_context *lp_ctx = &loadparm;
 
-       global_loadparm = lp_ctx;
+       filename = talloc_strdup(talloc_autofree_context(), filename);
 
-       bRetval = false;
+       global_loadparm = lp_ctx;
 
        if (lp_ctx->Globals.param_opt != NULL) {
                struct param_opt *next;
@@ -2483,12 +2473,14 @@ bool lp_load(void)
 
        if (!loadparm_init(lp_ctx))
                return false;
+
+       lp_ctx->Globals.szConfigFile = filename;
        
        lp_ctx->bInGlobalSection = true;
-       n2 = standard_sub_basic(talloc_autofree_context(), lp_configfile());
+       n2 = standard_sub_basic(talloc_autofree_context(), lp_ctx->Globals.szConfigFile);
        DEBUG(2, ("lp_load: refreshing parameters from %s\n", n2));
        
-       add_to_file_list(lp_ctx, lp_configfile(), n2);
+       add_to_file_list(lp_ctx, lp_ctx->Globals.szConfigFile, n2);
 
        /* We get sections first, so have to start 'behind' to make up */
        lp_ctx->currentService = NULL;
@@ -2500,7 +2492,7 @@ bool lp_load(void)
                if (lp_ctx->currentService != NULL)
                        bRetval = service_ok(lp_ctx->currentService);
 
-       lp_add_auto_services(lp_ctx, lp_auto_services());
+       lp_add_auto_services(lp_ctx, lp_auto_services(lp_ctx));
 
        lp_add_hidden(lp_ctx, "IPC$", "IPC");
        lp_add_hidden(lp_ctx, "ADMIN$", "DISK");
@@ -2606,9 +2598,9 @@ const char *volume_label(struct loadparm_service *service)
  If we are PDC then prefer us as DMB
 ************************************************************/
 
-bool lp_domain_logons(void)
+bool lp_domain_logons(struct loadparm_context *lp_ctx)
 {
-       return (lp_server_role() == ROLE_DOMAIN_CONTROLLER);
+       return (lp_server_role(lp_ctx) == ROLE_DOMAIN_CONTROLLER);
 }
 
 const char *lp_printername(struct loadparm_service *service)
index 657d2f7998a1cafc5e9fc8d8f1c6c81a302e10d3..4107526d758bd8b4dbcdf37ca66f411c545ad2b7 100644 (file)
@@ -56,22 +56,22 @@ void secrets_shutdown(void)
 }
 
 /* open up the secrets database */
-BOOL secrets_init(void)
+bool secrets_init(void)
 {
        char *fname;
        uint8_t dummy;
 
        if (tdb)
-               return True;
+               return true;
 
-       asprintf(&fname, "%s/secrets.tdb", lp_private_dir());
+       asprintf(&fname, "%s/secrets.tdb", lp_private_dir(global_loadparm));
 
        tdb = tdb_wrap_open(talloc_autofree_context(), fname, 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
 
        if (!tdb) {
                DEBUG(0,("Failed to open %s\n", fname));
                SAFE_FREE(fname);
-               return False;
+               return false;
        }
        SAFE_FREE(fname);
 
@@ -103,7 +103,7 @@ struct ldb_context *secrets_db_connect(TALLOC_CTX *mem_ctx)
                "computerName: CASE_INSENSITIVE\n" \
                "flatname: CASE_INSENSITIVE\n";
 
-       url = lp_secrets_url();
+       url = lp_secrets_url(global_loadparm);
        if (!url || !url[0]) {
                return NULL;
        }
index abc5e2ebebb13fcd098c586e160276e0d659ab52..dabd4e8d268eaf473f929e499f06feec337a070b 100644 (file)
@@ -134,7 +134,7 @@ NTSTATUS share_get_context_by_name(TALLOC_CTX *mem_ctx,
 
        ops = share_backend_by_name(backend_name);
        if (!ops) {
-               DEBUG(0, ("share_init_connection: share backend [%s] not found!\n", lp_share_backend()));
+               DEBUG(0, ("share_init_connection: share backend [%s] not found!\n", lp_share_backend(global_loadparm)));
                return NT_STATUS_INTERNAL_ERROR;
        }
 
@@ -143,7 +143,7 @@ NTSTATUS share_get_context_by_name(TALLOC_CTX *mem_ctx,
 
 NTSTATUS share_get_context(TALLOC_CTX *mem_ctx, struct share_context **ctx)
 {
-       return share_get_context_by_name(mem_ctx, lp_share_backend(), ctx);
+       return share_get_context_by_name(mem_ctx, lp_share_backend(global_loadparm), ctx);
 }
 
 /*
index 308d4bfc2bf57702421c11fc50b114afd69f0145..25959c491980464ed3d60f392fc825c66eeeb6c7 100644 (file)
@@ -44,11 +44,11 @@ _PUBLIC_ bool is_myname(const char *name)
        const char **aliases;
        int i;
 
-       if (strcasecmp(name, lp_netbios_name()) == 0) {
+       if (strcasecmp(name, lp_netbios_name(global_loadparm)) == 0) {
                return True;
        }
 
-       aliases = lp_netbios_aliases();
+       aliases = lp_netbios_aliases(global_loadparm);
        for (i=0; aliases && aliases[i]; i++) {
                if (strcasecmp(name, aliases[i]) == 0) {
                        return True;
@@ -72,7 +72,7 @@ _PUBLIC_ char *lock_path(TALLOC_CTX* mem_ctx, const char *name)
                return talloc_strdup(mem_ctx, name);
        }
 
-       dname = talloc_strdup(mem_ctx, lp_lockdir());
+       dname = talloc_strdup(mem_ctx, lp_lockdir(global_loadparm));
        trim_string(dname,"","/");
        
        if (!directory_exist(dname)) {
@@ -94,7 +94,7 @@ static char *pid_path(TALLOC_CTX* mem_ctx, const char *name)
 {
        char *fname, *dname;
 
-       dname = talloc_strdup(mem_ctx, lp_piddir());
+       dname = talloc_strdup(mem_ctx, lp_piddir(global_loadparm));
        trim_string(dname,"","/");
        
        if (!directory_exist(dname)) {
@@ -135,7 +135,7 @@ _PUBLIC_ char *data_path(TALLOC_CTX* mem_ctx, const char *name)
 _PUBLIC_ char *config_path(TALLOC_CTX* mem_ctx, const char *name)
 {
        char *fname, *config_dir, *p;
-       config_dir = talloc_strdup(mem_ctx, lp_configfile());
+       config_dir = talloc_strdup(mem_ctx, lp_configfile(global_loadparm));
        p = strrchr(config_dir, '/');
        if (!p) {
                return NULL;
@@ -163,7 +163,7 @@ _PUBLIC_ char *private_path(TALLOC_CTX* mem_ctx, const char *name)
        if (name[0] == 0 || name[0] == '/' || strstr(name, ":/")) {
                return talloc_strdup(mem_ctx, name);
        }
-       fname = talloc_asprintf(mem_ctx, "%s/%s", lp_private_dir(), name);
+       fname = talloc_asprintf(mem_ctx, "%s/%s", lp_private_dir(global_loadparm), name);
        return fname;
 }
 
@@ -280,7 +280,7 @@ static char *modules_path(TALLOC_CTX* mem_ctx, const char *name)
 {
        const char *env_moduledir = getenv("LD_SAMBA_MODULE_PATH");
        return talloc_asprintf(mem_ctx, "%s/%s", 
-                                                  env_moduledir?env_moduledir:lp_modulesdir(), 
+                                                  env_moduledir?env_moduledir:lp_modulesdir(global_loadparm), 
                                                   name);
 }
 
index 8848dcd1df04d4d97901aaf9358ecee0c7c94cbf..a046f1e29f8e13154277e1a0e686165deb61363e 100644 (file)
@@ -47,7 +47,7 @@ _PUBLIC_ const char *dcesrv_common_get_server_name(TALLOC_CTX *mem_ctx, struct d
 
        /* if there's no string return our NETBIOS name */
        if (!p) {
-               return talloc_strdup(mem_ctx, lp_netbios_name());
+               return talloc_strdup(mem_ctx, lp_netbios_name(global_loadparm));
        }
 
        /* if there're '\\\\' in front remove them otherwise just pass the string */
@@ -60,7 +60,7 @@ _PUBLIC_ const char *dcesrv_common_get_server_name(TALLOC_CTX *mem_ctx, struct d
 
 const char *dcesrv_common_get_domain_name(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx)
 {
-       return talloc_strdup(mem_ctx, lp_workgroup());
+       return talloc_strdup(mem_ctx, lp_workgroup(global_loadparm));
 }
 
 /* This hardcoded value should go into a ldb database! */
@@ -89,7 +89,7 @@ _PUBLIC_ uint32_t dcesrv_common_get_server_type(TALLOC_CTX *mem_ctx, struct dces
        default_server_announce |= SV_TYPE_SERVER;
        default_server_announce |= SV_TYPE_SERVER_UNIX;
 
-       switch (lp_announce_as()) {
+       switch (lp_announce_as(global_loadparm)) {
                case ANNOUNCE_AS_NT_SERVER:
                        default_server_announce |= SV_TYPE_SERVER_NT;
                        /* fall through... */
@@ -106,7 +106,7 @@ _PUBLIC_ uint32_t dcesrv_common_get_server_type(TALLOC_CTX *mem_ctx, struct dces
                        break;
        }
 
-       switch (lp_server_role()) {
+       switch (lp_server_role(global_loadparm)) {
                case ROLE_DOMAIN_MEMBER:
                        default_server_announce |= SV_TYPE_DOMAIN_MEMBER;
                        break;
@@ -138,10 +138,10 @@ _PUBLIC_ uint32_t dcesrv_common_get_server_type(TALLOC_CTX *mem_ctx, struct dces
                default:
                        break;
        }
-       if (lp_time_server())
+       if (lp_time_server(global_loadparm))
                default_server_announce |= SV_TYPE_TIME_SOURCE;
 
-       if (lp_host_msdfs())
+       if (lp_host_msdfs(global_loadparm))
                default_server_announce |= SV_TYPE_DFS_SERVER;
 
 
index c3de00d8d0c87135062b0cb5cc6eac14285babab..02f38a15fd304600ca2d5647ff3ceb8f62491aa1 100644 (file)
@@ -390,7 +390,7 @@ static void dcesrv_init_hdr(struct ncacn_packet *pkt)
 {
        pkt->rpc_vers = 5;
        pkt->rpc_vers_minor = 0;
-       if (lp_rpc_big_endian()) {
+       if (lp_rpc_big_endian(global_loadparm)) {
                pkt->drep[0] = 0;
        } else {
                pkt->drep[0] = DCERPC_DREP_LE;
@@ -892,7 +892,7 @@ _PUBLIC_ NTSTATUS dcesrv_reply(struct dcesrv_call_state *call)
           pointers */
        push->ptr_count = call->ndr_pull->ptr_count;
 
-       if (lp_rpc_big_endian()) {
+       if (lp_rpc_big_endian(global_loadparm)) {
                push->flags |= LIBNDR_FLAG_BIGENDIAN;
        }
 
@@ -1372,7 +1372,7 @@ _PUBLIC_ NTSTATUS dcesrv_init_ipc_context(TALLOC_CTX *mem_ctx, struct dcesrv_con
        NTSTATUS status;
        struct dcesrv_context *dce_ctx;
 
-       status = dcesrv_init_context(mem_ctx, lp_dcerpc_endpoint_servers(), &dce_ctx);
+       status = dcesrv_init_context(mem_ctx, lp_dcerpc_endpoint_servers(global_loadparm), &dce_ctx);
        NT_STATUS_NOT_OK_RETURN(status);
 
        *_dce_ctx = dce_ctx;
index 49a4c3de13e381b20b2cc0274ce52d9ee8e00323..0843a4376151d84433f615940aa509d31208e2d0 100644 (file)
@@ -25,6 +25,7 @@
 #include "librpc/gen_ndr/ndr_dcerpc.h"
 #include "auth/credentials/credentials.h"
 #include "auth/gensec/gensec.h"
+#include "param/param.h"
 
 /*
   parse any auth information from a dcerpc bind request
@@ -70,7 +71,7 @@ BOOL dcesrv_auth_bind(struct dcesrv_call_state *call)
                return False;
        }
        
-       cli_credentials_set_conf(server_credentials);
+       cli_credentials_set_conf(server_credentials, global_loadparm);
        status = cli_credentials_set_machine_account(server_credentials);
        if (!NT_STATUS_IS_OK(status)) {
                DEBUG(10, ("Failed to obtain server credentials, perhaps a standalone server?: %s\n", nt_errstr(status)));
index 8a695bdedf59e103408feb852f15a070b5a9bf26..a580487b6f5d9b3c6962b4868572b0b5f3d7a57c 100644 (file)
@@ -262,7 +262,7 @@ static WERROR dcesrv_dssetup_DsRoleGetPrimaryDomainInformation(struct dcesrv_cal
 
                ZERO_STRUCT(domain_guid);
 
-               switch (lp_server_role()) {
+               switch (lp_server_role(global_loadparm)) {
                case ROLE_STANDALONE:
                        role            = DS_ROLE_STANDALONE_SERVER;
                        break;
@@ -278,13 +278,13 @@ static WERROR dcesrv_dssetup_DsRoleGetPrimaryDomainInformation(struct dcesrv_cal
                        break;
                }
 
-               switch (lp_server_role()) {
+               switch (lp_server_role(global_loadparm)) {
                case ROLE_STANDALONE:
-                       domain          = talloc_strdup(mem_ctx, lp_workgroup());
+                       domain          = talloc_strdup(mem_ctx, lp_workgroup(global_loadparm));
                        W_ERROR_HAVE_NO_MEMORY(domain);
                        break;
                case ROLE_DOMAIN_MEMBER:
-                       domain          = talloc_strdup(mem_ctx, lp_workgroup());
+                       domain          = talloc_strdup(mem_ctx, lp_workgroup(global_loadparm));
                        W_ERROR_HAVE_NO_MEMORY(domain);
                        /* TODO: what is with dns_domain and forest and guid? */
                        break;
index 14a724a6f681620470d64ca16054d33076110053..2d551da4d110f744469f2988ee75e543cb6367fc 100644 (file)
@@ -165,7 +165,7 @@ static NTSTATUS dcesrv_netr_ServerAuthenticate3(struct dcesrv_call_state *dce_ca
        creds->account_name = talloc_steal(creds, r->in.account_name);
        
        creds->computer_name = talloc_steal(creds, r->in.computer_name);
-       creds->domain = talloc_strdup(creds, lp_workgroup());
+       creds->domain = talloc_strdup(creds, lp_workgroup(global_loadparm));
 
        creds->secure_channel_type = r->in.secure_channel_type;
 
@@ -259,7 +259,8 @@ static NTSTATUS dcesrv_netr_creds_server_step_check(const char *computer_name,
         * disconnects) we must update the database every time we
         * update the structure */ 
        
-       nt_status = schannel_fetch_session_key_ldb(ldb, ldb, computer_name, lp_workgroup(),
+       nt_status = schannel_fetch_session_key_ldb(ldb, ldb, computer_name, 
+                                                  lp_workgroup(global_loadparm),
                                                   &creds);
        if (NT_STATUS_IS_OK(nt_status)) {
                nt_status = creds_server_step_check(creds, 
@@ -528,7 +529,7 @@ static NTSTATUS dcesrv_netr_LogonSamLogon_base(struct dcesrv_call_state *dce_cal
                sam6 = talloc_zero(mem_ctx, struct netr_SamInfo6);
                NT_STATUS_HAVE_NO_MEMORY(sam6);
                sam6->base = *sam;
-               sam6->forest.string = lp_realm();
+               sam6->forest.string = lp_realm(global_loadparm);
                sam6->principle.string = talloc_asprintf(mem_ctx, "%s@%s", 
                                                         sam->account_name.string, sam6->forest.string);
                NT_STATUS_HAVE_NO_MEMORY(sam6->principle.string);
@@ -552,7 +553,7 @@ static NTSTATUS dcesrv_netr_LogonSamLogonEx(struct dcesrv_call_state *dce_call,
 {
        NTSTATUS nt_status;
        struct creds_CredentialState *creds;
-       nt_status = schannel_fetch_session_key(mem_ctx, r->in.computer_name, lp_workgroup(), &creds);
+       nt_status = schannel_fetch_session_key(mem_ctx, r->in.computer_name, lp_workgroup(global_loadparm), &creds);
        if (!NT_STATUS_IS_OK(nt_status)) {
                return nt_status;
        }
@@ -1004,7 +1005,9 @@ static WERROR dcesrv_netr_DsRGetDCNameEx2(struct dcesrv_call_state *dce_call, TA
        /* TODO: - return real IP address
         *       - check all r->in.* parameters (server_unc is ignored by w2k3!)
         */
-       r->out.info->dc_unc             = talloc_asprintf(mem_ctx, "\\\\%s.%s", lp_netbios_name(),lp_realm());
+       r->out.info->dc_unc             = talloc_asprintf(mem_ctx, "\\\\%s.%s", 
+                                                         lp_netbios_name(global_loadparm), 
+                                                         lp_realm(global_loadparm));
        W_ERROR_HAVE_NO_MEMORY(r->out.info->dc_unc);
        r->out.info->dc_address         = talloc_strdup(mem_ctx, "\\\\0.0.0.0");
        W_ERROR_HAVE_NO_MEMORY(r->out.info->dc_address);
index 2b481919d12de72e419a34f702126e8b5690ae77..7434a32128c57ba81d03273223d489a6e2298aab 100644 (file)
@@ -76,7 +76,7 @@ static NTSTATUS remote_op_bind(struct dcesrv_call_state *dce_call, const struct
                if (!credentials) {
                        return NT_STATUS_NO_MEMORY;
                }
-               cli_credentials_set_conf(credentials);
+               cli_credentials_set_conf(credentials, global_loadparm);
                cli_credentials_set_username(credentials, user, CRED_SPECIFIED);
                if (domain) {
                        cli_credentials_set_domain(credentials, domain, CRED_SPECIFIED);
@@ -85,7 +85,7 @@ static NTSTATUS remote_op_bind(struct dcesrv_call_state *dce_call, const struct
        } else if (machine_account) {
                DEBUG(5, ("dcerpc_remote: RPC Proxy: Using machine account\n"));
                credentials = cli_credentials_init(private);
-               cli_credentials_set_conf(credentials);
+               cli_credentials_set_conf(credentials, global_loadparm);
                if (domain) {
                        cli_credentials_set_domain(credentials, domain, CRED_SPECIFIED);
                }
index 475925e8659a5279ce242f570cd0919978377b63..0ec979b81f3f5364de17bb8e23ba995d3703f5d3 100644 (file)
@@ -498,7 +498,7 @@ static NTSTATUS dcesrv_samr_info_DomInfo2(struct samr_domain_state *state, TALLO
                                    struct ldb_message **dom_msgs,
                                   struct samr_DomInfo2 *info)
 {
-       enum server_role role = lp_server_role();
+       enum server_role role = lp_server_role(global_loadparm);
 
        /* This pulls the NetBIOS name from the 
           cn=NTDS Settings,cn=<NETBIOS name of PDC>,....
@@ -611,7 +611,7 @@ static NTSTATUS dcesrv_samr_info_DomInfo7(struct samr_domain_state *state,
                                   struct samr_DomInfo7 *info)
 {
 
-       enum server_role role = lp_server_role();
+       enum server_role role = lp_server_role(global_loadparm);
 
        switch (role) {
        case ROLE_DOMAIN_CONTROLLER:
index 6875ff88ff94cf8470ed0cfd68ed58a786db8a36..62666b09baa9a94e3137f40b38f03f2880b6c39d 100644 (file)
@@ -256,7 +256,8 @@ static NTSTATUS dcesrv_add_ep_ncalrpc(struct dcesrv_context *dce_ctx, struct dce
                e->ep_description->endpoint = talloc_strdup(dce_ctx, "DEFAULT");
        }
 
-       full_path = talloc_asprintf(dce_ctx, "%s/%s", lp_ncalrpc_dir(), e->ep_description->endpoint);
+       full_path = talloc_asprintf(dce_ctx, "%s/%s", lp_ncalrpc_dir(global_loadparm), 
+                                   e->ep_description->endpoint);
 
        dcesrv_sock = talloc(event_ctx, struct dcesrv_socket_context);
        NT_STATUS_HAVE_NO_MEMORY(dcesrv_sock);
@@ -362,7 +363,7 @@ static NTSTATUS dcesrv_add_ep_tcp(struct dcesrv_context *dce_ctx, struct dcesrv_
        NTSTATUS status;
 
        /* Add TCP/IP sockets */
-       if (lp_interfaces() && lp_bind_interfaces_only()) {
+       if (lp_interfaces(global_loadparm) && lp_bind_interfaces_only(global_loadparm)) {
                int num_interfaces = iface_count();
                int i;
                for(i = 0; i < num_interfaces; i++) {
@@ -371,7 +372,8 @@ static NTSTATUS dcesrv_add_ep_tcp(struct dcesrv_context *dce_ctx, struct dcesrv_
                        NT_STATUS_NOT_OK_RETURN(status);
                }
        } else {
-               status = add_socket_rpc_tcp_iface(dce_ctx, e, event_ctx, model_ops, lp_socket_address());
+               status = add_socket_rpc_tcp_iface(dce_ctx, e, event_ctx, model_ops, 
+                                                 lp_socket_address(global_loadparm));
                NT_STATUS_NOT_OK_RETURN(status);
        }
 
@@ -412,13 +414,13 @@ static void dcesrv_task_init(struct task_server *task)
        task_server_set_title(task, "task[dcesrv]");
 
        status = dcesrv_init_context(task->event_ctx,
-                                    lp_dcerpc_endpoint_servers(),
+                                    lp_dcerpc_endpoint_servers(global_loadparm),
                                     &dce_ctx);
        if (!NT_STATUS_IS_OK(status)) goto failed;
 
        /* Make sure the directory for NCALRPC exists */
-       if (!directory_exist(lp_ncalrpc_dir())) {
-               mkdir(lp_ncalrpc_dir(), 0755);
+       if (!directory_exist(lp_ncalrpc_dir(global_loadparm))) {
+               mkdir(lp_ncalrpc_dir(global_loadparm), 0755);
        }
 
        for (e=dce_ctx->endpoint_list;e;e=e->next) {
index d6c8d864aacd90e408d6219f55654c04f50680e3..3d7a5319ca41b8b1a6e07eda815adacf1ffc981d 100644 (file)
@@ -174,10 +174,10 @@ static WERROR dcesrv_spoolss_check_server_name(struct dcesrv_call_state *dce_cal
        server_name += 2;
 
        /* NETBIOS NAME is ok */
-       ret = strequal(lp_netbios_name(), server_name);
+       ret = strequal(lp_netbios_name(global_loadparm), server_name);
        if (ret) return WERR_OK;
 
-       aliases = lp_netbios_aliases();
+       aliases = lp_netbios_aliases(global_loadparm);
 
        for (i=0; aliases && aliases[i]; i++) {
                if (strequal(aliases[i], server_name)) {
@@ -188,12 +188,12 @@ static WERROR dcesrv_spoolss_check_server_name(struct dcesrv_call_state *dce_cal
        /* DNS NAME is ok
         * TODO: we need to check if aliases are also ok
         */
-       if (lp_realm()) {
+       if (lp_realm(global_loadparm)) {
                char *str;
 
                str = talloc_asprintf(mem_ctx, "%s.%s",
-                                               lp_netbios_name(),
-                                               lp_realm());
+                                               lp_netbios_name(global_loadparm),
+                                               lp_realm(global_loadparm));
                W_ERROR_HAVE_NO_MEMORY(str);
 
                ret = strequal(str, server_name);
@@ -216,7 +216,7 @@ static NTSTATUS dcerpc_spoolss_bind(struct dcesrv_call_state *dce_call, const st
        NTSTATUS status;
        struct ntptr_context *ntptr;
 
-       status = ntptr_init_context(dce_call->context, lp_ntptr_providor(), &ntptr);
+       status = ntptr_init_context(dce_call->context, lp_ntptr_providor(global_loadparm), &ntptr);
        NT_STATUS_NOT_OK_RETURN(status);
 
        dce_call->context->private = ntptr;
@@ -1163,7 +1163,7 @@ static WERROR dcesrv_spoolss_RemoteFindFirstPrinterChangeNotifyEx(struct dcesrv_
        }
 
        ZERO_STRUCT(rop);
-       rop.in.server_name = lp_netbios_name();
+       rop.in.server_name = lp_netbios_name(global_loadparm);
        W_ERROR_HAVE_NO_MEMORY(rop.in.server_name);
        rop.in.printer_local = 0;
        rop.in.type = REG_NONE;
index 6e8732f7882bbda8d974f1712dfa83717e54b2d5..aee88d915ccf927d9b46465587468945d3aa5b19 100644 (file)
@@ -1499,7 +1499,7 @@ static WERROR dcesrv_srvsvc_NetSrvGetInfo(struct dcesrv_call_state *dce_call, TA
                info101->version_major  = dcesrv_common_get_version_major(mem_ctx, dce_ctx);
                info101->version_minor  = dcesrv_common_get_version_minor(mem_ctx, dce_ctx);
                info101->server_type    = dcesrv_common_get_server_type(mem_ctx, dce_ctx);
-               info101->comment        = talloc_strdup(mem_ctx, lp_serverstring());
+               info101->comment        = talloc_strdup(mem_ctx, lp_serverstring(global_loadparm));
                W_ERROR_HAVE_NO_MEMORY(info101->comment);
 
                r->out.info.info101 = info101;
@@ -1519,7 +1519,7 @@ static WERROR dcesrv_srvsvc_NetSrvGetInfo(struct dcesrv_call_state *dce_call, TA
                info102->version_major  = dcesrv_common_get_version_major(mem_ctx, dce_ctx);
                info102->version_minor  = dcesrv_common_get_version_minor(mem_ctx, dce_ctx);
                info102->server_type    = dcesrv_common_get_server_type(mem_ctx, dce_ctx);
-               info102->comment        = talloc_strdup(mem_ctx, lp_serverstring());
+               info102->comment        = talloc_strdup(mem_ctx, lp_serverstring(global_loadparm));
                W_ERROR_HAVE_NO_MEMORY(info102->comment);
 
                info102->users          = dcesrv_common_get_users(mem_ctx, dce_ctx);
index 5c4f71e8a4c0aa0edae56c44b316e66e76233ae0..5e434d843acf090d303bd3f1c0971c72aec882c7 100755 (executable)
@@ -142,7 +142,7 @@ sub handle_loadparm($$)
                            );
 
                my %smap = (
-                           "GLOBAL" => "void",
+                           "GLOBAL" => "struct loadparm_context *",
                            "LOCAL" => "struct loadparm_service *"
                            );
 
index a2a382108295c2975d24c34b4bee36498f8aeab6..5fdfe51887fb4572e93f19fc45c5443448b5a234 100644 (file)
@@ -68,7 +68,7 @@ static int ejs_net_context(MprVarHandle eid, int argc, struct MprVar **argv)
                        talloc_free(ctx);
                        return -1;
                }
-               cli_credentials_set_conf(creds);
+               cli_credentials_set_conf(creds, global_loadparm);
                cli_credentials_set_anonymous(creds);
 
                mprCreds = mprCredentials(creds);
index 3cb860b9e3a01b609a44775aeb6ecae7707ed5ad..91e58873df28a1ad996cf0488381214e02f59158 100644 (file)
@@ -111,7 +111,7 @@ static int ejs_typeof_native(MprVarHandle eid, int argc, struct MprVar **argv)
 static int ejs_libinclude(int eid, int argc, char **argv)
 {
        int i, j;
-       const char **js_include = lp_js_include();
+       const char **js_include = lp_js_include(global_loadparm);
 
        if (js_include == NULL || js_include[0] == NULL) {
                ejsSetErrorMsg(eid, "js include path not set");
index 02b948182a23f3336de5e6fc2df1110533dd2244..af86be94324661a247c5eb7b6c28a45f5abd170d 100644 (file)
@@ -431,7 +431,7 @@ static int ejs_tree_connect(MprVarHandle eid, int argc, char **argv)
        /* Set up credentials */
 
        creds = cli_credentials_init(NULL);
-       cli_credentials_set_conf(creds);
+       cli_credentials_set_conf(creds, global_loadparm);
        cli_credentials_parse_string(creds, argv[1], CRED_SPECIFIED);
 
        /* Do connect */
@@ -443,7 +443,7 @@ static int ejs_tree_connect(MprVarHandle eid, int argc, char **argv)
        io.in.service_type           = "?????";
        io.in.credentials            = creds;
        io.in.fallback_to_anonymous  = False;
-       io.in.workgroup              = lp_workgroup();
+       io.in.workgroup              = lp_workgroup(global_loadparm);
 
        result = smb_composite_connect(&io, mem_ctx, NULL);
        tree = io.out.tree;
index f488b0745ff966aabfc6bc9b10cd3e63b59bfa51..45c197834a25f580c299bbdb5a642906ee5cdeb6 100644 (file)
@@ -211,7 +211,7 @@ static int ejs_lpSet(MprVarHandle eid, int argc, char **argv)
 */
 static int ejs_lpReload(MprVarHandle eid, int argc, char **argv)
 {
-       BOOL ret = lp_load();
+       BOOL ret = lp_load(lp_configfile(global_loadparm));
        if (ret) {
                unload_interfaces();
        }
index b469f2c9fe84dd1723723d137512d720aced8603..730753d158fa30711b3af3dcb25fb820451dee8b 100644 (file)
@@ -248,7 +248,7 @@ static int ejs_credentials_init(MprVarHandle eid, int argc, struct MprVar **argv
                return -1;
        }
 
-       cli_credentials_set_conf(creds);
+       cli_credentials_set_conf(creds, global_loadparm);
 
        return ejs_credentials_obj(obj, creds);
 }
index 9f7e048fc09250e90eb27cb74a3fd96e99731422..29ce763f96667931cd72a97e1613cfcfeb142674 100644 (file)
@@ -26,6 +26,7 @@
 #include "scripting/ejs/smbcalls.h"
 #include "auth/gensec/gensec.h"
 #include "ldb/include/ldb.h"
+#include "dynconfig.h"
 
 static EjsId eid;
 
@@ -52,7 +53,9 @@ int main(int argc, const char **argv)
        fault_setup(argv[0]);
 
        if (getenv("SMB_CONF_PATH")) {
-               lp_set_cmdline(global_loadparm, "config file", getenv("SMB_CONF_PATH"));
+               lp_load(getenv("SMB_CONF_PATH"));
+       } else {
+               lp_load(dyn_CONFIGFILE);
        }
 
        ldb_global_init();
@@ -60,7 +63,6 @@ int main(int argc, const char **argv)
        gensec_init();
        mprSetCtx(mem_ctx);
 
-       lp_load();
 
        if (argc < 2) {
                fprintf(stderr, "You must supply a script name\n");
index f5ae0aa507811591f3438e04875545b1990ec69e..a35f86367b9aed2007064dd070df9371225949e4 100644 (file)
@@ -91,7 +91,7 @@ this any more it probably doesn't matter
 ****************************************************************************/
 static void reply_coreplus(struct smbsrv_request *req, uint16_t choice)
 {
-       uint16_t raw = (lp_readraw()?1:0) | (lp_writeraw()?2:0);
+       uint16_t raw = (lp_readraw(global_loadparm)?1:0) | (lp_writeraw(global_loadparm)?2:0);
 
        smbsrv_setup_reply(req, 13, 0);
 
@@ -122,13 +122,13 @@ static void reply_coreplus(struct smbsrv_request *req, uint16_t choice)
 ****************************************************************************/
 static void reply_lanman1(struct smbsrv_request *req, uint16_t choice)
 {
-       int raw = (lp_readraw()?1:0) | (lp_writeraw()?2:0);
+       int raw = (lp_readraw(global_loadparm)?1:0) | (lp_writeraw(global_loadparm)?2:0);
        int secword=0;
        time_t t = req->request_time.tv_sec;
 
-       req->smb_conn->negotiate.encrypted_passwords = lp_encrypted_passwords();
+       req->smb_conn->negotiate.encrypted_passwords = lp_encrypted_passwords(global_loadparm);
 
-       if (lp_security() != SEC_SHARE)
+       if (lp_security(global_loadparm) != SEC_SHARE)
                secword |= NEGOTIATE_SECURITY_USER_LEVEL;
 
        if (req->smb_conn->negotiate.encrypted_passwords)
@@ -145,7 +145,7 @@ static void reply_lanman1(struct smbsrv_request *req, uint16_t choice)
        SSVAL(req->out.vwv, VWV(0), choice);
        SSVAL(req->out.vwv, VWV(1), secword); 
        SSVAL(req->out.vwv, VWV(2), req->smb_conn->negotiate.max_recv);
-       SSVAL(req->out.vwv, VWV(3), lp_maxmux());
+       SSVAL(req->out.vwv, VWV(3), lp_maxmux(global_loadparm));
        SSVAL(req->out.vwv, VWV(4), 1);
        SSVAL(req->out.vwv, VWV(5), raw); 
        SIVAL(req->out.vwv, VWV(6), req->smb_conn->connection->server_id.id);
@@ -180,13 +180,13 @@ static void reply_lanman1(struct smbsrv_request *req, uint16_t choice)
 ****************************************************************************/
 static void reply_lanman2(struct smbsrv_request *req, uint16_t choice)
 {
-       int raw = (lp_readraw()?1:0) | (lp_writeraw()?2:0);
+       int raw = (lp_readraw(global_loadparm)?1:0) | (lp_writeraw(global_loadparm)?2:0);
        int secword=0;
        time_t t = req->request_time.tv_sec;
 
-       req->smb_conn->negotiate.encrypted_passwords = lp_encrypted_passwords();
+       req->smb_conn->negotiate.encrypted_passwords = lp_encrypted_passwords(global_loadparm);
   
-       if (lp_security() != SEC_SHARE)
+       if (lp_security(global_loadparm) != SEC_SHARE)
                secword |= NEGOTIATE_SECURITY_USER_LEVEL;
 
        if (req->smb_conn->negotiate.encrypted_passwords)
@@ -199,7 +199,7 @@ static void reply_lanman2(struct smbsrv_request *req, uint16_t choice)
        SSVAL(req->out.vwv, VWV(0), choice);
        SSVAL(req->out.vwv, VWV(1), secword); 
        SSVAL(req->out.vwv, VWV(2), req->smb_conn->negotiate.max_recv);
-       SSVAL(req->out.vwv, VWV(3), lp_maxmux());
+       SSVAL(req->out.vwv, VWV(3), lp_maxmux(global_loadparm));
        SSVAL(req->out.vwv, VWV(4), 1);
        SSVAL(req->out.vwv, VWV(5), raw); 
        SIVAL(req->out.vwv, VWV(6), req->smb_conn->connection->server_id.id);
@@ -214,7 +214,7 @@ static void reply_lanman2(struct smbsrv_request *req, uint16_t choice)
                get_challenge(req->smb_conn, req->out.data);
        }
 
-       req_push_str(req, NULL, lp_workgroup(), -1, STR_TERMINATE);
+       req_push_str(req, NULL, lp_workgroup(global_loadparm), -1, STR_TERMINATE);
 
        if (req->smb_conn->signing.mandatory_signing) {
                smbsrv_terminate_connection(req->smb_conn, 
@@ -236,8 +236,8 @@ static void reply_nt1_orig(struct smbsrv_request *req)
                req->out.ptr += 8;
                SCVAL(req->out.vwv+1, VWV(16), 8);
        }
-       req_push_str(req, NULL, lp_workgroup(), -1, STR_UNICODE|STR_TERMINATE|STR_NOALIGN);
-       req_push_str(req, NULL, lp_netbios_name(), -1, STR_UNICODE|STR_TERMINATE|STR_NOALIGN);
+       req_push_str(req, NULL, lp_workgroup(global_loadparm), -1, STR_UNICODE|STR_TERMINATE|STR_NOALIGN);
+       req_push_str(req, NULL, lp_netbios_name(global_loadparm), -1, STR_UNICODE|STR_TERMINATE|STR_NOALIGN);
        DEBUG(3,("not using extended security (SPNEGO or NTLMSSP)\n"));
 }
 
@@ -260,24 +260,24 @@ static void reply_nt1(struct smbsrv_request *req, uint16_t choice)
                CAP_NT_FIND | CAP_LOCK_AND_READ | 
                CAP_LEVEL_II_OPLOCKS | CAP_NT_SMBS | CAP_RPC_REMOTE_APIS;
 
-       req->smb_conn->negotiate.encrypted_passwords = lp_encrypted_passwords();
+       req->smb_conn->negotiate.encrypted_passwords = lp_encrypted_passwords(global_loadparm);
 
        /* do spnego in user level security if the client
           supports it and we can do encrypted passwords */
        
        if (req->smb_conn->negotiate.encrypted_passwords && 
-           (lp_security() != SEC_SHARE) &&
-           lp_use_spnego() &&
+           (lp_security(global_loadparm) != SEC_SHARE) &&
+           lp_use_spnego(global_loadparm) &&
            (req->flags2 & FLAGS2_EXTENDED_SECURITY)) {
                negotiate_spnego = True; 
                capabilities |= CAP_EXTENDED_SECURITY;
        }
        
-       if (lp_unix_extensions()) {
+       if (lp_unix_extensions(global_loadparm)) {
                capabilities |= CAP_UNIX;
        }
        
-       if (lp_large_readwrite()) {
+       if (lp_large_readwrite(global_loadparm)) {
                capabilities |= CAP_LARGE_READX | CAP_LARGE_WRITEX | CAP_W2K_SMBS;
        }
 
@@ -286,24 +286,24 @@ static void reply_nt1(struct smbsrv_request *req, uint16_t choice)
                capabilities |= CAP_LARGE_FILES;
        }
 
-       if (lp_readraw() && lp_writeraw()) {
+       if (lp_readraw(global_loadparm) && lp_writeraw(global_loadparm)) {
                capabilities |= CAP_RAW_MODE;
        }
        
        /* allow for disabling unicode */
-       if (lp_unicode()) {
+       if (lp_unicode(global_loadparm)) {
                capabilities |= CAP_UNICODE;
        }
 
-       if (lp_nt_status_support()) {
+       if (lp_nt_status_support(global_loadparm)) {
                capabilities |= CAP_STATUS32;
        }
        
-       if (lp_host_msdfs()) {
+       if (lp_host_msdfs(global_loadparm)) {
                capabilities |= CAP_DFS;
        }
        
-       if (lp_security() != SEC_SHARE) {
+       if (lp_security(global_loadparm) != SEC_SHARE) {
                secword |= NEGOTIATE_SECURITY_USER_LEVEL;
        }
 
@@ -330,7 +330,7 @@ static void reply_nt1(struct smbsrv_request *req, uint16_t choice)
           this is the one and only SMB packet that is malformed in
           the specification - all the command words after the secword
           are offset by 1 byte */
-       SSVAL(req->out.vwv+1, VWV(1), lp_maxmux());
+       SSVAL(req->out.vwv+1, VWV(1), lp_maxmux(global_loadparm));
        SSVAL(req->out.vwv+1, VWV(2), 1); /* num vcs */
        SIVAL(req->out.vwv+1, VWV(3), req->smb_conn->negotiate.max_recv);
        SIVAL(req->out.vwv+1, VWV(5), 0x10000); /* raw size. full 64k */
@@ -371,7 +371,7 @@ static void reply_nt1(struct smbsrv_request *req, uint16_t choice)
                        return;
                }
                
-               cli_credentials_set_conf(server_credentials);
+               cli_credentials_set_conf(server_credentials, global_loadparm);
                nt_status = cli_credentials_set_machine_account(server_credentials);
                if (!NT_STATUS_IS_OK(nt_status)) {
                        DEBUG(10, ("Failed to obtain server credentials, perhaps a standalone server?: %s\n", nt_errstr(nt_status)));
@@ -517,8 +517,10 @@ void smbsrv_reply_negprot(struct smbsrv_request *req)
        for (protocol = 0; supported_protocols[protocol].proto_name; protocol++) {
                int i;
 
-               if (supported_protocols[protocol].protocol_level > lp_srv_maxprotocol()) continue;
-               if (supported_protocols[protocol].protocol_level < lp_srv_minprotocol()) continue;
+               if (supported_protocols[protocol].protocol_level > lp_srv_maxprotocol(global_loadparm)) 
+                       continue;
+               if (supported_protocols[protocol].protocol_level < lp_srv_minprotocol(global_loadparm)) 
+                       continue;
 
                for (i = 0; i < protos_count; i++) {
                        if (strcmp(supported_protocols[protocol].proto_name, protos[i]) != 0) continue;
index b29b86e6ea63e61c30ef35d16668db6b88d615ff..973b6b993ebb3cf7e9294bdc0bd58ac635884e7c 100644 (file)
@@ -652,12 +652,12 @@ NTSTATUS smbsrv_init_smb_connection(struct smbsrv_connection *smb_conn)
 
        /* this is the size that w2k uses, and it appears to be important for
           good performance */
-       smb_conn->negotiate.max_recv = lp_max_xmit();
+       smb_conn->negotiate.max_recv = lp_max_xmit(global_loadparm);
 
        smb_conn->negotiate.zone_offset = get_time_zone(time(NULL));
 
-       smb_conn->config.security = lp_security();
-       smb_conn->config.nt_status_support = lp_nt_status_support();
+       smb_conn->config.security = lp_security(global_loadparm);
+       smb_conn->config.nt_status_support = lp_nt_status_support(global_loadparm);
 
        status = smbsrv_init_sessions(smb_conn, UINT16_MAX);
        NT_STATUS_NOT_OK_RETURN(status);
index 8a99223d8b5ef568788a34a0d04781b9edce0147..558f30307b4ebea73d40a367323c9d82467a891b 100644 (file)
@@ -201,7 +201,7 @@ NTSTATUS smbsrv_tcon_backend(struct smbsrv_request *req, union smb_tcon *con)
        con->tconx.out.dev_type = talloc_strdup(req, req->tcon->ntvfs->dev_type);
        con->tconx.out.fs_type = talloc_strdup(req, req->tcon->ntvfs->fs_type);
        con->tconx.out.options = SMB_SUPPORT_SEARCH_BITS | (share_int_option(req->tcon->ntvfs->config, SHARE_CSC_POLICY, SHARE_CSC_POLICY_DEFAULT) << 2);
-       if (share_bool_option(req->tcon->ntvfs->config, SHARE_MSDFS_ROOT, SHARE_MSDFS_ROOT_DEFAULT) && lp_host_msdfs()) {
+       if (share_bool_option(req->tcon->ntvfs->config, SHARE_MSDFS_ROOT, SHARE_MSDFS_ROOT_DEFAULT) && lp_host_msdfs(global_loadparm)) {
                con->tconx.out.options |= SMB_SHARE_IN_DFS;
        }
 
index b3664ab7fe0264086c44421b9a1a1755a102b154..29d14016e7737a182df79406203d8c1b322a45f6 100644 (file)
@@ -40,7 +40,7 @@ static void sesssetup_common_strings(struct smbsrv_request *req,
 {
        (*os) = talloc_asprintf(req, "Unix");
        (*lanman) = talloc_asprintf(req, "Samba %s", SAMBA_VERSION_STRING);
-       (*domain) = talloc_asprintf(req, "%s", lp_workgroup());
+       (*domain) = talloc_asprintf(req, "%s", lp_workgroup(global_loadparm));
 }
 
 static void smbsrv_sesssetup_backend_send(struct smbsrv_request *req,
index 120bc01c3e5e6bfdfd848add1bf02cc25396b444..eaffaa33dd341f1221b2cb6d3f1548ae6357e887 100644 (file)
@@ -102,7 +102,7 @@ BOOL smbsrv_init_signing(struct smbsrv_connection *smb_conn)
                return False;
        }
        
-       switch (lp_server_signing()) {
+       switch (lp_server_signing(global_loadparm)) {
        case SMB_SIGNING_OFF:
                smb_conn->signing.allow_smb_signing = False;
                break;
@@ -114,7 +114,7 @@ BOOL smbsrv_init_signing(struct smbsrv_connection *smb_conn)
                smb_conn->signing.mandatory_signing = True;
                break;
        case SMB_SIGNING_AUTO:
-               if (lp_domain_logons()) {
+               if (lp_domain_logons(global_loadparm)) {
                        smb_conn->signing.allow_smb_signing = True;
                } else {
                        smb_conn->signing.allow_smb_signing = False;
index 8aa652e27ee02949fb8a2c18d27a724057feb947..3035f77396857c552a30f8327a7cdb5920f0e2fd 100644 (file)
@@ -27,6 +27,7 @@
 #include "smb_server/service_smb_proto.h"
 #include "smb_server/smb2/smb2_server.h"
 #include "smbd/service_stream.h"
+#include "param/param.h"
 
 static NTSTATUS smb2srv_negprot_secblob(struct smb2srv_request *req, DATA_BLOB *_blob)
 {
@@ -52,7 +53,7 @@ static NTSTATUS smb2srv_negprot_secblob(struct smb2srv_request *req, DATA_BLOB *
                return NT_STATUS_NO_MEMORY;
        }
 
-       cli_credentials_set_conf(server_credentials);
+       cli_credentials_set_conf(server_credentials, global_loadparm);
        nt_status = cli_credentials_set_machine_account(server_credentials);
        if (!NT_STATUS_IS_OK(nt_status)) {
                DEBUG(10, ("Failed to obtain server credentials, perhaps a standalone server?: %s\n", nt_errstr(nt_status)));
index e783620e52a594f94645597d14b662d59bb06e74..31b7f72ccaaa534b4d9bdf2682a836f120f0365c 100644 (file)
@@ -516,7 +516,7 @@ NTSTATUS smbsrv_init_smb2_connection(struct smbsrv_connection *smb_conn)
 
        /* this is the size that w2k uses, and it appears to be important for
           good performance */
-       smb_conn->negotiate.max_recv = lp_max_xmit();
+       smb_conn->negotiate.max_recv = lp_max_xmit(global_loadparm);
 
        smb_conn->negotiate.zone_offset = get_time_zone(time(NULL));
 
index 3ac7ca5ede9f65dffbfc7cddd378fdb1e9d65a72..691934f71c10544921cb614a426326e0bdb1ceaa 100644 (file)
@@ -63,7 +63,7 @@ static NTSTATUS smbsrv_recv_generic_request(void *private, DATA_BLOB blob)
                packet_set_callback(smb_conn->packet, smbsrv_recv_smb_request);
                return smbsrv_recv_smb_request(smb_conn, blob);
        case SMB2_MAGIC:
-               if (lp_srv_maxprotocol() < PROTOCOL_SMB2) break;
+               if (lp_srv_maxprotocol(global_loadparm) < PROTOCOL_SMB2) break;
                status = smbsrv_init_smb2_connection(smb_conn);
                NT_STATUS_NOT_OK_RETURN(status);
                packet_set_callback(smb_conn->packet, smbsrv_recv_smb2_request);
@@ -178,7 +178,7 @@ _PUBLIC_ NTSTATUS smbsrv_add_socket(struct event_context *event_context,
                               const struct model_ops *model_ops,
                               const char *address)
 {
-       const char **ports = lp_smb_ports();
+       const char **ports = lp_smb_ports(global_loadparm);
        int i;
        NTSTATUS status;
 
@@ -215,7 +215,7 @@ static void smbsrv_task_init(struct task_server *task)
 
        task_server_set_title(task, "task[smbsrv]");
 
-       if (lp_interfaces() && lp_bind_interfaces_only()) {
+       if (lp_interfaces(global_loadparm) && lp_bind_interfaces_only(global_loadparm)) {
                int num_interfaces = iface_count();
                int i;
 
@@ -230,7 +230,8 @@ static void smbsrv_task_init(struct task_server *task)
                }
        } else {
                /* Just bind to lp_socket_address() (usually 0.0.0.0) */
-               status = smbsrv_add_socket(task->event_ctx, task->model_ops, lp_socket_address());
+               status = smbsrv_add_socket(task->event_ctx, task->model_ops, 
+                                          lp_socket_address(global_loadparm));
                if (!NT_STATUS_IS_OK(status)) goto failed;
        }
 
index 57ff68709fc1886dd67555aba9f4a4fedbf5b197..9a8b095f151b0b7576e4bb25842d8c17751e1fca 100644 (file)
@@ -40,7 +40,7 @@ pid_t pidfile_pid(const char *name)
        pid_t ret;
        char *pidFile;
 
-       asprintf(&pidFile, "%s/%s.pid", lp_piddir(), name);
+       asprintf(&pidFile, "%s/%s.pid", lp_piddir(global_loadparm), name);
 
        fd = open(pidFile, O_NONBLOCK | O_RDONLY, 0644);
 
@@ -87,7 +87,7 @@ void pidfile_create(const char *name)
        char *pidFile;
        pid_t pid;
 
-       asprintf(&pidFile, "%s/%s.pid", lp_piddir(), name);
+       asprintf(&pidFile, "%s/%s.pid", lp_piddir(global_loadparm), name);
 
        pid = pidfile_pid(name);
        if (pid != 0) {
index 23d996bf2e8e972fed48afcfd21a994e69bba693..7d84ffe81297de281d61649d4205f907bc74031d 100644 (file)
@@ -269,8 +269,8 @@ static int binary_smbd_main(const char *binary_name, int argc, const char *argv[
 
        cleanup_tmp_files();
 
-       if (!directory_exist(lp_lockdir())) {
-               mkdir(lp_lockdir(), 0755);
+       if (!directory_exist(lp_lockdir(global_loadparm))) {
+               mkdir(lp_lockdir(global_loadparm), 0755);
        }
 
        pidfile_create(binary_name);
@@ -329,7 +329,7 @@ static int binary_smbd_main(const char *binary_name, int argc, const char *argv[
        }
 
        DEBUG(0,("%s: using '%s' process model\n", binary_name, model));
-       status = server_service_startup(event_ctx, model, lp_server_services());
+       status = server_service_startup(event_ctx, model, lp_server_services(global_loadparm));
        if (!NT_STATUS_IS_OK(status)) {
                DEBUG(0,("Starting Services failed - %s\n", nt_errstr(status)));
                return 1;
index 794fd4f5b1402194cd22101b579e68a4a31ba9c7..1f1f92b4955dd68ced3d64d801decfb3bc800a7d 100644 (file)
@@ -258,7 +258,8 @@ NTSTATUS stream_setup_socket(struct event_context *event_context,
        status = socket_set_option(stream_socket->sock, "SO_KEEPALIVE", NULL);
        NT_STATUS_NOT_OK_RETURN(status);
 
-       status = socket_set_option(stream_socket->sock, lp_socket_options(), NULL);
+       status = socket_set_option(stream_socket->sock, lp_socket_options(global_loadparm), 
+                                  NULL);
        NT_STATUS_NOT_OK_RETURN(status);
 
        /* TODO: set socket ACL's here when they're implemented */
index 7c9339dedc9d86a8bcba5f70b11ee544fe545939..303cbee62f96749b2e3caa5eaa1e87c8682932a1 100644 (file)
@@ -41,7 +41,7 @@ static struct smbcli_state *open_nbt_connection(struct torture_context *tctx)
        struct smbcli_state *cli;
        const char *host = torture_setting_string(tctx, "host", NULL);
 
-       make_nbt_name_client(&calling, lp_netbios_name());
+       make_nbt_name_client(&calling, lp_netbios_name(global_loadparm));
 
        nbt_choose_called_name(NULL, &called, host, NBT_NAME_SERVER);
 
@@ -1443,7 +1443,7 @@ static BOOL torture_samba3_errorpaths(struct torture_context *tctx)
                return False;
        }
 
-       nt_status_support = lp_nt_status_support();
+       nt_status_support = lp_nt_status_support(global_loadparm);
 
        if (!lp_set_cmdline(global_loadparm, "nt status support", "yes")) {
                torture_comment(tctx, "Could not set 'nt status support = yes'\n");
index d493aa819ec3bdbe763f4ffea7d35fbaeb348d6e..19eef87f6f4b34467dd22cda7e6816bec87dd46a 100644 (file)
@@ -442,7 +442,7 @@ static int init_benchrw_params(struct torture_context *tctx,
        lpar->writeratio = torture_setting_int(tctx, "writeratio",5);
        lpar->num_parallel_requests = torture_setting_int(
                tctx, "parallel_requests", 5);
-       lpar->workgroup = lp_workgroup();
+       lpar->workgroup = lp_workgroup(global_loadparm);
        
        p = torture_setting_string(tctx, "unclist", NULL);
        if (p) {
index 030a4f5f675e3edf3b61605d5ee274b7ecf4824b..75d3117967ed24a58cb282275a44891597a2985f 100644 (file)
@@ -38,10 +38,10 @@ static BOOL try_failed_login(struct smbcli_state *cli)
        session = smbcli_session_init(cli->transport, cli, False);
        setup.in.sesskey = cli->transport->negotiate.sesskey;
        setup.in.capabilities = cli->transport->negotiate.capabilities;
-       setup.in.workgroup = lp_workgroup();
+       setup.in.workgroup = lp_workgroup(global_loadparm);
 
        setup.in.credentials = cli_credentials_init(session);
-       cli_credentials_set_conf(setup.in.credentials);
+       cli_credentials_set_conf(setup.in.credentials, global_loadparm);
        cli_credentials_set_domain(setup.in.credentials, "INVALID-DOMAIN", CRED_SPECIFIED);
        cli_credentials_set_username(setup.in.credentials, "INVALID-USERNAME", CRED_SPECIFIED);
        cli_credentials_set_password(setup.in.credentials, "INVALID-PASSWORD", CRED_SPECIFIED);
index 23c52bb446396022f75cfcce91201bf99a82095a..a03f8a082539293f998999828b2a69615e245a99 100644 (file)
@@ -27,6 +27,7 @@
 #include "auth/credentials/credentials.h"
 #include "auth/gensec/gensec.h"
 #include "param/param.h"
+#include "dynconfig.h"
 
 #define NSERVERS 2
 #define NINSTANCES 2
@@ -2195,7 +2196,7 @@ static BOOL split_unc_name(const char *unc, char **server, char **share)
        argc -= NSERVERS;
        argv += NSERVERS;
 
-       lp_load();
+       lp_load(dyn_CONFIGFILE);
 
        servers[0].credentials = cli_credentials_init(talloc_autofree_context());
        servers[1].credentials = cli_credentials_init(talloc_autofree_context());
index cfd3c10968b7cd6916726a22860848d33c1bfad2..329c8a1d23959388c0d43796f33b5d778df12160 100644 (file)
@@ -93,7 +93,7 @@ BOOL torture_domainopen(struct torture_context *torture)
                return False;
        }
 
-       name.string = lp_workgroup();
+       name.string = lp_workgroup(global_loadparm);
 
        /*
         * Testing synchronous version
index 3efd3f2e853a0e2e9ac5c35c8940353bf90ebb79..31b49ef70efdff00f333246074b9909cb8804b40 100644 (file)
@@ -91,7 +91,7 @@ BOOL torture_groupinfo(struct torture_context *torture)
                return False;
        }
 
-       name.string = lp_workgroup();
+       name.string = lp_workgroup(global_loadparm);
 
        /*
         * Testing synchronous version
index 0db89f49607b543e54df7ac705006edce72c551c..a812f59aeada2d79e0708771ab816bec34f7e715 100644 (file)
@@ -71,7 +71,7 @@ BOOL torture_groupadd(struct torture_context *torture)
                return False;
        }
 
-       domain_name.string = lp_workgroup();
+       domain_name.string = lp_workgroup(global_loadparm);
        if (!test_opendomain(p, mem_ctx, &h, &domain_name, &sid)) {
                ret = False;
                goto done;
index c4b1a57ff1a8185075a800f12c2b813831c0eaf7..5338d480bcfe26d97e5b01cd82c0e32514d5ab93 100644 (file)
@@ -163,7 +163,7 @@ static NTSTATUS test_become_dc_prepare_db(void *private_data,
 
        DEBUG(0,("Pathes under PRIVATEDIR[%s]\n"
                 "SAMDB[%s] SECRETS[%s] KEYTAB[%s]\n",
-               lp_private_dir(),
+               lp_private_dir(global_loadparm),
                s->path.samdb_ldb,
                s->path.secrets_ldb,
                s->path.secrets_keytab));
index 1bcbfbbe4f49ea5bc722444464f010ed0ef4359d..a2c0967faaa8ae94a5d1579a0f6b8c2e39a2945b 100644 (file)
@@ -134,7 +134,7 @@ bool torture_domain_open_lsa(struct torture_context *torture)
        /* we're accessing domain controller so the domain name should be
           passed (it's going to be resolved to dc name and address) instead
           of specific server name. */
-       domain_name = lp_workgroup();
+       domain_name = lp_workgroup(global_loadparm);
 
        ctx = libnet_context_init(NULL);
        if (ctx == NULL) {
@@ -208,7 +208,7 @@ BOOL torture_domain_close_lsa(struct torture_context *torture)
                goto done;
        }
 
-       domain_name.string = lp_workgroup();
+       domain_name.string = lp_workgroup(global_loadparm);
        
        if (!test_opendomain_lsa(p, torture, &h, &domain_name, &access_mask)) {
                d_printf("failed to open domain on lsa service\n");
@@ -261,7 +261,7 @@ BOOL torture_domain_open_samr(struct torture_context *torture)
        /* we're accessing domain controller so the domain name should be
           passed (it's going to be resolved to dc name and address) instead
           of specific server name. */
-       domain_name = lp_workgroup();
+       domain_name = lp_workgroup(global_loadparm);
 
        /*
         * Testing synchronous version
@@ -338,7 +338,7 @@ BOOL torture_domain_close_samr(struct torture_context *torture)
                goto done;
        }
 
-       domain_name.string = talloc_strdup(mem_ctx, lp_workgroup());
+       domain_name.string = talloc_strdup(mem_ctx, lp_workgroup(global_loadparm));
        
        if (!test_opendomain_samr(p, torture, &h, &domain_name, &access_mask, &sid)) {
                d_printf("failed to open domain on samr service\n");
index bc51c4242a844095cfca76793cef93cabd05e0c1..7089bd83fc57195a164e46e9d491a154fe4f5072 100644 (file)
@@ -226,7 +226,7 @@ BOOL torture_groupinfo_api(struct torture_context *torture)
                return False;
        }
 
-       domain_name.string = lp_workgroup();
+       domain_name.string = lp_workgroup(global_loadparm);
        if (!test_opendomain(p, prep_mem_ctx, &h, &domain_name)) {
                ret = False;
                goto done;
index a98781bc172d91aa43f8cb7b099b5eee0d5794c8..0d4389c54a62427eaab7cf5599c485e308fe9deb 100644 (file)
@@ -138,7 +138,7 @@ BOOL torture_lookup_pdc(struct torture_context *torture)
                goto done;
        }
 
-       lookup->in.domain_name = lp_workgroup();
+       lookup->in.domain_name = lp_workgroup(global_loadparm);
        lookup->in.name_type   = NBT_NAME_PDC;
 
        status = libnet_LookupDCs(ctx, mem_ctx, lookup);
@@ -178,7 +178,7 @@ BOOL torture_lookup_sam_name(struct torture_context *torture)
        if (mem_ctx == NULL) return False;
 
        r.in.name = "Administrator";
-       r.in.domain_name = lp_workgroup();
+       r.in.domain_name = lp_workgroup(global_loadparm);
 
        status = libnet_LookupName(ctx, mem_ctx, &r);
 
index 1509324b659e55cb5cfcb2a165dcd3ef755c4733..bb9a8d2f34cb0cb9d2a4d1b874e02f61784a5e31 100644 (file)
@@ -163,7 +163,7 @@ BOOL torture_rpc_connect_pdc(struct torture_context *torture)
        /* we're accessing domain controller so the domain name should be
           passed (it's going to be resolved to dc name and address) instead
           of specific server name. */
-       domain_name = lp_workgroup();
+       domain_name = lp_workgroup(global_loadparm);
        return torture_rpc_connect(torture, level, NULL, domain_name);
 }
 
@@ -183,7 +183,7 @@ BOOL torture_rpc_connect_dc(struct torture_context *torture)
        /* we're accessing domain controller so the domain name should be
           passed (it's going to be resolved to dc name and address) instead
           of specific server name. */
-       domain_name = lp_workgroup();
+       domain_name = lp_workgroup(global_loadparm);
        return torture_rpc_connect(torture, level, NULL, domain_name);
 }
 
@@ -203,7 +203,7 @@ BOOL torture_rpc_connect_dc_info(struct torture_context *torture)
        /* we're accessing domain controller so the domain name should be
           passed (it's going to be resolved to dc name and address) instead
           of specific server name. */
-       domain_name = lp_workgroup();
+       domain_name = lp_workgroup(global_loadparm);
        return torture_rpc_connect(torture, level, NULL, domain_name);
 }
 
index a642d4bf5216807a0075ae200b44727658b2b315..640816b891adf3bc7b8b84678f7727dc673ca462 100644 (file)
@@ -245,7 +245,7 @@ BOOL torture_createuser(struct torture_context *torture)
        ctx->cred = cmdline_credentials;
 
        req.in.user_name = TEST_USERNAME;
-       req.in.domain_name = lp_workgroup();
+       req.in.domain_name = lp_workgroup(global_loadparm);
        req.out.error_string = NULL;
 
        status = libnet_CreateUser(ctx, mem_ctx, &req);
@@ -291,7 +291,7 @@ BOOL torture_deleteuser(struct torture_context *torture)
        ctx->cred = cmdline_credentials;
 
        req.in.user_name = TEST_USERNAME;
-       req.in.domain_name = lp_workgroup();
+       req.in.domain_name = lp_workgroup(global_loadparm);
 
        status = torture_rpc_connection(torture,
                                        &p,
@@ -301,7 +301,7 @@ BOOL torture_deleteuser(struct torture_context *torture)
                goto done;
        }
 
-       domain_name.string = lp_workgroup();
+       domain_name.string = lp_workgroup(global_loadparm);
        if (!test_opendomain(p, prep_mem_ctx, &h, &domain_name)) {
                ret = False;
                goto done;
@@ -488,7 +488,7 @@ BOOL torture_modifyuser(struct torture_context *torture)
 
        name = talloc_strdup(prep_mem_ctx, TEST_USERNAME);
 
-       domain_name.string = lp_workgroup();
+       domain_name.string = lp_workgroup(global_loadparm);
        if (!test_opendomain(p, prep_mem_ctx, &h, &domain_name)) {
                ret = False;
                goto done;
@@ -511,7 +511,7 @@ BOOL torture_modifyuser(struct torture_context *torture)
 
        for (fld = 1; fld < FIELDS_NUM - 1; fld++) {
                ZERO_STRUCT(req);
-               req.in.domain_name = lp_workgroup();
+               req.in.domain_name = lp_workgroup(global_loadparm);
                req.in.user_name = name;
 
                set_test_changes(mem_ctx, &req, 1, &name, fld);
@@ -524,7 +524,7 @@ BOOL torture_modifyuser(struct torture_context *torture)
                }
 
                ZERO_STRUCT(user_req);
-               user_req.in.domain_name = lp_workgroup();
+               user_req.in.domain_name = lp_workgroup(global_loadparm);
                user_req.in.user_name = name;
 
                status = libnet_UserInfo(ctx, mem_ctx, &user_req);
@@ -563,7 +563,7 @@ BOOL torture_modifyuser(struct torture_context *torture)
                        /* restore original testing username - it's useful when test fails
                           because it prevents from problems with recreating account */
                        ZERO_STRUCT(req);
-                       req.in.domain_name = lp_workgroup();
+                       req.in.domain_name = lp_workgroup(global_loadparm);
                        req.in.user_name = name;
                        req.in.account_name = TEST_USERNAME;
                        
@@ -624,7 +624,7 @@ BOOL torture_userinfo_api(struct torture_context *torture)
                return False;
        }
 
-       domain_name.string = lp_workgroup();
+       domain_name.string = lp_workgroup(global_loadparm);
        if (!test_opendomain(p, prep_mem_ctx, &h, &domain_name)) {
                ret = False;
                goto done;
@@ -682,7 +682,7 @@ BOOL torture_userlist(struct torture_context *torture)
        ctx = libnet_context_init(NULL);
        ctx->cred = cmdline_credentials;
 
-       domain_name.string = lp_workgroup();
+       domain_name.string = lp_workgroup(global_loadparm);
        mem_ctx = talloc_init("torture user list");
 
        ZERO_STRUCT(req);
index b53965b91ec385c168a02b777517dc8c74066a41..731731865b0bcf6e055e3af4bc529f11d3015d7d 100644 (file)
@@ -148,7 +148,7 @@ bool torture_userinfo(struct torture_context *torture)
                return False;
        }
 
-       name.string = lp_workgroup();
+       name.string = lp_workgroup(global_loadparm);
 
        /*
         * Testing synchronous version
index fbd0a124f0a267ae75206aa22baa3f34c7cccc01..ff2f2d5265452b6effcf178a5d11d4a6893c19de 100644 (file)
@@ -325,7 +325,7 @@ BOOL torture_useradd(struct torture_context *torture)
                return False;
        }
 
-       domain_name.string = lp_workgroup();
+       domain_name.string = lp_workgroup(global_loadparm);
        if (!test_opendomain(p, mem_ctx, &h, &domain_name, &sid)) {
                ret = False;
                goto done;
@@ -384,7 +384,7 @@ bool torture_userdel(struct torture_context *torture)
                return False;
        }
 
-       domain_name.string = lp_workgroup();
+       domain_name.string = lp_workgroup(global_loadparm);
        if (!test_opendomain(p, mem_ctx, &h, &domain_name, &sid)) {
                ret = False;
                goto done;
@@ -430,7 +430,7 @@ BOOL torture_usermod(struct torture_context *torture)
                goto done;
        }
 
-       domain_name.string = lp_workgroup();
+       domain_name.string = lp_workgroup(global_loadparm);
        name = talloc_strdup(mem_ctx, TEST_USERNAME);
 
        if (!test_opendomain(p, mem_ctx, &h, &domain_name, &sid)) {
index e99ff715a2b27f86467e1968f08efcf0f62931b7..fc339bfcc5afb618201a7b92cea7e434d1f6f55c 100644 (file)
@@ -25,6 +25,7 @@
 #include "auth/gensec/gensec.h"
 #include "libcli/libcli.h"
 #include "param/param.h"
+#include "dynconfig.h"
 
 static int numops = 1000;
 static BOOL showall;
@@ -560,7 +561,7 @@ static void usage(void)
        argc -= NSERVERS;
        argv += NSERVERS;
 
-       lp_load();
+       lp_load(dyn_CONFIGFILE);
 
        servers[0] = cli_credentials_init(talloc_autofree_context());
        servers[1] = cli_credentials_init(talloc_autofree_context());
index 9d4f0260b17c50464a3ea5f9799ec2a589681d58..970873a3a688951e5078397e27c19e78d746ad45 100644 (file)
@@ -483,7 +483,7 @@ static void usage(void)
        argc -= 4;
        argv += 4;
 
-       lp_load();
+       lp_load(dyn_CONFIGFILE);
 
        if (getenv("USER")) {
                fstrcpy(username,getenv("USER"));
index 9019bf913bc37249e5a85a5f087e77d54df189f9..153cee26807e80bc9d9a66e8e7fc5baad02f1962 100644 (file)
@@ -27,6 +27,7 @@
 #include "auth/credentials/credentials.h"
 #include "auth/gensec/gensec.h"
 #include "param/param.h"
+#include "dynconfig.h"
 
 static struct cli_credentials *credentials;
 static BOOL showall = False;
@@ -301,7 +302,7 @@ static void usage(void)
        argc -= 1;
        argv += 1;
 
-       lp_load();
+       lp_load(dyn_CONFIGFILE);
 
        credentials = cli_credentials_init(talloc_autofree_context());
        cli_credentials_guess(credentials);
index e3bfaa6db3bb48393ac606d2533bfa332afc42c1..e9cfda4b176b3757d807a5e9b99f0e4c4cf85311 100644 (file)
@@ -78,7 +78,7 @@ static bool nbt_test_netlogon(struct torture_context *tctx)
        const char *address;
        struct nbt_name name;
        
-       name.name = lp_workgroup();
+       name.name = lp_workgroup(global_loadparm);
        name.type = NBT_NAME_LOGON;
        name.scope = NULL;
 
@@ -91,7 +91,7 @@ static bool nbt_test_netlogon(struct torture_context *tctx)
 
 
        socket_address = socket_address_from_strings(dgmsock, dgmsock->sock->backend_name,
-                                                    myaddress, lp_dgram_port());
+                                                    myaddress, lp_dgram_port(global_loadparm));
        torture_assert(tctx, socket_address != NULL, "Error getting address");
 
        /* try receiving replies on port 138 first, which will only
@@ -157,7 +157,7 @@ static bool nbt_test_netlogon2(struct torture_context *tctx)
        const char *address;
        struct nbt_name name;
        
-       name.name = lp_workgroup();
+       name.name = lp_workgroup(global_loadparm);
        name.type = NBT_NAME_LOGON;
        name.scope = NULL;
 
@@ -169,7 +169,7 @@ static bool nbt_test_netlogon2(struct torture_context *tctx)
        myaddress = talloc_strdup(dgmsock, iface_best_ip(address));
 
        socket_address = socket_address_from_strings(dgmsock, dgmsock->sock->backend_name,
-                                                    myaddress, lp_dgram_port());
+                                                    myaddress, lp_dgram_port(global_loadparm));
        torture_assert(tctx, socket_address != NULL, "Error getting address");
 
        /* try receiving replies on port 138 first, which will only
@@ -266,7 +266,7 @@ static bool nbt_test_ntlogon(struct torture_context *tctx)
        const char *address;
        struct nbt_name name;
        
-       name.name = lp_workgroup();
+       name.name = lp_workgroup(global_loadparm);
        name.type = NBT_NAME_LOGON;
        name.scope = NULL;
 
@@ -278,7 +278,7 @@ static bool nbt_test_ntlogon(struct torture_context *tctx)
        myaddress = talloc_strdup(dgmsock, iface_best_ip(address));
 
        socket_address = socket_address_from_strings(dgmsock, dgmsock->sock->backend_name,
-                                                    myaddress, lp_dgram_port());
+                                                    myaddress, lp_dgram_port(global_loadparm));
        torture_assert(tctx, socket_address != NULL, "Error getting address");
 
        /* try receiving replies on port 138 first, which will only
@@ -299,7 +299,7 @@ static bool nbt_test_ntlogon(struct torture_context *tctx)
                                       ACB_WSTRUST, &machine_credentials);
        torture_assert(tctx, join_ctx != NULL,
                       talloc_asprintf(tctx, "Failed to join domain %s as %s\n",
-                                      lp_workgroup(), TEST_NAME));
+                                      lp_workgroup(global_loadparm), TEST_NAME));
 
        dom_sid = torture_join_sid(join_ctx);
 
index c829b36e8e517eb9a85a0dc3d056ec84c7d58642..f0b17b9778359af15269ba51a2ad101f8dec8e42 100644 (file)
@@ -629,7 +629,7 @@ static struct test_wrepl_conflict_conn *test_create_conflict_ctx(
        if (!ctx->nbtsock_srv) return NULL;
 
        /* Make a port 137 version of ctx->myaddr */
-       nbt_srv_addr = socket_address_from_strings(tctx, ctx->nbtsock_srv->sock->backend_name, ctx->myaddr->addr, lp_nbt_port());
+       nbt_srv_addr = socket_address_from_strings(tctx, ctx->nbtsock_srv->sock->backend_name, ctx->myaddr->addr, lp_nbt_port(global_loadparm));
        if (!nbt_srv_addr) return NULL;
 
        /* And if possible, bind to it.  This won't work unless we are root or in sockewrapper */
@@ -654,7 +654,8 @@ static struct test_wrepl_conflict_conn *test_create_conflict_ctx(
                /* Make a port 137 version of ctx->myaddr2 */
                nbt_srv_addr = socket_address_from_strings(tctx, 
                                                           ctx->nbtsock_srv->sock->backend_name, 
-                                                          ctx->myaddr2->addr, lp_nbt_port());
+                                                          ctx->myaddr2->addr, 
+                                                          lp_nbt_port(global_loadparm));
                if (!nbt_srv_addr) return NULL;
 
                /* And if possible, bind to it.  This won't work unless we are root or in sockewrapper */
@@ -9155,7 +9156,7 @@ static bool test_conflict_owned_active_vs_replica(struct torture_context *tctx,
 
        if (!ctx->nbtsock_srv) {
                torture_comment(tctx, "SKIP: Test Replica records vs. owned active records: not bound to port[%d]\n",
-                       lp_nbt_port());
+                       lp_nbt_port(global_loadparm));
                return true;
        }
 
index 283781205f9c2f37696278efb2ed549225ba8eb2..ab406f86245fb43ff22602143db38b791f4f5f00 100644 (file)
@@ -159,7 +159,7 @@ static BOOL test_fetchfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
        io2.in.service_type = "A:";
 
        io2.in.credentials = cmdline_credentials;
-       io2.in.workgroup  = lp_workgroup();
+       io2.in.workgroup  = lp_workgroup(global_loadparm);
        io2.in.filename = fname;
 
        printf("testing parallel fetchfile with %d ops\n", torture_numops);
@@ -346,7 +346,7 @@ static BOOL test_fsinfo(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
        io1.in.service = lp_parm_string(NULL, "torture", "share");
        io1.in.service_type = "A:";
        io1.in.credentials = cmdline_credentials;
-       io1.in.workgroup = lp_workgroup();
+       io1.in.workgroup = lp_workgroup(global_loadparm);
        io1.in.level = RAW_QFS_OBJECTID_INFORMATION;
 
        printf("testing parallel queryfsinfo [Object ID] with %d ops\n", torture_numops);
index 5b2e0f8af8151d08a7a724d876bb9d8580c75970..af3c56fb27ec42dec3171976612044ae7500f457 100644 (file)
@@ -92,7 +92,7 @@ static BOOL test_session(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
 
        setup.in.sesskey = cli->transport->negotiate.sesskey;
        setup.in.capabilities = cli->transport->negotiate.capabilities; /* ignored in secondary session setup, except by our libs, which care about the extended security bit */
-       setup.in.workgroup = lp_workgroup();
+       setup.in.workgroup = lp_workgroup(global_loadparm);
 
        setup.in.credentials = cmdline_credentials;
 
@@ -107,7 +107,7 @@ static BOOL test_session(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
        session2->vuid = session->vuid;
        setup.in.sesskey = cli->transport->negotiate.sesskey;
        setup.in.capabilities = cli->transport->negotiate.capabilities; /* ignored in secondary session setup, except by our libs, which care about the extended security bit */
-       setup.in.workgroup = lp_workgroup();
+       setup.in.workgroup = lp_workgroup(global_loadparm);
 
        setup.in.credentials = cmdline_credentials;
 
@@ -134,7 +134,7 @@ static BOOL test_session(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
                session3->vuid = session->vuid;
                setup.in.sesskey = cli->transport->negotiate.sesskey;
                setup.in.capabilities &= ~CAP_EXTENDED_SECURITY; /* force a non extended security login (should fail) */
-               setup.in.workgroup = lp_workgroup();
+               setup.in.workgroup = lp_workgroup(global_loadparm);
        
                setup.in.credentials = cmdline_credentials;
        
@@ -148,10 +148,10 @@ static BOOL test_session(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
                session4->vuid = session->vuid;
                setup.in.sesskey = cli->transport->negotiate.sesskey;
                setup.in.capabilities &= ~CAP_EXTENDED_SECURITY; /* force a non extended security login (should fail) */
-               setup.in.workgroup = lp_workgroup();
+               setup.in.workgroup = lp_workgroup(global_loadparm);
                
                anon_creds = cli_credentials_init(mem_ctx);
-               cli_credentials_set_conf(anon_creds);
+               cli_credentials_set_conf(anon_creds, global_loadparm);
                cli_credentials_set_anonymous(anon_creds);
 
                setup.in.credentials = anon_creds;
@@ -225,7 +225,7 @@ static BOOL test_session(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
        for (i=0; i <ARRAY_SIZE(sessions); i++) {
                setups[i].in.sesskey = cli->transport->negotiate.sesskey;
                setups[i].in.capabilities = cli->transport->negotiate.capabilities; /* ignored in secondary session setup, except by our libs, which care about the extended security bit */
-               setups[i].in.workgroup = lp_workgroup();
+               setups[i].in.workgroup = lp_workgroup(global_loadparm);
                
                setups[i].in.credentials = cmdline_credentials;
 
@@ -392,7 +392,7 @@ static BOOL test_tree_ulogoff(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
        session1 = smbcli_session_init(cli->transport, mem_ctx, False);
        setup.in.sesskey = cli->transport->negotiate.sesskey;
        setup.in.capabilities = cli->transport->negotiate.capabilities;
-       setup.in.workgroup = lp_workgroup();
+       setup.in.workgroup = lp_workgroup(global_loadparm);
        setup.in.credentials = cmdline_credentials;
        status = smb_composite_sesssetup(session1, &setup);
        CHECK_STATUS(status, NT_STATUS_OK);
@@ -448,7 +448,7 @@ static BOOL test_tree_ulogoff(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
        session2 = smbcli_session_init(cli->transport, mem_ctx, False);
        setup.in.sesskey = cli->transport->negotiate.sesskey;
        setup.in.capabilities = cli->transport->negotiate.capabilities;
-       setup.in.workgroup = lp_workgroup();
+       setup.in.workgroup = lp_workgroup(global_loadparm);
        setup.in.credentials = cmdline_credentials;
        status = smb_composite_sesssetup(session2, &setup);
        CHECK_STATUS(status, NT_STATUS_OK);
@@ -645,7 +645,7 @@ static BOOL test_pid_2sess(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
 
        setup.in.sesskey = cli->transport->negotiate.sesskey;
        setup.in.capabilities = cli->transport->negotiate.capabilities; /* ignored in secondary session setup, except by our libs, which care about the extended security bit */
-       setup.in.workgroup = lp_workgroup();
+       setup.in.workgroup = lp_workgroup(global_loadparm);
 
        setup.in.credentials = cmdline_credentials;
 
@@ -890,7 +890,7 @@ bool torture_raw_context(struct torture_context *torture,
                         struct smbcli_state *cli)
 {
        bool ret = true;
-       if (lp_use_spnego()) {
+       if (lp_use_spnego(global_loadparm)) {
                ret &= torture_raw_context_int(torture, cli);
                lp_set_cmdline(global_loadparm, "use spnego", "False");
        }
index c47f3c797873d5de9f9ef76d5c3d6fdd215ff217..245a15d269be454253158e6f32833b698fceffc9 100644 (file)
@@ -592,7 +592,7 @@ static bool test_async(struct torture_context *tctx,
        session = smbcli_session_init(cli->transport, tctx, False);
        setup.in.sesskey = cli->transport->negotiate.sesskey;
        setup.in.capabilities = cli->transport->negotiate.capabilities;
-       setup.in.workgroup = lp_workgroup();
+       setup.in.workgroup = lp_workgroup(global_loadparm);
        setup.in.credentials = cmdline_credentials;
        status = smb_composite_sesssetup(session, &setup);
        CHECK_STATUS(status, NT_STATUS_OK);
index 55cab9e1178e0fadf0ae8b0a368ffcbb7f650146..97509606c3669fca91064ddc77c9ecd02cf42ba2 100644 (file)
@@ -190,7 +190,7 @@ static void reopen_connection(struct event_context *ev, struct timed_event *te,
        io->in.service_type = state->service_type;
        io->in.credentials  = cmdline_credentials;
        io->in.fallback_to_anonymous = False;
-       io->in.workgroup    = lp_workgroup();
+       io->in.workgroup    = lp_workgroup(global_loadparm);
 
        /* kill off the remnants of the old connection */
        talloc_free(state->tree);
index d412a0406cf3c14e31f2d732d9f8532eb00184df..dcba73dfffc306d5f6fdf9801643b63344847bec 100644 (file)
@@ -128,7 +128,7 @@ static void reopen_connection(struct event_context *ev, struct timed_event *te,
        io->in.service_type = state->service_type;
        io->in.credentials  = cmdline_credentials;
        io->in.fallback_to_anonymous = False;
-       io->in.workgroup    = lp_workgroup();
+       io->in.workgroup    = lp_workgroup(global_loadparm);
 
        /* kill off the remnants of the old connection */
        talloc_free(state->tree);
index aad13ecd8fd894e6a1c08d3619b60a5eaf3b0f9d..ec53af93e8b1535e78409f68c16e27527fa2e99f 100644 (file)
@@ -344,7 +344,7 @@ bool torture_samba3_badpath(struct torture_context *torture)
                return False;
        }
 
-       nt_status_support = lp_nt_status_support();
+       nt_status_support = lp_nt_status_support(global_loadparm);
 
        if (!lp_set_cmdline(global_loadparm, "nt status support", "yes")) {
                printf("Could not set 'nt status support = yes'\n");
index 5ea578e0416cc001a9f81c276638784ab6744c3f..79063e86da379ccbde4ca87864e28eb16eb1d2ca 100644 (file)
@@ -265,7 +265,7 @@ static BOOL test_GetInfo(struct DsSyncTest *ctx)
        r.in.req.req1.format_flags      = DRSUAPI_DS_NAME_FLAG_NO_FLAGS;                
        r.in.req.req1.format_offered    = DRSUAPI_DS_NAME_FORMAT_NT4_ACCOUNT;
        r.in.req.req1.format_desired    = DRSUAPI_DS_NAME_FORMAT_FQDN_1779;
-       names[0].str = talloc_asprintf(ctx, "%s\\", lp_workgroup());
+       names[0].str = talloc_asprintf(ctx, "%s\\", lp_workgroup(global_loadparm));
 
        status = dcerpc_drsuapi_DsCrackNames(ctx->admin.drsuapi.pipe, ctx, &r);
        if (!NT_STATUS_IS_OK(status)) {
index 6352865d987b340113844afdfcec689340da9d8a..3ff0561f776832d2f86fb6c67e6f083073370989 100644 (file)
@@ -452,11 +452,11 @@ bool test_netlogon_ops(struct dcerpc_pipe *p, struct torture_context *tctx,
        DATA_BLOB names_blob, chal, lm_resp, nt_resp;
        int i;
        int flags = CLI_CRED_NTLM_AUTH;
-       if (lp_client_lanman_auth()) {
+       if (lp_client_lanman_auth(global_loadparm)) {
                flags |= CLI_CRED_LANMAN_AUTH;
        }
 
-       if (lp_client_ntlmv2_auth()) {
+       if (lp_client_ntlmv2_auth(global_loadparm)) {
                flags |= CLI_CRED_NTLMv2_AUTH;
        }
 
@@ -740,7 +740,7 @@ static bool test_GetDcName(struct torture_context *tctx,
        struct netr_GetDcName r;
 
        r.in.logon_server = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p));
-       r.in.domainname = lp_workgroup();
+       r.in.domainname = lp_workgroup(global_loadparm);
 
        status = dcerpc_netr_GetDcName(p, tctx, &r);
        torture_assert_ntstatus_ok(tctx, status, "GetDcName");
@@ -787,7 +787,7 @@ static bool test_GetAnyDCName(struct torture_context *tctx,
        struct netr_GetAnyDCName r;
 
        r.in.logon_server = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p));
-       r.in.domainname = lp_workgroup();
+       r.in.domainname = lp_workgroup(global_loadparm);
 
        status = dcerpc_netr_GetAnyDCName(p, tctx, &r);
        torture_assert_ntstatus_ok(tctx, status, "GetAnyDCName");
@@ -813,7 +813,7 @@ static bool test_LogonControl2(struct torture_context *tctx,
        r.in.logon_server = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p));
 
        r.in.function_code = NETLOGON_CONTROL_REDISCOVER;
-       r.in.data.domain = lp_workgroup();
+       r.in.data.domain = lp_workgroup(global_loadparm);
 
        for (i=1;i<4;i++) {
                r.in.level = i;
@@ -826,7 +826,7 @@ static bool test_LogonControl2(struct torture_context *tctx,
        }
 
        r.in.function_code = NETLOGON_CONTROL_TC_QUERY;
-       r.in.data.domain = lp_workgroup();
+       r.in.data.domain = lp_workgroup(global_loadparm);
 
        for (i=1;i<4;i++) {
                r.in.level = i;
@@ -839,7 +839,7 @@ static bool test_LogonControl2(struct torture_context *tctx,
        }
 
        r.in.function_code = NETLOGON_CONTROL_TRANSPORT_NOTIFY;
-       r.in.data.domain = lp_workgroup();
+       r.in.data.domain = lp_workgroup(global_loadparm);
 
        for (i=1;i<4;i++) {
                r.in.level = i;
@@ -932,7 +932,7 @@ static bool test_LogonControl2Ex(struct torture_context *tctx,
        r.in.logon_server = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p));
 
        r.in.function_code = NETLOGON_CONTROL_REDISCOVER;
-       r.in.data.domain = lp_workgroup();
+       r.in.data.domain = lp_workgroup(global_loadparm);
 
        for (i=1;i<4;i++) {
                r.in.level = i;
@@ -945,7 +945,7 @@ static bool test_LogonControl2Ex(struct torture_context *tctx,
        }
 
        r.in.function_code = NETLOGON_CONTROL_TC_QUERY;
-       r.in.data.domain = lp_workgroup();
+       r.in.data.domain = lp_workgroup(global_loadparm);
 
        for (i=1;i<4;i++) {
                r.in.level = i;
@@ -958,7 +958,7 @@ static bool test_LogonControl2Ex(struct torture_context *tctx,
        }
 
        r.in.function_code = NETLOGON_CONTROL_TRANSPORT_NOTIFY;
-       r.in.data.domain = lp_workgroup();
+       r.in.data.domain = lp_workgroup(global_loadparm);
 
        for (i=1;i<4;i++) {
                r.in.level = i;
@@ -1090,7 +1090,7 @@ static bool test_netr_DsRGetDCName(struct torture_context *tctx,
        struct netr_DsRGetDCName r;
 
        r.in.server_unc         = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p));
-       r.in.domain_name        = talloc_asprintf(tctx, "%s", lp_realm());
+       r.in.domain_name        = talloc_asprintf(tctx, "%s", lp_realm(global_loadparm));
        r.in.domain_guid        = NULL;
        r.in.site_guid          = NULL;
        r.in.flags              = DS_RETURN_DNS_NAME;
@@ -1113,7 +1113,7 @@ static bool test_netr_DsRGetDCNameEx(struct torture_context *tctx,
        struct netr_DsRGetDCNameEx r;
 
        r.in.server_unc         = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p));
-       r.in.domain_name        = talloc_asprintf(tctx, "%s", lp_realm());
+       r.in.domain_name        = talloc_asprintf(tctx, "%s", lp_realm(global_loadparm));
        r.in.domain_guid        = NULL;
        r.in.site_name          = NULL;
        r.in.flags              = DS_RETURN_DNS_NAME;
@@ -1138,7 +1138,7 @@ static bool test_netr_DsRGetDCNameEx2(struct torture_context *tctx,
        r.in.server_unc         = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p));
        r.in.client_account     = NULL;
        r.in.mask               = 0x00000000;
-       r.in.domain_name        = talloc_asprintf(tctx, "%s", lp_realm());
+       r.in.domain_name        = talloc_asprintf(tctx, "%s", lp_realm(global_loadparm));
        r.in.domain_guid        = NULL;
        r.in.site_name          = NULL;
        r.in.flags              = DS_RETURN_DNS_NAME;
index e6f54037bce4440183c06bedebb5c6ddfa41d619..75a7d760d91008eee2642866a42d0e56c8fe3342 100644 (file)
@@ -58,7 +58,7 @@ static struct cli_credentials *create_anon_creds(TALLOC_CTX *mem_ctx)
                return NULL;
        }
 
-       cli_credentials_set_conf(result);
+       cli_credentials_set_conf(result, global_loadparm);
        cli_credentials_set_anonymous(result);
 
        return result;
@@ -1163,7 +1163,7 @@ BOOL torture_netlogon_samba3(struct torture_context *torture)
                goto done;
        }
 
-       cli_credentials_set_conf(wks_creds);
+       cli_credentials_set_conf(wks_creds, global_loadparm);
        cli_credentials_set_secure_channel_type(wks_creds, SEC_CHAN_WKSTA);
        cli_credentials_set_username(wks_creds, wks_name, CRED_SPECIFIED);
        cli_credentials_set_workstation(wks_creds, wks_name, CRED_SPECIFIED);
@@ -1244,7 +1244,7 @@ static BOOL test_join3(TALLOC_CTX *mem_ctx,
                goto done;
        }
 
-       cli_credentials_set_conf(wks_creds);
+       cli_credentials_set_conf(wks_creds, global_loadparm);
        cli_credentials_set_secure_channel_type(wks_creds, SEC_CHAN_WKSTA);
        cli_credentials_set_username(wks_creds, wks_name, CRED_SPECIFIED);
        cli_credentials_set_workstation(wks_creds, wks_name, CRED_SPECIFIED);
@@ -1648,7 +1648,7 @@ BOOL torture_samba3_rpc_getusername(struct torture_context *torture)
                goto done;
        }
 
-       cli_credentials_set_conf(user_creds);
+       cli_credentials_set_conf(user_creds, global_loadparm);
        cli_credentials_set_username(user_creds, "torture_username",
                                     CRED_SPECIFIED);
        cli_credentials_set_password(user_creds,
@@ -2435,7 +2435,7 @@ BOOL torture_samba3_rpc_spoolss(struct torture_context *torture)
 
        ZERO_STRUCT(userlevel1);
        userlevel1.client = talloc_asprintf(
-               mem_ctx, "\\\\%s", lp_netbios_name());
+               mem_ctx, "\\\\%s", lp_netbios_name(global_loadparm));
        userlevel1.user = cli_credentials_get_username(cmdline_credentials);
        userlevel1.build = 2600;
        userlevel1.major = 3;
index 92c4da6321a31d8ddf782160bc77bdae5547b5ec..46ed36342354b774fc6b66125f09afd21e2c9851 100644 (file)
@@ -591,7 +591,7 @@ static BOOL test_lmv2_ntlmv2_broken(struct samlogon_state *samlogon_state,
        DATA_BLOB lmv2_response = data_blob(NULL, 0);
        DATA_BLOB lmv2_session_key = data_blob(NULL, 0);
        DATA_BLOB ntlmv2_session_key = data_blob(NULL, 0);
-       DATA_BLOB names_blob = NTLMv2_generate_names_blob(samlogon_state->mem_ctx, TEST_MACHINE_NAME, lp_workgroup());
+       DATA_BLOB names_blob = NTLMv2_generate_names_blob(samlogon_state->mem_ctx, TEST_MACHINE_NAME, lp_workgroup(global_loadparm));
 
        uint8_t lm_session_key[8];
        uint8_t user_session_key[16];
@@ -739,7 +739,7 @@ static BOOL test_lmv2_ntlm_broken(struct samlogon_state *samlogon_state,
        DATA_BLOB lmv2_response = data_blob(NULL, 0);
        DATA_BLOB lmv2_session_key = data_blob(NULL, 0);
        DATA_BLOB ntlmv2_session_key = data_blob(NULL, 0);
-       DATA_BLOB names_blob = NTLMv2_generate_names_blob(samlogon_state->mem_ctx, lp_netbios_name(), lp_workgroup());
+       DATA_BLOB names_blob = NTLMv2_generate_names_blob(samlogon_state->mem_ctx, lp_netbios_name(global_loadparm), lp_workgroup(global_loadparm));
 
        DATA_BLOB ntlm_response = data_blob_talloc(samlogon_state->mem_ctx, NULL, 24);
        DATA_BLOB ntlm_session_key = data_blob_talloc(samlogon_state->mem_ctx, NULL, 16);
@@ -1512,7 +1512,7 @@ BOOL torture_rpc_samlogon(struct torture_context *torture)
                return False;
        }
 
-       userdomain = torture_setting_string(torture, "userdomain", lp_workgroup());
+       userdomain = torture_setting_string(torture, "userdomain", lp_workgroup(global_loadparm));
 
        user_ctx = torture_create_testuser(torture,
                                           TEST_USER_NAME,
@@ -1735,7 +1735,7 @@ BOOL torture_rpc_samlogon(struct torture_context *torture)
                                .username      = talloc_asprintf(mem_ctx, 
                                                                 "%s@%s", 
                                                                 TEST_USER_NAME,
-                                                                lp_realm()),
+                                                                lp_realm(global_loadparm)),
                                .password      = user_password,
                                .network_login = True,
                                .expected_interactive_error = NT_STATUS_OK,
index 945948567435253fcd6b2fc9b450c83b914b5c8c..7d3395c5d06d6a93308164a53fb9c1fc4740a200 100644 (file)
@@ -412,7 +412,7 @@ static bool test_samr_accessmask_LookupDomain(struct torture_context *tctx,
 
                        ld.in.connect_handle = &ch;
                        ld.in.domain_name    = &dn;
-                       dn.string            = lp_workgroup();
+                       dn.string            = lp_workgroup(global_loadparm);
 
                        status = dcerpc_samr_LookupDomain(p, tctx, &ld);
                        if (!NT_STATUS_IS_OK(status)) {
@@ -436,7 +436,7 @@ static bool test_samr_accessmask_LookupDomain(struct torture_context *tctx,
 
                        ld.in.connect_handle = &ch;
                        ld.in.domain_name    = &dn;
-                       dn.string            = lp_workgroup();
+                       dn.string            = lp_workgroup(global_loadparm);
 
                        status = dcerpc_samr_LookupDomain(p, tctx, &ld);
                        if(!NT_STATUS_EQUAL(NT_STATUS_ACCESS_DENIED, status)) {
@@ -488,7 +488,7 @@ static bool test_samr_accessmask_OpenDomain(struct torture_context *tctx,
 
        ld.in.connect_handle = &ch;
        ld.in.domain_name    = &dn;
-       dn.string            = lp_workgroup();
+       dn.string            = lp_workgroup(global_loadparm);
        status = dcerpc_samr_LookupDomain(p, tctx, &ld);
        if (!NT_STATUS_IS_OK(status)) {
                printf("LookupDomain failed - %s\n", nt_errstr(status));
@@ -569,14 +569,16 @@ static bool test_samr_connect(struct torture_context *tctx,
        const struct dom_sid *test_sid;
 
        /* create a test user */
-       testuser = torture_create_testuser(tctx, TEST_USER_NAME, lp_workgroup(), ACB_NORMAL, &testuser_passwd);
+       testuser = torture_create_testuser(tctx, TEST_USER_NAME, lp_workgroup(global_loadparm), 
+                                          ACB_NORMAL, &testuser_passwd);
        if (!testuser) {
                printf("Failed to create test user\n");
                return False;
        }
        test_credentials = cli_credentials_init(tctx);
        cli_credentials_set_workstation(test_credentials, "localhost", CRED_SPECIFIED);
-       cli_credentials_set_domain(test_credentials, lp_workgroup(), CRED_SPECIFIED);
+       cli_credentials_set_domain(test_credentials, lp_workgroup(global_loadparm), 
+                                  CRED_SPECIFIED);
        cli_credentials_set_username(test_credentials, TEST_USER_NAME, CRED_SPECIFIED);
        cli_credentials_set_password(test_credentials, testuser_passwd, CRED_SPECIFIED);
        test_sid = torture_join_user_sid(testuser);
index 013a6db0bb3f64655e201b4e217663d4d17e3525..8494bdb54331ab500c19fc56ec538177dbc2e832 100644 (file)
@@ -1431,7 +1431,8 @@ BOOL torture_rpc_samsync(struct torture_context *torture)
        mem_ctx = talloc_init("torture_rpc_netlogon");
        
        test_machine_account = talloc_asprintf(mem_ctx, "%s$", TEST_MACHINE_NAME);
-       join_ctx = torture_create_testuser(torture, test_machine_account, lp_workgroup(), ACB_SVRTRUST, 
+       join_ctx = torture_create_testuser(torture, test_machine_account, 
+                                          lp_workgroup(global_loadparm), ACB_SVRTRUST, 
                                           &machine_password);
        if (!join_ctx) {
                talloc_free(mem_ctx);
@@ -1440,8 +1441,7 @@ BOOL torture_rpc_samsync(struct torture_context *torture)
        }
        
        test_wksta_machine_account = talloc_asprintf(mem_ctx, "%s$", TEST_WKSTA_MACHINE_NAME);
-       join_ctx2 = torture_create_testuser(torture, test_wksta_machine_account, lp_workgroup(), ACB_WSTRUST, 
-                                           &wksta_machine_password);
+       join_ctx2 = torture_create_testuser(torture, test_wksta_machine_account, lp_workgroup(global_loadparm), ACB_WSTRUST, &wksta_machine_password);
        if (!join_ctx2) {
                talloc_free(mem_ctx);
                printf("Failed to join as member\n");
@@ -1449,7 +1449,7 @@ BOOL torture_rpc_samsync(struct torture_context *torture)
        }
        
        user_ctx = torture_create_testuser(torture, TEST_USER_NAME,
-                                          lp_workgroup(),
+                                          lp_workgroup(global_loadparm),
                                           ACB_NORMAL, NULL);
        if (!user_ctx) {
                talloc_free(mem_ctx);
@@ -1473,7 +1473,7 @@ BOOL torture_rpc_samsync(struct torture_context *torture)
                goto failed;
        }
 
-       domain_policy = samsync_open_domain(mem_ctx, samsync_state, lp_workgroup(), NULL);
+       domain_policy = samsync_open_domain(mem_ctx, samsync_state, lp_workgroup(global_loadparm), NULL);
        if (!domain_policy) {
                printf("samrsync_open_domain failed\n");
                ret = False;
@@ -1548,7 +1548,7 @@ BOOL torture_rpc_samsync(struct torture_context *torture)
        credentials = cli_credentials_init(mem_ctx);
 
        cli_credentials_set_workstation(credentials, TEST_MACHINE_NAME, CRED_SPECIFIED);
-       cli_credentials_set_domain(credentials, lp_workgroup(), CRED_SPECIFIED);
+       cli_credentials_set_domain(credentials, lp_workgroup(global_loadparm), CRED_SPECIFIED);
        cli_credentials_set_username(credentials, test_machine_account, CRED_SPECIFIED);
        cli_credentials_set_password(credentials, machine_password, CRED_SPECIFIED);
        cli_credentials_set_secure_channel_type(credentials,
@@ -1585,7 +1585,7 @@ BOOL torture_rpc_samsync(struct torture_context *torture)
        credentials_wksta = cli_credentials_init(mem_ctx);
 
        cli_credentials_set_workstation(credentials_wksta, TEST_WKSTA_MACHINE_NAME, CRED_SPECIFIED);
-       cli_credentials_set_domain(credentials_wksta, lp_workgroup(), CRED_SPECIFIED);
+       cli_credentials_set_domain(credentials_wksta, lp_workgroup(global_loadparm), CRED_SPECIFIED);
        cli_credentials_set_username(credentials_wksta, test_wksta_machine_account, CRED_SPECIFIED);
        cli_credentials_set_password(credentials_wksta, wksta_machine_password, CRED_SPECIFIED);
        cli_credentials_set_secure_channel_type(credentials_wksta,
index 7d963be1bb7d9f4f41b4ea3115a070078ff63ca3..cb70582615ec2f552221f38b62f0bfc22186b89f 100644 (file)
@@ -47,11 +47,11 @@ bool test_netlogon_ex_ops(struct dcerpc_pipe *p, struct torture_context *tctx,
        DATA_BLOB names_blob, chal, lm_resp, nt_resp;
        int i;
        int flags = CLI_CRED_NTLM_AUTH;
-       if (lp_client_lanman_auth()) {
+       if (lp_client_lanman_auth(global_loadparm)) {
                flags |= CLI_CRED_LANMAN_AUTH;
        }
 
-       if (lp_client_ntlmv2_auth()) {
+       if (lp_client_ntlmv2_auth(global_loadparm)) {
                flags |= CLI_CRED_NTLMv2_AUTH;
        }
 
@@ -122,7 +122,7 @@ static bool test_samr_ops(struct torture_context *tctx,
        struct policy_handle handle;
        struct policy_handle domain_handle;
 
-       name.string = lp_workgroup();
+       name.string = lp_workgroup(global_loadparm);
        r.in.domain_name = &name;
 
        connect.in.system_name = 0;
index f32d6832a30bf3efe4a96c579921a5ad5e3f903c..79a1b873763f3f6d9cebc050e5135d99302c2f68 100644 (file)
@@ -276,7 +276,8 @@ again:
        
        u.info21.description.string = talloc_asprintf(join, 
                                         "Samba4 torture account created by host %s: %s", 
-                                        lp_netbios_name(), timestring(join, time(NULL)));
+                                        lp_netbios_name(global_loadparm), 
+                                        timestring(join, time(NULL)));
 
        printf("Resetting ACB flags, force pw change time\n");
 
@@ -382,7 +383,7 @@ _PUBLIC_ struct test_join *torture_join_domain(const char *machine_name,
        
        u.info21.description.string = talloc_asprintf(tj, 
                                                      "Samba4 torture account created by host %s: %s", 
-                                                     lp_netbios_name(), timestring(tj, time(NULL)));
+                                                     lp_netbios_name(global_loadparm), timestring(tj, time(NULL)));
 
        status = dcerpc_samr_SetUserInfo(tj->p, tj, &s);
        if (!NT_STATUS_IS_OK(status)) {
@@ -390,7 +391,7 @@ _PUBLIC_ struct test_join *torture_join_domain(const char *machine_name,
        }
 
        *machine_credentials = cli_credentials_init(tj);
-       cli_credentials_set_conf(*machine_credentials);
+       cli_credentials_set_conf(*machine_credentials, global_loadparm);
        cli_credentials_set_workstation(*machine_credentials, machine_name, CRED_SPECIFIED);
        cli_credentials_set_domain(*machine_credentials, libnet_r->out.domain_name, CRED_SPECIFIED);
        if (libnet_r->out.realm) {
index c648273c83da99367d01f046de065c96117ec859..12d6f826432765635d4189daf1d74b9b4f678bcd 100644 (file)
@@ -292,7 +292,7 @@ bool wire_bad_flags(struct smb_wire_string *str, int flags, struct smbcli_transp
        if (flags & STR_TERMINATE) len++;
 
        server_unicode = (transport->negotiate.capabilities&CAP_UNICODE)?True:False;
-       if (getenv("CLI_FORCE_ASCII") || !lp_unicode()) {
+       if (getenv("CLI_FORCE_ASCII") || !lp_unicode(global_loadparm)) {
                server_unicode = False;
        }
 
index 5fc941f45a0395415e210e226ffe22146fe03c51..877742a26d00e026148c68242fcaca28227f2bfd 100644 (file)
@@ -112,7 +112,7 @@ static bool torture_winbind_struct_info(struct torture_context *torture)
 
        separator = torture_setting_string(torture,
                                           "winbindd separator",
-                                          lp_winbind_separator());
+                                          lp_winbind_separator(global_loadparm));
        torture_assert_int_equal(torture,
                                 rep.data.info.winbind_separator,
                                 *separator,
@@ -166,7 +166,7 @@ static bool torture_winbind_struct_netbios_name(struct torture_context *torture)
 
        expected = torture_setting_string(torture,
                                          "winbindd netbios name",
-                                         lp_netbios_name());
+                                         lp_netbios_name(global_loadparm));
 
        torture_assert_str_equal(torture,
                                 rep.data.netbios_name, expected,
@@ -188,7 +188,7 @@ static bool torture_winbind_struct_domain_name(struct torture_context *torture)
 
        expected = torture_setting_string(torture,
                                          "winbindd netbios domain",
-                                         lp_workgroup());
+                                         lp_workgroup(global_loadparm));
 
        torture_assert_str_equal(torture,
                                 rep.data.domain_name, expected,
index 59b35d70fab669392c2e67a29c16c77eed9b4b4f..1352fb7d9bfa59a9f2651c9e91d8158c4fb7c8fd 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();
+       r->in.netbios_name              = lp_netbios_name(global_loadparm);
        r->in.domain_name               = domain_name;
        r->in.join_type                 = secure_channel_type;
        r->in.level                     = LIBNET_JOIN_AUTOMATIC;
index 72bd94e630e93feeb836ebf16bd9a78c4e6d7cfe..8d9ff4ff0cd7cc1e77699ddaac98f158450c037e 100644 (file)
@@ -125,7 +125,7 @@ static bool parse_ntlm_auth_domain_user(const char *domuser, fstring domain,
                                        fstring user)
 {
 
-       char *p = strchr(domuser,*lp_winbind_separator());
+       char *p = strchr(domuser,*lp_winbind_separator(global_loadparm));
 
        if (!p) {
                return False;
@@ -220,7 +220,7 @@ static NTSTATUS local_pw_check_specified(const char *username,
                        if (unix_name) {
                                asprintf(unix_name, 
                                         "%s%c%s", domain,
-                                        *lp_winbind_separator(), 
+                                        *lp_winbind_separator(global_loadparm), 
                                         username);
                        }
                } else {
@@ -474,7 +474,7 @@ static void manage_gensec_request(enum stdio_helper_mode stdio_helper_mode,
                }
 
                creds = cli_credentials_init(state->gensec_state);
-               cli_credentials_set_conf(creds);
+               cli_credentials_set_conf(creds, global_loadparm);
                if (opt_username) {
                        cli_credentials_set_username(creds, opt_username, CRED_SPECIFIED);
                }
@@ -659,7 +659,7 @@ static void manage_gensec_request(enum stdio_helper_mode stdio_helper_mode,
                        reply_code = "AF";
                        reply_arg = talloc_asprintf(state->gensec_state, 
                                                    "%s%s%s", session_info->server_info->domain_name, 
-                                                   lp_winbind_separator(), session_info->server_info->account_name);
+                                                   lp_winbind_separator(global_loadparm), session_info->server_info->account_name);
                        talloc_free(session_info);
                }
        } else if (state->gensec_state->gensec_role == GENSEC_CLIENT) {
@@ -710,7 +710,7 @@ static void manage_ntlm_server_1_request(enum stdio_helper_mode stdio_helper_mod
                } else if (plaintext_password) {
                        /* handle this request as plaintext */
                        if (!full_username) {
-                               if (asprintf(&full_username, "%s%c%s", domain, *lp_winbind_separator(), username) == -1) {
+                               if (asprintf(&full_username, "%s%c%s", domain, *lp_winbind_separator(global_loadparm), username) == -1) {
                                        mux_printf(mux_id, "Error: Out of memory in asprintf!\n.\n");
                                        return;
                                }
@@ -745,7 +745,7 @@ static void manage_ntlm_server_1_request(enum stdio_helper_mode stdio_helper_mod
                        }
 
                        if (!domain) {
-                               domain = smb_xstrdup(lp_workgroup());
+                               domain = smb_xstrdup(lp_workgroup(global_loadparm));
                        }
 
                        if (ntlm_server_1_lm_session_key) 
@@ -757,7 +757,7 @@ static void manage_ntlm_server_1_request(enum stdio_helper_mode stdio_helper_mod
                        if (!NT_STATUS_IS_OK(
                                    local_pw_check_specified(username, 
                                                              domain, 
-                                                             lp_netbios_name(),
+                                                             lp_netbios_name(global_loadparm),
                                                              &challenge, 
                                                              &lm_response, 
                                                              &nt_response, 
@@ -1084,7 +1084,7 @@ int main(int argc, const char **argv)
        gensec_init();
 
        if (opt_domain == NULL) {
-               opt_domain = lp_workgroup();
+               opt_domain = lp_workgroup(global_loadparm);
        }
 
        if (helper_protocol) {
@@ -1111,7 +1111,7 @@ int main(int argc, const char **argv)
        }
 
        if (opt_workstation == NULL) {
-               opt_workstation = lp_netbios_name();
+               opt_workstation = lp_netbios_name(global_loadparm);
        }
 
        if (!opt_password) {
@@ -1121,7 +1121,7 @@ int main(int argc, const char **argv)
        {
                char *user;
 
-               asprintf(&user, "%s%c%s", opt_domain, *lp_winbind_separator(), opt_username);
+               asprintf(&user, "%s%c%s", opt_domain, *lp_winbind_separator(global_loadparm), opt_username);
                if (!check_plaintext_auth(user, opt_password, True)) {
                        return 1;
                }
index d8b6069791161b0e931e42e0492f6f6fc512ce10..71ff937a516a6952e3fc5ff49b7a0c6fa60d04d8 100644 (file)
  configuration settings.
 ************************************************/
 
-static int do_global_checks(void)
+static int do_global_checks(struct loadparm_context *lp_ctx)
 {
        int ret = 0;
 
-       if (!directory_exist(lp_lockdir())) {
+       if (!directory_exist(lp_lockdir(lp_ctx))) {
                fprintf(stderr, "ERROR: lock directory %s does not exist\n",
-                      lp_lockdir());
+                      lp_lockdir(lp_ctx));
                ret = 1;
        }
 
-       if (!directory_exist(lp_piddir())) {
+       if (!directory_exist(lp_piddir(lp_ctx))) {
                fprintf(stderr, "ERROR: pid directory %s does not exist\n",
-                      lp_piddir());
+                      lp_piddir(lp_ctx));
                ret = 1;
        }
 
-       if (strlen(lp_winbind_separator()) != 1) {
+       if (strlen(lp_winbind_separator(lp_ctx)) != 1) {
                fprintf(stderr,"ERROR: the 'winbind separator' parameter must be a single character.\n");
                ret = 1;
        }
 
-       if (*lp_winbind_separator() == '+') {
+       if (*lp_winbind_separator(lp_ctx) == '+') {
                fprintf(stderr,"'winbind separator = +' might cause problems with group membership.\n");
        }
 
@@ -139,16 +139,16 @@ static int do_global_checks(void)
        /* We need this to force the output */
        lp_set_cmdline(global_loadparm, "log level", "2");
 
-       fprintf(stderr,"Load smb config files from %s\n",lp_configfile());
+       fprintf(stderr, "Loaded smb config files from %s\n", lp_configfile(global_loadparm));
 
-       if (!lp_load()) {
+       if (!lp_load(lp_configfile(global_loadparm))) {
                fprintf(stderr,"Error loading services.\n");
                return(1);
        }
 
        fprintf(stderr,"Loaded services file OK.\n");
 
-       ret = do_global_checks();
+       ret = do_global_checks(global_loadparm);
 
        for (s=0;s<lp_numservices(global_loadparm);s++) {
                struct loadparm_service *service = lp_servicebynum(global_loadparm, s);
index d19a26ac0e60ac25944f564586e2da7bcd38f97a..77a333f003bda150105eb6296dcc050ce27a32a5 100644 (file)
@@ -174,7 +174,7 @@ static int http_readFileFromSwatDir(EspHandle handle,
                                        int *len,
                                        const char *path)
 {
-    return http_readFile(handle, buf, len, path, lp_swat_directory());
+    return http_readFile(handle, buf, len, path, lp_swat_directory(global_loadparm));
 }
 
 
@@ -388,7 +388,7 @@ static void http_simple_request(struct websrv_context *web)
        const char *path;
        struct stat st;
 
-       path = http_local_path(web, url, lp_swat_directory());
+       path = http_local_path(web, url, lp_swat_directory(global_loadparm));
        if (path == NULL) goto invalid;
 
        /* looks ok */
@@ -470,7 +470,7 @@ static void http_setup_arrays(struct esp_state *esp)
                       talloc_asprintf(esp, "%u", socket_address->port));
        }
 
-       SETVAR(ESP_SERVER_OBJ, "DOCUMENT_ROOT", lp_swat_directory());
+       SETVAR(ESP_SERVER_OBJ, "DOCUMENT_ROOT", lp_swat_directory(global_loadparm));
        SETVAR(ESP_SERVER_OBJ, "SERVER_PROTOCOL", tls_enabled(web->conn->socket)?"https":"http");
        SETVAR(ESP_SERVER_OBJ, "SERVER_SOFTWARE", "SAMBA");
        SETVAR(ESP_SERVER_OBJ, "GATEWAY_INTERFACE", "CGI/1.1");
@@ -515,7 +515,7 @@ static void esp_request(struct esp_state *esp, const char *url)
        int res;
        char *emsg = NULL, *buf;
 
-       if (http_readFile(web, &buf, &size, url, lp_swat_directory()) != 0) {
+       if (http_readFile(web, &buf, &size, url, lp_swat_directory(global_loadparm)) != 0) {
                http_error_unix(web, url);
                return;
        }
@@ -547,7 +547,7 @@ static BOOL http_preauth(struct esp_state *esp)
 {
        const char *path = http_local_path(esp->web,
                                            HTTP_PREAUTH_URI,
-                                           lp_swat_directory());
+                                           lp_swat_directory(global_loadparm));
        int i;
        if (path == NULL) {
                http_error(esp->web, 500, "Internal server error");
index 221c792f14fe2aca3e172f0d9122bbf604435fbe..2e803398716c6553d650130990cc0f476a490966 100644 (file)
@@ -241,7 +241,7 @@ static const struct stream_server_ops web_stream_ops = {
 static void websrv_task_init(struct task_server *task)
 {
        NTSTATUS status;
-       uint16_t port = lp_web_port();
+       uint16_t port = lp_web_port(global_loadparm);
        const struct model_ops *model_ops;
 
        task_server_set_title(task, "task[websrv]");
@@ -250,7 +250,7 @@ static void websrv_task_init(struct task_server *task)
        model_ops = process_model_byname("single");
        if (!model_ops) goto failed;
 
-       if (lp_interfaces() && lp_bind_interfaces_only()) {
+       if (lp_interfaces(global_loadparm) && lp_bind_interfaces_only(global_loadparm)) {
                int num_interfaces = iface_count();
                int i;
                for(i = 0; i < num_interfaces; i++) {
@@ -264,7 +264,7 @@ static void websrv_task_init(struct task_server *task)
        } else {
                status = stream_setup_socket(task->event_ctx, model_ops, 
                                             &web_stream_ops, 
-                                            "ipv4", lp_socket_address(), 
+                                            "ipv4", lp_socket_address(global_loadparm), 
                                             &port, task);
                if (!NT_STATUS_IS_OK(status)) goto failed;
        }
index 059fae52010256622d8b556e5ea1cf1b5fb77f88..653b598ac3d682c54a67953788426293550e4d45 100644 (file)
@@ -124,12 +124,12 @@ static void cmd_getpwnam_recv_user_info(struct composite_context *ctx)
        WBSRV_SAMBA3_SET_STRING(pw->pw_name, user_info->out.account_name);
        WBSRV_SAMBA3_SET_STRING(pw->pw_passwd, "*");
        WBSRV_SAMBA3_SET_STRING(pw->pw_gecos, user_info->out.full_name);
-       WBSRV_SAMBA3_SET_STRING(pw->pw_dir, lp_template_homedir());
+       WBSRV_SAMBA3_SET_STRING(pw->pw_dir, lp_template_homedir(global_loadparm));
        all_string_sub(pw->pw_dir, "%WORKGROUP%", state->workgroup_name,
                        sizeof(fstring) - 1);
        all_string_sub(pw->pw_dir, "%ACCOUNTNAME%", user_info->out.account_name,
                        sizeof(fstring) - 1);
-       WBSRV_SAMBA3_SET_STRING(pw->pw_shell, lp_template_shell());
+       WBSRV_SAMBA3_SET_STRING(pw->pw_shell, lp_template_shell(global_loadparm));
 
 &nbs