1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

r25398: Parse loadparm context to all lp_*() functions.

(This used to be commit 3fcc960839)
This commit is contained in:
Jelmer Vernooij 2007-09-28 01:17:46 +00:00 committed by Gerald (Jerry) Carter
parent e09226cb35
commit 37d53832a4
164 changed files with 643 additions and 617 deletions

View 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;

View 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:

View 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));

View 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);

View 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");

View File

@ -127,6 +127,7 @@ struct cli_credentials {
};
struct ldb_context;
struct loadparm_context;
#include "auth/credentials/credentials_proto.h"
#endif /* __CREDENTIALS_H__ */

View 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);

View 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);

View 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;
}

View 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);

View 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;

View 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;

View 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;
}

View 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);

View 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 {

View 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) {

View 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;;) {

View 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) {

View 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());
}

View 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);
}

View 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;

View 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)) {

View 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;

View 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;

View 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,

View 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;

View 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;
}

View 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;

View 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);
}

View 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);

View 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;

View 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;

View 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 */

View 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;
}

View 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);

View 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);

View 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);

View 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;
}

View 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);

View 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,

View 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;

View 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);

View 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);

View 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);

View 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);

View 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;

View 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;

View 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)) {

View 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;
}

View 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;

View 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);
}

View 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);
}

View 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;
}

View 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;

View 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 */

View 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);
}

View 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);

View 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);

View 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

View 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);

View 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?");

View 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

View 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 */

View 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;

View 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";

View 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;

View 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;
}

View 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);
}

View 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;
}

View 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;
}

View 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);

View 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;

View 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;

View 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;

View 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);

View 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;

View 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;
}

View 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 = "?????";

View 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;
}

View 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_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, &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_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)

View 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;
}

View 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);
}
/*

View 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);
}

View 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;

View 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;

View 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)));

View 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;

View 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);

View 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);
}

View 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:

View 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) {

View 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;

View 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);

View File

@ -142,7 +142,7 @@ sub handle_loadparm($$)
);
my %smap = (
"GLOBAL" => "void",
"GLOBAL" => "struct loadparm_context *",
"LOCAL" => "struct loadparm_service *"
);

View 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);

View 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");

View 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;

View 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();
}

View 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);
}

View 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");

Some files were not shown because too many files have changed in this diff Show More