init_uni_hdr() problem

Andrew Bartlett abartlet at pcug.org.au
Sun Oct 21 14:38:05 GMT 2001


TAKAHASHI Motonobu wrote:
> 
> In SUGJ(Samba Users Group Japan) mailing-list,
>   we disscussed that a Samba server joined multibyte-name domain
> cannot work and to apply the following patch fixed it.
> 
> The modified variables (len_domain_name, len_user_name and
> len_wksta_name) are passed in init_uni_hdr().
> 
> There are about 100 times of init_uni_hdr() call with strlen()'ed 2nd
> argument on both Samba 2.2.x and HEAD branch.
> I've not examined but suspect these should be modified as well, also
> init_unistr2() seems to have some problem.
> 
> any comments?

I looked at this problem a little while back and produced the following
patch:

http://samba.org/cgi-bin/samba-patches/incoming?id=479;expression=abartlet;user=guest

As you can see from the e-mail, I orgainaly attempted to apply the patch
to the tree, but bothched the implementation.  I think its ok now, but
havn't dared re-apply it.

Can you give it a test - I think it solves the problem a little better.

Thanks,

Andrew Bartlett

> --- parse_net.c 2001/05/03 19:11:43     1.1.1.1
> +++ parse_net.c 2001/09/22 14:37:52     1.2
> @@ -639,9 +639,9 @@
>                                 char sess_key[16],
>                                 unsigned char lm_cypher[16], unsigned char nt_cypher[16])
>  {
> -       int len_domain_name = strlen(domain_name);
> -       int len_user_name   = strlen(user_name  );
> -       int len_wksta_name  = strlen(wksta_name );
> +       int len_domain_name = str_charnum(domain_name);
> +       int len_user_name   = str_charnum(user_name  );
> +       int len_wksta_name  = str_charnum(wksta_name );
> 
>         unsigned char lm_owf[16];
>         unsigned char nt_owf[16];
> @@ -769,9 +769,9 @@
>                                 unsigned char lm_chal_resp[24],
>                                 unsigned char nt_chal_resp[24])
>  {
> -       int len_domain_name = strlen(domain_name);
> -       int len_user_name   = strlen(user_name  );
> -       int len_wksta_name  = strlen(wksta_name );
> +       int len_domain_name = str_charnum(domain_name);
> +       int len_user_name   = str_charnum(user_name  );
> +       int len_wksta_name  = str_charnum(wksta_name );
>         int nt_chal_resp_len = ((nt_chal_resp != NULL) ? 24 : 0);
>         int lm_chal_resp_len = ((lm_chal_resp != NULL) ? 24 : 0);
>         unsigned char lm_owf[24];
> 
> -----
> TAKAHASHI, Motonobu(monyo)         monyo at samba.gr.jp
> 
> Samba Team - http://samba.org/     Samba-JP - http://www.samba.gr.jp/
> JWNTUG - http://www.jwntug.or.jp/  Analog-JP - http://www.jp.analog.cx/
> MCSE+I, MCSE(W2K), SCNA, CCNA, Turbo-CI

-- 
Andrew Bartlett                                 abartlet at pcug.org.au
Samba Team member, Build Farm maintainer        abartlet at samba.org
Student Network Administrator, Hawker College   abartlet at hawkerc.net
http://samba.org     http://build.samba.org     http://hawkerc.net




More information about the samba-technical mailing list