RAP bug: Not truncating names to 12 characters.

Christopher R. Hertel crh at ubiqx.mn.org
Mon Jan 19 18:25:36 GMT 2004


Looks like what I was aiming at.  I haven't had time this weekend (have to 
paint a room at home so my daughter can have her own space).  Let me play 
with it today and I'll let you know.

...but it looks right.

Only question:  Why use <snum> instead of <i>?  The variable i is being 
used to iterate through the list of services.

Again, I have not had time to dig into the code to be sure about this.  I 
typically like to grok the code before I change it so it sometimes takes 
longer than it should.  Sorry.

Chris -)-----

On Mon, Jan 19, 2004 at 10:07:51AM +0100, Simo Sorce wrote:
> On Thu, 2004-01-15 at 07:32, Christopher R. Hertel wrote:
> 
> > So, somewhere in lanman.c (need to look a little closer) we need to be 
> > checking the name length and skipping the name if it's longer than 12 
> > bytes.
> 
> can you look at this patch chris?
> 
> --- lanman.c    2003-11-25 14:15:33.000000000 +0100
> +++ lanman.c.new        2004-01-18 19:31:55.000000000 +0100
> @@ -1490,7 +1490,7 @@
>     
>    data_len = fixed_len = string_len = 0;
>    for (i=0;i<count;i++)
> -    if (lp_browseable(i) && lp_snum_ok(i))
> +    if (lp_browseable(i) && lp_snum_ok(i) &&
> strlen(lp_serveicename(snum) < 13))
>      {
>        total++;
>        data_len += fill_share_info(conn,i,uLevel,0,&f_len,0,&s_len,0);
> @@ -1512,7 +1512,7 @@
>    f_len = fixed_len;
>    s_len = string_len;
>    for (i = 0; i < count;i++)
> -    if (lp_browseable(i) && lp_snum_ok(i))
> +    if (lp_browseable(i) && lp_snum_ok(i) &&
> strlen(lp_serveicename(snum) < 13))
>        if (fill_share_info(conn,i,uLevel,&p,&f_len,&p2,&s_len,*rdata) <
> 0)
>         break;
>     
> 
> -- 
> Simo Sorce - simo.sorce at xsec.it
> Xsec s.r.l. - http://www.xsec.it
> via Garofalo, 39 - 20133 - Milano
> mobile: +39 329 328 7702
> tel. +39 02 2953 4143 - fax: +39 02 700 442 399

-- 
"Implementing CIFS - the Common Internet FileSystem" ISBN: 013047116X
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