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 04:01:01 UTC 2024


On Sat, Mar 2, 2024 at 7:21 PM Richard Sharpe <realrichardsharpe at gmail.com>
wrote:

> 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.
>

OK, upon further testing this comment is wrong. Windows also returns
nothing.


> 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
> (何以解憂?唯有杜康。--曹操)(传说杜康是酒的发明者)
>


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


More information about the samba-technical mailing list