summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rw-r--r--source4/auth/credentials/credentials_files.c10
-rw-r--r--source4/auth/credentials/credentials_krb5.c9
-rw-r--r--source4/cldap_server/netlogon.c4
-rw-r--r--source4/client/client.c6
-rw-r--r--source4/client/smbmount.c4
-rw-r--r--source4/dsdb/repl/drepl_service.c3
-rw-r--r--source4/dsdb/samdb/ldb_modules/proxy.c2
-rw-r--r--source4/lib/cmdline/popt_credentials.c2
-rw-r--r--source4/libcli/cldap/cldap.c2
-rw-r--r--source4/libcli/cldap/cldap.h2
-rw-r--r--source4/libnet/libnet_become_dc.c1
-rw-r--r--source4/libnet/libnet_site.c1
-rw-r--r--source4/libnet/libnet_unbecome_dc.c1
-rw-r--r--source4/librpc/rpc/dcerpc_connect.c2
-rw-r--r--source4/torture/ldap/cldap.c47
-rw-r--r--source4/torture/ldap/cldapbench.c1
-rw-r--r--source4/torture/rpc/dssync.c1
-rw-r--r--source4/torture/util_smb.c5
18 files changed, 60 insertions, 43 deletions
diff --git a/source4/auth/credentials/credentials_files.c b/source4/auth/credentials/credentials_files.c
index f3f73f7fb1..1f4b467371 100644
--- a/source4/auth/credentials/credentials_files.c
+++ b/source4/auth/credentials/credentials_files.c
@@ -335,7 +335,8 @@ NTSTATUS cli_credentials_set_machine_account(struct cli_credentials *cred)
cred->machine_account_pending = false;
filter = talloc_asprintf(cred, SECRETS_PRIMARY_DOMAIN_FILTER,
cli_credentials_get_domain(cred));
- return cli_credentials_set_secrets(cred, global_loadparm, NULL, SECRETS_PRIMARY_DOMAIN_DN,
+ return cli_credentials_set_secrets(cred, global_loadparm, NULL,
+ SECRETS_PRIMARY_DOMAIN_DN,
filter);
}
@@ -355,7 +356,8 @@ NTSTATUS cli_credentials_set_krbtgt(struct cli_credentials *cred)
filter = talloc_asprintf(cred, SECRETS_KRBTGT_SEARCH,
cli_credentials_get_realm(cred),
cli_credentials_get_domain(cred));
- return cli_credentials_set_secrets(cred, global_loadparm, NULL, SECRETS_PRINCIPALS_DN,
+ return cli_credentials_set_secrets(cred, global_loadparm, NULL,
+ SECRETS_PRINCIPALS_DN,
filter);
}
@@ -377,8 +379,8 @@ NTSTATUS cli_credentials_set_stored_principal(struct cli_credentials *cred,
cli_credentials_get_realm(cred),
cli_credentials_get_domain(cred),
serviceprincipal);
- return cli_credentials_set_secrets(cred, global_loadparm, NULL, SECRETS_PRINCIPALS_DN,
- filter);
+ return cli_credentials_set_secrets(cred, global_loadparm, NULL,
+ SECRETS_PRINCIPALS_DN, filter);
}
/**
diff --git a/source4/auth/credentials/credentials_krb5.c b/source4/auth/credentials/credentials_krb5.c
index 7bfad689ef..b963b61f1f 100644
--- a/source4/auth/credentials/credentials_krb5.c
+++ b/source4/auth/credentials/credentials_krb5.c
@@ -141,7 +141,8 @@ int cli_credentials_set_ccache(struct cli_credentials *cred,
return ENOMEM;
}
- ret = cli_credentials_get_krb5_context(cred, global_loadparm, &ccc->smb_krb5_context);
+ ret = cli_credentials_get_krb5_context(cred, global_loadparm,
+ &ccc->smb_krb5_context);
if (ret) {
talloc_free(ccc);
return ret;
@@ -215,7 +216,8 @@ static int cli_credentials_new_ccache(struct cli_credentials *cred, struct ccach
return ENOMEM;
}
- ret = cli_credentials_get_krb5_context(cred, global_loadparm, &ccc->smb_krb5_context);
+ ret = cli_credentials_get_krb5_context(cred, global_loadparm,
+ &ccc->smb_krb5_context);
if (ret) {
talloc_free(ccc);
return ret;
@@ -225,7 +227,8 @@ static int cli_credentials_new_ccache(struct cli_credentials *cred, struct ccach
return ENOMEM;
}
- ret = krb5_cc_resolve(ccc->smb_krb5_context->krb5_context, ccache_name, &ccc->ccache);
+ ret = krb5_cc_resolve(ccc->smb_krb5_context->krb5_context, ccache_name,
+ &ccc->ccache);
if (ret) {
DEBUG(1,("failed to generate a new krb5 ccache (%s): %s\n",
ccache_name,
diff --git a/source4/cldap_server/netlogon.c b/source4/cldap_server/netlogon.c
index db07c8d618..beb1767138 100644
--- a/source4/cldap_server/netlogon.c
+++ b/source4/cldap_server/netlogon.c
@@ -327,7 +327,7 @@ void cldapd_netlogon_request(struct cldap_socket *cldap,
}
if (domain_guid == NULL && domain == NULL) {
- domain = lp_realm(global_loadparm);
+ domain = lp_realm(cldapd->task->lp_ctx);
}
if (version == -1) {
@@ -339,7 +339,7 @@ void cldapd_netlogon_request(struct cldap_socket *cldap,
status = cldapd_netlogon_fill(cldapd, tmp_ctx, domain, domain_guid,
user, src->addr,
- version, global_loadparm, &netlogon);
+ version, cldapd->task->lp_ctx, &netlogon);
if (!NT_STATUS_IS_OK(status)) {
goto failed;
}
diff --git a/source4/client/client.c b/source4/client/client.c
index a2fe29fc60..6debaac2e9 100644
--- a/source4/client/client.c
+++ b/source4/client/client.c
@@ -3066,7 +3066,7 @@ static int do_host_query(const char *query_host, const char *workgroup)
/****************************************************************************
handle a message operation
****************************************************************************/
-static int do_message_op(const char *netbios_name, const char *desthost, const char *destip, int name_type)
+static int do_message_op(const char *netbios_name, const char *desthost, const char *destip, int name_type, const char **name_resolve_order, int max_xmit, int max_mux)
{
struct nbt_name called, calling;
const char *server_name;
@@ -3078,7 +3078,7 @@ static int do_message_op(const char *netbios_name, const char *desthost, const c
server_name = destip ? destip : desthost;
- if (!(cli=smbcli_state_init(NULL)) || !smbcli_socket_connect(cli, server_name, lp_name_resolve_order(global_loadparm), lp_max_xmit(global_loadparm), lp_maxmux(global_loadparm))) {
+ if (!(cli=smbcli_state_init(NULL)) || !smbcli_socket_connect(cli, server_name, name_resolve_order, max_xmit, max_mux)) {
d_printf("Connection to %s failed\n", server_name);
return 1;
}
@@ -3223,7 +3223,7 @@ static int do_message_op(const char *netbios_name, const char *desthost, const c
}
if (message) {
- return do_message_op(lp_netbios_name(global_loadparm), desthost, dest_ip, name_type);
+ return do_message_op(lp_netbios_name(global_loadparm), desthost, dest_ip, name_type, lp_name_resolve_order(global_loadparm), lp_max_xmit(global_loadparm), lp_maxmux(global_loadparm));
}
diff --git a/source4/client/smbmount.c b/source4/client/smbmount.c
index 8c0a6fcdf1..db16c6cf1f 100644
--- a/source4/client/smbmount.c
+++ b/source4/client/smbmount.c
@@ -406,7 +406,9 @@ static void send_fs_socket(const char *the_service, const char *mount_point, str
CatchSignal(SIGUSR1, &usr1_handler);
pause();
DEBUG(2,("mount.smbfs[%d]: got signal, getting new socket\n", sys_getpid()));
- c = do_connection(the_service, lp_unicode(global_loadparm), lp_cli_maxprotocol(global_loadparm));
+ c = do_connection(the_service,
+ lp_unicode(global_loadparm),
+ lp_cli_maxprotocol(global_loadparm));
}
}
diff --git a/source4/dsdb/repl/drepl_service.c b/source4/dsdb/repl/drepl_service.c
index fe24314c11..c3238a206f 100644
--- a/source4/dsdb/repl/drepl_service.c
+++ b/source4/dsdb/repl/drepl_service.c
@@ -37,7 +37,8 @@ static WERROR dreplsrv_init_creds(struct dreplsrv_service *service)
{
NTSTATUS status;
- status = auth_system_session_info(service, global_loadparm, &service->system_session_info);
+ status = auth_system_session_info(service, service->task->lp_ctx,
+ &service->system_session_info);
if (!NT_STATUS_IS_OK(status)) {
return ntstatus_to_werror(status);
}
diff --git a/source4/dsdb/samdb/ldb_modules/proxy.c b/source4/dsdb/samdb/ldb_modules/proxy.c
index 435422ae17..5f22982b8d 100644
--- a/source4/dsdb/samdb/ldb_modules/proxy.c
+++ b/source4/dsdb/samdb/ldb_modules/proxy.c
@@ -129,7 +129,7 @@ static int load_proxy_info(struct ldb_module *module)
ldb_oom(module->ldb);
goto failed;
}
- cli_credentials_guess(creds, NULL);
+ cli_credentials_guess(creds, global_loadparm);
cli_credentials_set_username(creds, username, CRED_SPECIFIED);
cli_credentials_set_password(creds, password, CRED_SPECIFIED);
diff --git a/source4/lib/cmdline/popt_credentials.c b/source4/lib/cmdline/popt_credentials.c
index d82cdc5100..03142a7602 100644
--- a/source4/lib/cmdline/popt_credentials.c
+++ b/source4/lib/cmdline/popt_credentials.c
@@ -60,7 +60,7 @@ static void popt_common_credentials_callback(poptContext con,
}
if (reason == POPT_CALLBACK_REASON_POST) {
- cli_credentials_guess(cmdline_credentials, NULL);
+ cli_credentials_guess(cmdline_credentials, global_loadparm);
if (!dont_ask) {
cli_credentials_set_cmdline_callbacks(cmdline_credentials);
diff --git a/source4/libcli/cldap/cldap.c b/source4/libcli/cldap/cldap.c
index 88421ad08d..87a8957fbc 100644
--- a/source4/libcli/cldap/cldap.c
+++ b/source4/libcli/cldap/cldap.c
@@ -572,7 +572,7 @@ struct cldap_request *cldap_netlogon_send(struct cldap_socket *cldap,
if (filter == NULL) goto failed;
search.in.dest_address = io->in.dest_address;
- search.in.dest_port = lp_cldap_port(global_loadparm);
+ search.in.dest_port = io->in.dest_port;
search.in.filter = filter;
search.in.attributes = attr;
search.in.timeout = 2;
diff --git a/source4/libcli/cldap/cldap.h b/source4/libcli/cldap/cldap.h
index cdee775aa7..217ac0ff1b 100644
--- a/source4/libcli/cldap/cldap.h
+++ b/source4/libcli/cldap/cldap.h
@@ -73,6 +73,7 @@ struct cldap_request {
struct cldap_socket {
struct socket_context *sock;
struct event_context *event_ctx;
+ struct loadparm_context *lp_ctx;
/* the fd event */
struct fd_event *fde;
@@ -151,6 +152,7 @@ NTSTATUS cldap_error_reply(struct cldap_socket *cldap,
struct cldap_netlogon {
struct {
const char *dest_address;
+ uint16_t dest_port;
const char *realm;
const char *host;
const char *user;
diff --git a/source4/libnet/libnet_become_dc.c b/source4/libnet/libnet_become_dc.c
index 2673af8e0f..e8b1632e73 100644
--- a/source4/libnet/libnet_become_dc.c
+++ b/source4/libnet/libnet_become_dc.c
@@ -738,6 +738,7 @@ static void becomeDC_send_cldap(struct libnet_BecomeDC_state *s)
struct cldap_request *req;
s->cldap.io.in.dest_address = s->source_dsa.address;
+ s->cldap.io.in.dest_port = lp_cldap_port(global_loadparm);
s->cldap.io.in.realm = s->domain.dns_name;
s->cldap.io.in.host = s->dest_dsa.netbios_name;
s->cldap.io.in.user = NULL;
diff --git a/source4/libnet/libnet_site.c b/source4/libnet/libnet_site.c
index 251cecb3b0..9351aef634 100644
--- a/source4/libnet/libnet_site.c
+++ b/source4/libnet/libnet_site.c
@@ -51,6 +51,7 @@ NTSTATUS libnet_FindSite(TALLOC_CTX *ctx, struct libnet_JoinSite *r)
/* Resolve the site name. */
ZERO_STRUCT(search);
search.in.dest_address = r->in.dest_address;
+ search.in.dest_port = lp_cldap_port(global_loadparm);
search.in.acct_control = -1;
search.in.version = 6;
diff --git a/source4/libnet/libnet_unbecome_dc.c b/source4/libnet/libnet_unbecome_dc.c
index 8b27d85718..a7b962f2a8 100644
--- a/source4/libnet/libnet_unbecome_dc.c
+++ b/source4/libnet/libnet_unbecome_dc.c
@@ -258,6 +258,7 @@ static void unbecomeDC_send_cldap(struct libnet_UnbecomeDC_state *s)
struct cldap_request *req;
s->cldap.io.in.dest_address = s->source_dsa.address;
+ s->cldap.io.in.dest_port = lp_cldap_port(global_loadparm);
s->cldap.io.in.realm = s->domain.dns_name;
s->cldap.io.in.host = s->dest_dsa.netbios_name;
s->cldap.io.in.user = NULL;
diff --git a/source4/librpc/rpc/dcerpc_connect.c b/source4/librpc/rpc/dcerpc_connect.c
index d19dac9fe5..6c6441790b 100644
--- a/source4/librpc/rpc/dcerpc_connect.c
+++ b/source4/librpc/rpc/dcerpc_connect.c
@@ -230,7 +230,7 @@ static struct composite_context *dcerpc_pipe_connect_ncacn_np_smb2_send(TALLOC_C
s->io.creds = cli_credentials_init(mem_ctx);
if (composite_nomem(s->io.creds, c)) return c;
- cli_credentials_guess(s->io.creds, NULL);
+ cli_credentials_guess(s->io.creds, global_loadparm);
}
/* send smb2 connect request */
diff --git a/source4/torture/ldap/cldap.c b/source4/torture/ldap/cldap.c
index ddb966683f..59def79845 100644
--- a/source4/torture/ldap/cldap.c
+++ b/source4/torture/ldap/cldap.c
@@ -40,9 +40,9 @@
/*
test netlogon operations
*/
-static bool test_cldap_netlogon(TALLOC_CTX *mem_ctx, const char *dest)
+static bool test_cldap_netlogon(struct torture_context *tctx, const char *dest)
{
- struct cldap_socket *cldap = cldap_socket_init(mem_ctx, NULL);
+ struct cldap_socket *cldap = cldap_socket_init(tctx, NULL);
NTSTATUS status;
struct cldap_netlogon search, empty_search;
union nbt_cldap_netlogon n1;
@@ -52,6 +52,7 @@ static bool test_cldap_netlogon(TALLOC_CTX *mem_ctx, const char *dest)
ZERO_STRUCT(search);
search.in.dest_address = dest;
+ search.in.dest_port = lp_cldap_port(tctx->lp_ctx);
search.in.acct_control = -1;
search.in.version = 6;
@@ -59,7 +60,7 @@ static bool test_cldap_netlogon(TALLOC_CTX *mem_ctx, const char *dest)
printf("Trying without any attributes\n");
search = empty_search;
- status = cldap_netlogon(cldap, mem_ctx, &search);
+ status = cldap_netlogon(cldap, tctx, &search);
CHECK_STATUS(status, NT_STATUS_OK);
n1 = search.out.netlogon;
@@ -72,7 +73,7 @@ static bool test_cldap_netlogon(TALLOC_CTX *mem_ctx, const char *dest)
for (i=0;i<256;i++) {
search.in.version = i;
printf("Trying netlogon level %d\n", i);
- status = cldap_netlogon(cldap, mem_ctx, &search);
+ status = cldap_netlogon(cldap, tctx, &search);
CHECK_STATUS(status, NT_STATUS_OK);
}
@@ -80,82 +81,82 @@ static bool test_cldap_netlogon(TALLOC_CTX *mem_ctx, const char *dest)
for (i=0;i<31;i++) {
search.in.version = (1<<i);
printf("Trying netlogon level 0x%x\n", i);
- status = cldap_netlogon(cldap, mem_ctx, &search);
+ status = cldap_netlogon(cldap, tctx, &search);
CHECK_STATUS(status, NT_STATUS_OK);
}
search.in.version = 6;
- status = cldap_netlogon(cldap, mem_ctx, &search);
+ status = cldap_netlogon(cldap, tctx, &search);
CHECK_STATUS(status, NT_STATUS_OK);
printf("Trying with User=NULL\n");
search.in.user = NULL;
- status = cldap_netlogon(cldap, mem_ctx, &search);
+ status = cldap_netlogon(cldap, tctx, &search);
CHECK_STATUS(status, NT_STATUS_OK);
printf("Trying with User=Administrator\n");
search.in.user = "Administrator";
- status = cldap_netlogon(cldap, mem_ctx, &search);
+ status = cldap_netlogon(cldap, tctx, &search);
CHECK_STATUS(status, NT_STATUS_OK);
printf("Trying with a GUID\n");
search.in.realm = NULL;
- search.in.domain_guid = GUID_string(mem_ctx, &n1.logon5.domain_uuid);
- status = cldap_netlogon(cldap, mem_ctx, &search);
+ search.in.domain_guid = GUID_string(tctx, &n1.logon5.domain_uuid);
+ status = cldap_netlogon(cldap, tctx, &search);
CHECK_STATUS(status, NT_STATUS_OK);
printf("Trying with a incorrect GUID\n");
guid = GUID_random();
search.in.user = NULL;
- search.in.domain_guid = GUID_string(mem_ctx, &guid);
- status = cldap_netlogon(cldap, mem_ctx, &search);
+ search.in.domain_guid = GUID_string(tctx, &guid);
+ status = cldap_netlogon(cldap, tctx, &search);
CHECK_STATUS(status, NT_STATUS_NOT_FOUND);
printf("Trying with a AAC\n");
search.in.acct_control = 0x180;
search.in.realm = n1.logon5.dns_domain;
- status = cldap_netlogon(cldap, mem_ctx, &search);
+ status = cldap_netlogon(cldap, tctx, &search);
CHECK_STATUS(status, NT_STATUS_OK);
printf("Trying with a bad AAC\n");
search.in.acct_control = 0xFF00FF00;
search.in.realm = n1.logon5.dns_domain;
- status = cldap_netlogon(cldap, mem_ctx, &search);
+ status = cldap_netlogon(cldap, tctx, &search);
CHECK_STATUS(status, NT_STATUS_OK);
printf("Trying with a user only\n");
search = empty_search;
search.in.user = "Administrator";
- status = cldap_netlogon(cldap, mem_ctx, &search);
+ status = cldap_netlogon(cldap, tctx, &search);
CHECK_STATUS(status, NT_STATUS_OK);
printf("Trying with just a bad username\n");
search.in.user = "___no_such_user___";
- status = cldap_netlogon(cldap, mem_ctx, &search);
+ status = cldap_netlogon(cldap, tctx, &search);
CHECK_STATUS(status, NT_STATUS_OK);
printf("Trying with just a bad domain\n");
search = empty_search;
search.in.realm = "___no_such_domain___";
- status = cldap_netlogon(cldap, mem_ctx, &search);
+ status = cldap_netlogon(cldap, tctx, &search);
CHECK_STATUS(status, NT_STATUS_NOT_FOUND);
printf("Trying with a incorrect domain and correct guid\n");
- search.in.domain_guid = GUID_string(mem_ctx, &n1.logon5.domain_uuid);
- status = cldap_netlogon(cldap, mem_ctx, &search);
+ search.in.domain_guid = GUID_string(tctx, &n1.logon5.domain_uuid);
+ status = cldap_netlogon(cldap, tctx, &search);
CHECK_STATUS(status, NT_STATUS_OK);
printf("Trying with a incorrect domain and incorrect guid\n");
- search.in.domain_guid = GUID_string(mem_ctx, &guid);
- status = cldap_netlogon(cldap, mem_ctx, &search);
+ search.in.domain_guid = GUID_string(tctx, &guid);
+ status = cldap_netlogon(cldap, tctx, &search);
CHECK_STATUS(status, NT_STATUS_NOT_FOUND);
printf("Trying with a incorrect GUID and correct domain\n");
- search.in.domain_guid = GUID_string(mem_ctx, &guid);
+ search.in.domain_guid = GUID_string(tctx, &guid);
search.in.realm = n1.logon5.dns_domain;
- status = cldap_netlogon(cldap, mem_ctx, &search);
+ status = cldap_netlogon(cldap, tctx, &search);
CHECK_STATUS(status, NT_STATUS_OK);
done:
diff --git a/source4/torture/ldap/cldapbench.c b/source4/torture/ldap/cldapbench.c
index 21fe3849b1..47b1348ef6 100644
--- a/source4/torture/ldap/cldapbench.c
+++ b/source4/torture/ldap/cldapbench.c
@@ -63,6 +63,7 @@ static bool bench_cldap(struct torture_context *tctx, const char *address)
ZERO_STRUCT(search);
search.in.dest_address = address;
+ search.in.dest_port = lp_cldap_port(tctx->lp_ctx);
search.in.acct_control = -1;
search.in.version = 6;
diff --git a/source4/torture/rpc/dssync.c b/source4/torture/rpc/dssync.c
index 738a049e73..14164321b9 100644
--- a/source4/torture/rpc/dssync.c
+++ b/source4/torture/rpc/dssync.c
@@ -284,6 +284,7 @@ static bool test_GetInfo(struct torture_context *tctx, struct DsSyncTest *ctx)
ZERO_STRUCT(search);
search.in.dest_address = ctx->drsuapi_binding->host;
+ search.in.dest_port = lp_cldap_port(tctx->lp_ctx);
search.in.acct_control = -1;
search.in.version = 6;
status = cldap_netlogon(cldap, ctx, &search);
diff --git a/source4/torture/util_smb.c b/source4/torture/util_smb.c
index 6e6acf220f..65dfaec1cc 100644
--- a/source4/torture/util_smb.c
+++ b/source4/torture/util_smb.c
@@ -279,11 +279,12 @@ void *shm_setup(int size)
}
-/*
+/**
check that a wire string matches the flags specified
not 100% accurate, but close enough for testing
*/
-bool wire_bad_flags(struct smb_wire_string *str, int flags, struct smbcli_transport *transport)
+bool wire_bad_flags(struct smb_wire_string *str, int flags,
+ struct smbcli_transport *transport)
{
bool server_unicode;
int len;