The Samba-Bugzilla – Attachment 6466 Details for
Bug 8156
net ads join fails to use the user's kerberos ticket
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
git-am fix for 3.6.0
0001-If-kerberos_get_realm_from_hostname-or-kerberos_get_.patch (text/plain), 2.27 KB, created by
Jeremy Allison
on 2011-05-20 23:11:58 UTC
(
hide
)
Description:
git-am fix for 3.6.0
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2011-05-20 23:11:58 UTC
Size:
2.27 KB
patch
obsolete
>From 77fba55740d7306c770b4b14ff834002005238d4 Mon Sep 17 00:00:00 2001 >From: Jeremy Allison <jra@samba.org> >Date: Fri, 20 May 2011 14:43:50 -0700 >Subject: [PATCH] Patch for bug #8156 - net ads join fails to use the user's kerberos ticket. > >If kerberos_get_realm_from_hostname() or kerberos_get_default_realm_from_ccache() fails due to > a misconfigured krb5.conf, try the "realm =" from smb.conf as a fallcback before going back to > NTLMSSP (which we'll do anyway). > >--- > source3/libsmb/cliconnect.c | 37 +++++++++++++++++++++++++++---------- > 1 files changed, 27 insertions(+), 10 deletions(-) > >diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c >index fca6c3a..69d5ce6 100644 >--- a/source3/libsmb/cliconnect.c >+++ b/source3/libsmb/cliconnect.c >@@ -1871,6 +1871,9 @@ ADS_STATUS cli_session_setup_spnego(struct cli_state *cli, const char *user, > host = strchr_m(cli->desthost, '.'); > if (dest_realm) { > realm = SMB_STRDUP(dest_realm); >+ if (!realm) { >+ return ADS_ERROR_NT(NT_STATUS_NO_MEMORY); >+ } > strupper_m(realm); > } else { > if (host) { >@@ -1882,19 +1885,33 @@ ADS_STATUS cli_session_setup_spnego(struct cli_state *cli, const char *user, > } > } > >- if (realm && *realm) { >- principal = talloc_asprintf(talloc_tos(), >- "cifs/%s@%s", >- cli->desthost, >- realm); >- if (!principal) { >- SAFE_FREE(realm); >+ if (realm == NULL || *realm == '\0') { >+ realm = SMB_STRDUP(lp_realm()); >+ if (!realm) { > return ADS_ERROR_NT(NT_STATUS_NO_MEMORY); > } >- DEBUG(3,("cli_session_setup_spnego: guessed " >- "server principal=%s\n", >- principal ? principal : "<null>")); >+ strupper_m(realm); >+ DEBUG(3,("cli_session_setup_spnego: cannot " >+ "get realm from dest_realm %s, " >+ "desthost %s. Using default " >+ "smb.conf realm %s\n", >+ dest_realm ? dest_realm : "<null>", >+ cli->desthost, >+ realm)); > } >+ >+ principal = talloc_asprintf(talloc_tos(), >+ "cifs/%s@%s", >+ cli->desthost, >+ realm); >+ if (!principal) { >+ SAFE_FREE(realm); >+ return ADS_ERROR_NT(NT_STATUS_NO_MEMORY); >+ } >+ DEBUG(3,("cli_session_setup_spnego: guessed " >+ "server principal=%s\n", >+ principal ? principal : "<null>")); >+ > SAFE_FREE(realm); > } > >-- >1.7.3.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
kai
:
review+
Actions:
View
Attachments on
bug 8156
:
6461
| 6466