fix regression on smbc_getxattr and fix doc
Fix regression introduced in the fix for https://bugzilla.samba.org/show_bug.cgi?id=14808
Documentation states:
* @param size The size of the buffer pointed to by value. This parameter
* may also be zero, in which case the size of the buffer
* required to hold the attribute value will be returned,
* but nothing will be placed into the value buffer.
But this usage is now broken (returns 0 instead of size)
Common usage is broken:
xattr_size = smbc_getxattr(state->ctx, url, name, NULL, 0);
values = malloc(xattr_size + 1);
xattr_size = smbc_getxattr(state->ctx, url, name, values, xattr_size + 1);
There is no more way to retrieve the needed space.
The fix for 14808 change smbc_getxattr behavior to match documentation (@return) This fix revert this change, and fix documentation instead
As the regression appears in 4.16.9 and 4.17.5, please backport in these branches
Checklist
-
Commits have Signed-off-by:
with name/author being identical to the commit author -
(optional) This MR is just one part towards a larger feature. -
(optional, if backport required) Bugzilla bug filed and BUG:
tag added -
Test suite updated with functionality tests -
Test suite updated with negative tests -
Documentation updated -
CI timeout is 3h or higher (see Settings/CICD/General pipelines/ Timeout)
Reviewer's checklist:
-
There is a test suite reasonably covering new functionality or modifications -
Function naming, parameters, return values, types, etc., are consistent and according to README.Coding.md
-
This feature/change has adequate documentation added -
No obvious mistakes in the code
Edited by Remi Collet