summaryrefslogtreecommitdiff
path: root/source/auth
diff options
context:
space:
mode:
Diffstat (limited to 'source/auth')
-rw-r--r--source/auth/auth_domain.c9
-rw-r--r--source/auth/auth_ntlmssp.c8
-rw-r--r--source/auth/auth_server.c1
-rw-r--r--source/auth/auth_util.c2
4 files changed, 15 insertions, 5 deletions
diff --git a/source/auth/auth_domain.c b/source/auth/auth_domain.c
index a32677d037..115c57fbe0 100644
--- a/source/auth/auth_domain.c
+++ b/source/auth/auth_domain.c
@@ -125,11 +125,14 @@ machine %s. Error was : %s.\n", dc_name, nt_errstr(result)));
if (!lp_client_schannel()) {
/* We need to set up a creds chain on an unauthenticated netlogon pipe. */
- uint32 neg_flags = NETLOGON_NEG_AUTH2_FLAGS;
+ uint32 neg_flags = NETLOGON_NEG_SELECT_AUTH2_FLAGS;
uint32 sec_chan_type = 0;
unsigned char machine_pwd[16];
+ const char *account_name;
- if (!get_trust_pw(domain, machine_pwd, &sec_chan_type)) {
+ if (!get_trust_pw_hash(domain, machine_pwd, &account_name,
+ &sec_chan_type))
+ {
DEBUG(0, ("connect_to_domain_password_server: could not fetch "
"trust account password for domain '%s'\n",
domain));
@@ -143,7 +146,7 @@ machine %s. Error was : %s.\n", dc_name, nt_errstr(result)));
dc_name, /* server name */
domain, /* domain */
global_myname(), /* client name */
- global_myname(), /* machine account name */
+ account_name, /* machine account name */
machine_pwd,
sec_chan_type,
&neg_flags);
diff --git a/source/auth/auth_ntlmssp.c b/source/auth/auth_ntlmssp.c
index 51b145a760..a49b36a0a1 100644
--- a/source/auth/auth_ntlmssp.c
+++ b/source/auth/auth_ntlmssp.c
@@ -187,7 +187,13 @@ NTSTATUS auth_ntlmssp_start(AUTH_NTLMSSP_STATE **auth_ntlmssp_state)
void auth_ntlmssp_end(AUTH_NTLMSSP_STATE **auth_ntlmssp_state)
{
- TALLOC_CTX *mem_ctx = (*auth_ntlmssp_state)->mem_ctx;
+ TALLOC_CTX *mem_ctx;
+
+ if (*auth_ntlmssp_state == NULL) {
+ return;
+ }
+
+ mem_ctx = (*auth_ntlmssp_state)->mem_ctx;
if ((*auth_ntlmssp_state)->ntlmssp_state) {
ntlmssp_end(&(*auth_ntlmssp_state)->ntlmssp_state);
diff --git a/source/auth/auth_server.c b/source/auth/auth_server.c
index d490b1a467..ba2a714539 100644
--- a/source/auth/auth_server.c
+++ b/source/auth/auth_server.c
@@ -71,6 +71,7 @@ static struct cli_state *server_cryptkey(TALLOC_CTX *mem_ctx)
connection (tridge) */
if (!grab_server_mutex(desthost)) {
+ cli_shutdown(cli);
return NULL;
}
diff --git a/source/auth/auth_util.c b/source/auth/auth_util.c
index 32224fa219..b3a3d39924 100644
--- a/source/auth/auth_util.c
+++ b/source/auth/auth_util.c
@@ -811,7 +811,7 @@ static NTSTATUS create_builtin_administrators( void )
return NT_STATUS_NO_MEMORY;
}
fstr_sprintf( root_name, "%s\\root", get_global_sam_name() );
- ret = lookup_name( ctx, root_name, 0, NULL, NULL, &root_sid, &type );
+ ret = lookup_name( ctx, root_name, LOOKUP_NAME_DOMAIN, NULL, NULL, &root_sid, &type );
TALLOC_FREE( ctx );
if ( ret ) {