mirror of
https://github.com/samba-team/samba.git
synced 2025-03-11 16:58:40 +03:00
vfs_xattr_tdb: handle case of zero size.
With getxattr(), passing a zero buffer size is a way of obtaining actual xattr size. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12737 Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
5017dfeef2
commit
4dfa2d6a09
@ -85,6 +85,12 @@ static ssize_t xattr_tdb_getxattr(struct vfs_handle_struct *handle,
|
||||
TALLOC_FREE(frame);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (size == 0) {
|
||||
TALLOC_FREE(frame);
|
||||
return xattr_size;
|
||||
}
|
||||
|
||||
if (blob.length > size) {
|
||||
TALLOC_FREE(frame);
|
||||
errno = ERANGE;
|
||||
@ -125,6 +131,12 @@ static ssize_t xattr_tdb_fgetxattr(struct vfs_handle_struct *handle,
|
||||
TALLOC_FREE(frame);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (size == 0) {
|
||||
TALLOC_FREE(frame);
|
||||
return xattr_size;
|
||||
}
|
||||
|
||||
if (blob.length > size) {
|
||||
TALLOC_FREE(frame);
|
||||
errno = ERANGE;
|
||||
|
Loading…
x
Reference in New Issue
Block a user