Expected behaviour: "@return 0 on success, < 0 on error" (from function comment). Actual behaviour: returns positive value on success, < 0 on error. In the code you can see that getxattr() uses cacl_get(): https://github.com/samba-team/samba/blob/f753e2f7acf8f3394a5f1107344d0323acc05694/source3/libsmb/libsmb_xattr.c#L2169 And then forwards the return value from cacl_get(): https://github.com/samba-team/samba/blob/f753e2f7acf8f3394a5f1107344d0323acc05694/source3/libsmb/libsmb_xattr.c#L2179 Meanwhile, cacl_get() returns a non-zero value called "n_used": https://github.com/samba-team/samba/blob/f753e2f7acf8f3394a5f1107344d0323acc05694/source3/libsmb/libsmb_xattr.c#L1488 (@Nable80 suggested the bugreport)
This bug was referenced in samba master: 74636dfe24c15677261fc40c0a4ec62404898cf4 bdbb38d16c8eaff33484bb747efa639c4d8e7f35
Created attachment 17610 [details] git-am fix for 4.17.next, 4.16.next. Cherry-picked cleanly from master.
Comment on attachment 17610 [details] git-am fix for 4.17.next, 4.16.next. Ping David - can we get this into the next release please ?
Reassigning to Jule for inclusion in 4.16 and 4.17.
Pushed to autobuild-v4-{17,16}-test.
This bug was referenced in samba v4-16-test: 628a1c338277f3fc4250fd54809bf326ec15c0ef 113536e0d735a5235f8be29d4fd1cfc8177930b1
This bug was referenced in samba v4-17-test: a92a0043493f678338ecdefa49810e91f6bb2a1a 50330f69a073915c604070a1889e92af0f0a2006
Closing out bug report. Thanks!
This bug was referenced in samba v4-17-stable (Release samba-4.17.5): a92a0043493f678338ecdefa49810e91f6bb2a1a 50330f69a073915c604070a1889e92af0f0a2006
This bug was referenced in samba v4-16-stable (Release samba-4.16.9): 628a1c338277f3fc4250fd54809bf326ec15c0ef 113536e0d735a5235f8be29d4fd1cfc8177930b1
See https://gitlab.com/samba-team/samba/-/merge_requests/3024
The fix in 4.16.9/4.17.5 for this issue introduces a BC break This was really a documentation issue for the return value Documentation for size parameter describes the usage of the returned needed size: * @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. Which is also consistent with getxattr syscall: RETURN VALUE On success, these calls return a nonnegative value which is the size (in bytes) of the extended attribute value. On failure, -1 is re-turned and errno is set to indicate the error. In short, the documentation needs to be fixed, not the function behavior (especially in a minor release)
Didn't realize there's code that depends on getxattr() returning size. Reverting the fix and changing the documentation instead is definitely the way to go then.
Fix looks correct. RB+ by me on the MR. Just needs a second Team reviewer. Thanks for catching this.
This bug was referenced in samba master: 4fc166628fda160d1cd38c140a9664defc5844ab 0cd66fe6bd4ac2aa0b302ddf3eb5068fc9c522ec
Please also apply in 4.16, 4.17, 4.18 where the regression appears
This is fixed in 4.19 and 4.17, but NOT in 4.18!
Created attachment 18078 [details] patch for 4.18
Re-assigning to Jule to update the 4.18.next release.
Pushed to autobuild-v4-18-test.
This bug was referenced in samba v4-18-test: 0d8e5ba4f511d7da2c76b01931190fe1d9bd6a7e 5cf6870718cf4356e627e0159866faf53ee11a08
This bug was referenced in samba v4-18-stable (Release samba-4.18.7): 0d8e5ba4f511d7da2c76b01931190fe1d9bd6a7e 5cf6870718cf4356e627e0159866faf53ee11a08
Notice that 4.18.7 and 4.19 are OK but 4.17.11 is still broken