The Samba-Bugzilla – Attachment 758 Details for
Bug 1999
samba cannot join Win2K ADS domain with a non-ascii domain name
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Ugly patch to allow "net ads join", etc to work on a Win2k active directory domain with a non-ascii name
samba-3.0.8pre2-non-ascii-domain.patch (text/plain), 5.04 KB, created by
Jay Fenlason - please log in and update your mail address here and let us enable Bugmails to you again, Jay
on 2004-11-05 07:52:39 UTC
(
hide
)
Description:
Ugly patch to allow "net ads join", etc to work on a Win2k active directory domain with a non-ascii name
Filename:
MIME Type:
Creator:
Jay Fenlason - please log in and update your mail address here and let us enable Bugmails to you again, Jay
Created:
2004-11-05 07:52:39 UTC
Size:
5.04 KB
patch
obsolete
>--- samba-3.0.8pre2/source/libsmb/clispnego.c 2004-10-25 17:05:00.000000000 -0400 >+++ samba-3.0.8pre2-saved/source/libsmb/clispnego.c 2004-10-28 18:26:47.000000000 -0400 >@@ -130,6 +130,8 @@ > int i; > BOOL ret; > ASN1_DATA data; >+ char *tmp_ptr; >+ char *tmp_ptr2; > > asn1_load(&data, blob); > >@@ -152,7 +154,13 @@ > asn1_start_tag(&data, ASN1_CONTEXT(3)); > asn1_start_tag(&data, ASN1_SEQUENCE(0)); > asn1_start_tag(&data, ASN1_CONTEXT(0)); >- asn1_read_GeneralString(&data,principal); >+ tmp_ptr = NULL; >+ asn1_read_GeneralString(&data,&tmp_ptr); >+ convert_string_allocate ( 0, CH_MS_ANSI, CH_UTF8, tmp_ptr, 1 + strlen ( tmp_ptr ), &tmp_ptr2, False ); >+ free ( tmp_ptr ); >+ *principal = strdup ( tmp_ptr2 ); >+ SAFE_FREE ( tmp_ptr2 ); >+ > asn1_end_tag(&data); > asn1_end_tag(&data); > asn1_end_tag(&data); >--- samba-3.0.8pre2/source/libads/ldap.c 2004-10-29 15:24:12.000000000 -0400 >+++ samba-3.0.8pre2-saved/source/libads/ldap.c 2004-10-28 17:04:40.000000000 -0400 >@@ -2408,7 +2408,8 @@ > SAFE_FREE(ads->config.realm); > SAFE_FREE(ads->config.bind_path); > >- ads->config.realm = strdup(p+2); >+ convert_string_allocate(0, CH_MS_ANSI, CH_UTF8, >+ p+2, 1+strlen(p+2), (void**)&(ads->config.realm), False); > ads->config.bind_path = ads_build_dn(ads->config.realm); > > DEBUG(3,("got ldap server name %s@%s, using bind path: %s\n", >--- samba-3.0.8pre2/source/libads/kerberos.c 2004-10-29 15:24:12.000000000 -0400 >+++ samba-3.0.8pre2-saved/source/libads/kerberos.c 2004-10-29 15:22:21.000000000 -0400 >@@ -352,6 +352,7 @@ > > memset(&passdata, 0, sizeof(passdata)); > memset(&key, 0, sizeof(key)); >+ memset(&creds, 0, sizeof(creds)); > > old_krb5ccname = NULL; > if (getenv("KRB5CCNAME") != NULL) { >@@ -367,8 +368,9 @@ > if (password == NULL) { > goto out; > } >- if ((i = kerberos_kinit_password(machine_account, password, >- 0, NULL))) { >+ i = kerberos_kinit_password(machine_account, password, >+ 0, NULL); >+ if (i) { > DEBUG(0,("kerberos_kinit_password %s@%s failed: %s\n", > machine_account, > lp_realm(), >@@ -376,7 +378,6 @@ > goto out; > } > >- ctx = NULL; > if ((i = krb5_init_context(&ctx))) { > DEBUG(3, ("verify_password: kdb5_init_context failed: %s\n", > error_message(i))); >@@ -390,7 +391,6 @@ > goto out; > } > >- memset(&creds, 0, sizeof(creds)); > creds.keyblock.enctype = enctype; > if ((i = krb5_cc_get_principal(ctx, ccache, &creds.client))) { > DEBUG(3, ("verify_password: krb5_cc_get_principal failed: %s\n", >--- samba-3.0.8pre2/source/libads/kerberos.c 2004-11-03 15:02:20.000000000 -0500 >+++ samba-3.0.8pre2-nonascii/source/libads/kerberos.c 2004-11-02 11:24:37.000000000 -0500 >@@ -371,9 +371,8 @@ > i = kerberos_kinit_password(machine_account, password, > 0, NULL); > if (i) { >- DEBUG(0,("kerberos_kinit_password %s@%s failed: %s\n", >- machine_account, >- lp_realm(), >+ DEBUG(0,("kerberos_kinit_password %s %s failed: %s\n", >+ machine_account, password, > error_message(i))); > goto out; > } >@@ -566,6 +565,7 @@ > if (verify_service_password(service_principal, > salting_principals[i], > enctype)) { >+ DEBUG(10,("kerberos_derive_salting_principal_for_enctype: salt %d\n", i)); > break; > } > } >--- samba-3.0.8pre2/source/lib/charcnv.c 2004-10-25 17:05:00.000000000 -0400 >+++ samba-3.0.8pre2-saved/source/lib/charcnv.c 2004-10-28 16:29:25.000000000 -0400 >@@ -61,6 +61,7 @@ > else if (ch == CH_DOS) ret = lp_dos_charset(); > else if (ch == CH_DISPLAY) ret = lp_display_charset(); > else if (ch == CH_UTF8) ret = "UTF8"; >+ else if ( ch == CH_MS_ANSI ) ret = "CP1252"; > > #if defined(HAVE_NL_LANGINFO) && defined(CODESET) > if (ret && !strcmp(ret, "LOCALE")) { >--- samba-3.0.8pre2/source/include/charset.h 2004-10-25 17:05:06.000000000 -0400 >+++ samba-3.0.8pre2-saved/source/include/charset.h 2004-10-28 16:37:03.000000000 -0400 >@@ -20,9 +20,9 @@ > */ > > /* this defines the charset types used in samba */ >-typedef enum {CH_UCS2=0, CH_UNIX=1, CH_DISPLAY=2, CH_DOS=3, CH_UTF8=4} charset_t; >+typedef enum {CH_UCS2=0, CH_UNIX=1, CH_DISPLAY=2, CH_DOS=3, CH_UTF8=4,CH_MS_ANSI=5} charset_t; > >-#define NUM_CHARSETS 5 >+#define NUM_CHARSETS 6 > > /* > * for each charset we have a function that pushes from that charset to a ucs2 >diff -u -r samba-3.0.8pre2/source/include/config.h samba-3.0.8pre2-saved/source/include/config.h >diff -u -r samba-3.0.8pre2/source/utils/ntlm_auth.c samba-3.0.8pre2-nonascii/source/utils/ntlm_auth.c >--- samba-3.0.8pre2/source/utils/ntlm_auth.c 2004-11-03 15:02:20.000000000 -0500 >+++ samba-3.0.8pre2-nonascii/source/utils/ntlm_auth.c 2004-11-03 10:01:09.000000000 -0500 >@@ -1156,6 +1156,7 @@ > return False; > } > >+#if 0 > principal = malloc(spnego.negTokenInit.mechListMIC.length+1); > > if (principal == NULL) { >@@ -1166,6 +1167,11 @@ > memcpy(principal, spnego.negTokenInit.mechListMIC.data, > spnego.negTokenInit.mechListMIC.length); > principal[spnego.negTokenInit.mechListMIC.length] = '\0'; >+#else >+ convert_string_allocate(0, CH_MS_ANSI, CH_UTF8, >+spnego.negTokenInit.mechListMIC.data, spnego.negTokenInit.mechListMIC.length >+, (void**)&(principal), False); >+#endif > > retval = cli_krb5_get_ticket(principal, 0, &tkt, &session_key_krb5); >
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
Actions:
View
Attachments on
bug 1999
:
755
|
756
|
758