Planning 3.0alpha21 for Friday (10/25)

Andrew Bartlett abartlet at samba.org
Sat Oct 26 05:20:00 GMT 2002


Urban Widmark wrote:
> 
> On Wed, 23 Oct 2002, Gerald (Jerry) Carter wrote:
> 
> > Just giving everyone a heads up.  I will also roll RPMS
> > for the various RedHat versions on this release.
> 
> Any chance of someone reviewing and possibly adding these changes before
> then? I first posted this on the 19th.
> 
> 3 changes smbmount wants in samba:
> 
> 1) Allow an application to control if CAP_LARGE_FILES is set in the
>    client capabilities.
> 
> 2) Make strchr_m and strrchr_m efficient for the common case of searching for
>    an ascii character, using the same reasoning as in strlower_m.
>    The conversions done in strchr_m are kind of expensive ...
> 
> 3) strchr_w(ws, UCS2_CHAR('\0')) doesn't find the end of the string,
>    and that makes strchr_m(string, '\0') fail. (2) fixes that, but I'm
>    guessing strchar_w is also supposed to work like strchr does.
> 
> /Urban
> 
> diff -urN -X exclude samba-3_0.old/source/libsmb/cliconnect.c samba-3_0/source/libsmb/cliconnect.c
> --- samba-3_0.old/source/libsmb/cliconnect.c    Thu Oct 17 19:10:24 2002
> +++ samba-3_0/source/libsmb/cliconnect.c        Sat Oct 19 12:13:30 2002
> @@ -124,6 +124,9 @@
>         if (cli->capabilities & CAP_UNICODE)
>                 capabilities |= CAP_UNICODE;
> 
> +       if (cli->capabilities & CAP_LARGE_FILES)
> +               capabilities |= CAP_LARGE_FILES;
> +
>         return capabilities;
>  }
> 

I assume this just adds a capability bit?  That shouldn't be a problem.

> diff -urN -X exclude samba-3_0.old/source/lib/util_str.c samba-3_0/source/lib/util_str.c
> --- samba-3_0.old/source/lib/util_str.c Wed Oct  2 21:12:14 2002
> +++ samba-3_0/source/lib/util_str.c     Sat Oct 19 16:46:34 2002
> @@ -990,6 +990,9 @@
>         pstring s2;
>         smb_ucs2_t *p;
> 
> +       if (!(c & 0x80))
> +               return strchr(s, c);    /* ascii */
> +
>         push_ucs2(NULL, ws, s, sizeof(ws), STR_TERMINATE);
>         p = strchr_w(ws, UCS2_CHAR(c));
>         if (!p)
> @@ -1005,6 +1008,9 @@
>         pstring s2;
>         smb_ucs2_t *p;
> 
> +       if (!(c & 0x80))
> +               return strchr(s, c);    /* ascii */
> +
>         push_ucs2(NULL, ws, s, sizeof(ws), STR_TERMINATE);
>         p = strrchr_w(ws, UCS2_CHAR(c));
>         if (!p)

This looks wrong...

You need to check that every char in the string doesn't have 0x80, not
just the first char.  My understanding is that once the 0x80 escape is
set, we might have 'legitimate' characters following that have their
meaning altered.  
Does that sound right?

> diff -urN -X exclude samba-3_0.old/source/lib/util_unistr.c samba-3_0/source/lib/util_unistr.c
> --- samba-3_0.old/source/lib/util_unistr.c      Wed Sep 25 17:18:52 2002
> +++ samba-3_0/sourcelib/util_unistr.c/  Sat Oct 19 20:45:34 2002
> @@ -335,6 +335,7 @@
>                 if (c == *s) return (smb_ucs2_t *)s;
>                 s++;
>         }
> +       if (c == *s) return (smb_ucs2_t *)s;
>         return NULL;
>  }
> 

-- 
Andrew Bartlett                                 abartlet at pcug.org.au
Manager, Authentication Subsystems, Samba Team  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