The Samba-Bugzilla – Bug 7480
Error in cli_Net* - wrong string params fetching from packets
Last modified: 2010-05-30 09:01:06 UTC
When using cli_NetSessionEnum to get sessions from win server 2003R2, wrong data is returned, even though wireshark shows everything's fine.
In libsmb/clirap2.c function rap_getstringp should rather return always 4 (dword size) instead of string length. That's because (on my win server) cli_Net* functions use this as an offset in packet: "p += res", so p shouldn't be incremented with string-param length. Begining of packet (that p points to) is filled with strings offsets, and string values are further, so we're only reading string offsets, so we should move only 4 bytes, not e.g. 13=string_length.
The problem still persists in version 3.5.3.
Guenther, you've been deep in RAP encoding lately. Maybe you can take a look?
Created attachment 5748 [details]
This change makes things work on my config (at least cli_NetSessionEnum works OK)