[patch] uppercase workgroup in browse request

Christopher R. Hertel crh at ubiqx.mn.org
Thu Mar 27 02:43:52 GMT 2003


Stephan Kulow wrote:
> 
> Hi!
> 
> I noticed a difference between testsmbc "smb://MYGRP" and testsmbc
> "smb://mygrp" (it doesn't make a difference for SAMBA servers, but it
> does for XP and for winME) So please apply the included patch.

Hang on...

Do I read this correctly?  Are we forgetting to up-case the workgroup name?
(...it always helps to provide a little clue along with the patch.)  :)

Samba decodes NetBIOS names and then performs a case-insensitive comparison
on the original name.  Windows (the versions I've tested) simply compares
the wire-format strings.  That's faster, but it's also case sensitive.  I
don't currently have any ME or XP systems to test.

Then again, Windows also allows applications to register names with lower
case characters (consider INet~Services<1C>), which is icky.

Chris -)-----

> 
> Greetings, Stephan
> 
> Index: libsmb/clirap.c
> ===================================================================
> RCS file: /cvsroot/samba/source/libsmb/clirap.c,v
> retrieving revision 1.30
> diff -u -3 -p -u -r1.30 clirap.c
> --- libsmb/clirap.c     15 Mar 2003 06:45:19 -0000      1.30
> +++ libsmb/clirap.c     25 Mar 2003 15:25:20 -0000
> @@ -233,8 +233,10 @@ BOOL cli_NetServerEnum(struct cli_state
>         SIVAL(p,0,stype);
>         p += 4;
> 
> -       p += push_pstring_base(p, workgroup, param);
> -
> +       pstrcpy_base(p, workgroup, param);
> +       strupper(p);
> +       p += strlen(p);
> +
>         if (cli_api(cli,
>                      param, PTR_DIFF(p,param), 8,        /* params, length, max */
>                      NULL, 0, CLI_BUFFER_SIZE,               /* data, length, max */

-- 
Samba Team -- http://www.samba.org/     -)-----   Christopher R. Hertel
jCIFS Team -- http://jcifs.samba.org/   -)-----   ubiqx development, uninq.
ubiqx Team -- http://www.ubiqx.org/     -)-----   crh at ubiqx.mn.org
OnLineBook -- http://ubiqx.org/cifs/    -)-----   crh at ubiqx.org


More information about the samba-technical mailing list