[Samba] Bug in NetSessionEnum implementation ?

Peter Rindfuss rindfuss at wzb.eu
Mon Jan 22 13:52:19 GMT 2007


Hi Everybody,

It seems that there is a bug in the implementation of the MS Windows API
function NetSessionEnum. I am using Windows XP against a Samba 3.023d
domain controller.

When NetSessionEnum is successful it is supposed to return either
NERR_Success (0) when it is finished or ERROR_MORE_DATA when there is
more data outstanding.

In my program which tries to retrieve all currently logged-on users from
the domain controller, NetSessionEnum always return NERR_Success, even
if there is more data to come. NetSessionEnum returns data in chunks of
32 entries. So it pretends to be finished after the first 32 entries
retrieved. I've developped a workaround for this, but I still think it
is wrong.

I'm not sure whether the bug is in Windows or in Samba, as I have no
Windows based domain controller to test it. But I could imagine that the
Samba server gives an incorrect response.

BTW, the problem does not occur in my own program only, but can be
reproduced in the computer management console of Windows XP like this:
Open the computer management console, select Action->Connect to another
computer, connect to the domain controller, click System Tools->Shared
Folders->Sessions, and you will never see more than 32 entries, even if
many more people are connected.


Best, Peter Rindfuss





More information about the samba mailing list