Bug 5189 - smbc_listxattr_ctx always returns 4 rather than 373 or so
Summary: smbc_listxattr_ctx always returns 4 rather than 373 or so
Status: RESOLVED FIXED
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: libsmbclient (show other bugs)
Version: 3.0.28
Hardware: x86 Linux
: P3 normal
Target Milestone: none
Assignee: Derrell Lipman
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-11 16:56 UTC by Jack Schmidt
Modified: 2008-01-15 20:34 UTC (History)
0 users

See Also:


Attachments
Patch to fix bug, use sizeof(supported_old), etc. (1.25 KB, patch)
2008-01-11 16:58 UTC, Jack Schmidt
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jack Schmidt 2008-01-11 16:56:25 UTC
In samba-3.0.28/source/libsmb/libsmbclient.c the function smbc_listxattr_ctx makes use of sizeof(supported) as a substitute for something like strlen, because supported points to one of two statically allocated buffers containing embedded NULLs.  However, supported is declared as a pointer, so sizeof(supported) is always 4 or 8, etc. not the size of the static buffer which is more like 373.

This causes the list of extended attributes returned to be "syst" rather than the more extensive list intended.
Comment 1 Jack Schmidt 2008-01-11 16:58:03 UTC
Created attachment 3092 [details]
Patch to fix bug, use sizeof(supported_old), etc.

This introduces a new variable to hold the size of the static buffer, and it is set when supported is set.
Comment 2 Derrell Lipman 2008-01-15 20:34:41 UTC
Fixed in v3-2-test.  Thanks!