A QUERY_INFO FILE_STREAM_INFORMATION on Samba behaves differently than Windows when the buffer is not big enough.

Richard Sharpe realrichardsharpe at gmail.com
Sun Mar 3 03:21:24 UTC 2024


Hi folks,

I am using Samba to test some stuff where we are using QUERY_INFO
FILE_STREAM_INFO and I notice that Samba behaves differently to Windows
around STATUS_BUFFER_OVERFLOW.

When Windows returns STATUS_BUFFER_OVERFLOW for a QUERY_INFO
FILE_STREAM_INFO it returns as many items as will fit in the space you say
is in your buffer.

Samba returns nothing.

I checked the code in master and it looks the same as earlier versions.

It looks like instead of returning STATUS_BUFFER_OVERFLOW, we should set an
error variable and break from the loop in marshall_stream_info.

Finally, the whole API around stream info is retarded anyway since you have
no way to know how many streams there are and now much space you need to
allow. (However, that is not Samba's fault.)

-- 
Regards,
Richard Sharpe
(何以解憂?唯有杜康。--曹操)(传说杜康是酒的发明者)


More information about the samba-technical mailing list