Bug 7480 - Error in cli_Net* - wrong string params fetching from packets
Summary: Error in cli_Net* - wrong string params fetching from packets
Status: NEW
Alias: None
Product: Samba 3.4
Classification: Unclassified
Component: File services (show other bugs)
Version: 3.4.4
Hardware: x86 Linux
: P3 major
Target Milestone: ---
Assignee: Guenther Deschner
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-29 18:40 UTC by Tomasz Kowalski
Modified: 2010-05-30 09:01 UTC (History)
0 users

See Also:


Attachments
This change makes things work on my config (at least cli_NetSessionEnum works OK) (513 bytes, patch)
2010-05-30 09:01 UTC, Tomasz Kowalski
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tomasz Kowalski 2010-05-29 18:40:13 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.
Comment 1 Tomasz Kowalski 2010-05-29 18:45:32 UTC
The problem still persists in version 3.5.3.
Comment 2 Derrell Lipman 2010-05-29 19:34:20 UTC
change component
Comment 3 Volker Lendecke 2010-05-30 03:00:11 UTC
Guenther, you've been deep in RAP encoding lately. Maybe you can take a look?

Thanks,

Volker
Comment 4 Tomasz Kowalski 2010-05-30 09:01:06 UTC
Created attachment 5748 [details]
This change makes things work on my config (at least cli_NetSessionEnum works OK)