2.2.0-alpha1 "unexpected network error"
Jeremy Allison
jeremy at valinux.com
Mon Dec 11 20:21:52 GMT 2000
Robert Dahlem wrote:
>
> Hi,
>
> On Wed, 06 Dec 2000 10:11:55 +0100, Robert Dahlem wrote:
>
> >At least I got 2.2.0-alpha1 to compile on my Reliant Unix 5.43 (32
> >bit system, formerly known as SINIX).
>
> > [...]
>
> >But whenever I try to use anything (clicking on the share in Explorer
> >or "DIR X:") the beast tells me something like "Unexpected Network
> >error. Retry?" (roughly translated from german). Debug logs up to
> >level 5 show nothing unusual.
>
> BTW: I#ve been hit by the same problem on my Linux box.
>
> >Anything I can do to hunt this down?
>
> Well, nobody seems to be really interested, so I tried my luck myself.
> :-)
>
> I found out that the problem occurs only when there is a file not
> matching the 8.3 conventions. I modified tcpdump a bit and found that
> the problem is in the answer to a trans2 findfirst/findnext request,
> when the info level is SMB_FIND_FILE_BOTH_DIRECTORY_INFO. This one
> returns filename, attributes, dates and a ShortName together with a
> ShortNameLength.
>
> ShortNameLength is never higher than 12 (8+the_dot+3 ?) in 2.0.7 but
> gets the real file name length in 2.2.0-alpha1.
>
> Former code (in smbd/trans2.c:get_lanman2_dir_entry()) was:
>
> if (!was_8_3) {
> pstrcpy(p+2,fname);
> if (!name_map_mangle(p+2,True,True,SNUM(conn)))
> (p+2)[12] = 0;
> } else
> *(p+2) = 0;
> strupper(p+2);
> SSVAL(p,0,strlen(p+2));
> p += 2 + 24;
>
> and now is:
>
> if (!was_8_3) {
> fstrcpy(p+2,fname);
> name_map_mangle(p+2,True,True,SNUM(conn));
> strupper(p+2);
> SSVAL(p, 0, strlen(p+2));
> } else {
> SSVAL(p,0,0);
> *(p+2) = 0;
> }
> p += 2 + 24;
>
> As soon as I re-insert "(p+2)[12] = 0;" after name_map_mangle(), the
> problem disappears.
Actually that definately looks like the correct fix - not
sure how the code got lost. Oh well. I'll re-insert it for
2.2.0 and HEAD.
Thanks,
Jeremy.
--
--------------------------------------------------------
Buying an operating system without source is like buying
a self-assembly Space Shuttle with no instructions.
--------------------------------------------------------
More information about the samba-technical
mailing list