The Samba-Bugzilla – Attachment 18078 Details for
Bug 14808
smbc_getxattr() return value is incorrect
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch for 4.18
v4-18-fix-smbc_getxattr.patch (text/plain), 3.73 KB, created by
Andreas Schneider
on 2023-09-05 15:53:25 UTC
(
hide
)
Description:
patch for 4.18
Filename:
MIME Type:
Creator:
Andreas Schneider
Created:
2023-09-05 15:53:25 UTC
Size:
3.73 KB
patch
obsolete
>From 5b924051b44fe39a9154f98f345d2987a4ea6f09 Mon Sep 17 00:00:00 2001 >From: Remi Collet <rcollet@redhat.com> >Date: Tue, 4 Apr 2023 10:22:09 +0200 >Subject: [PATCH 1/2] libsmb: fix regression on smbc_getxattr and fix doc > >Bug: https://bugzilla.samba.org/show_bug.cgi?id=14808 >Signed-off-by: Remi Collet <rcollet@redhat.com> >Reviewed-by: Jeremy Allison <jra@samba.org> >Reviewed-by: Volker Lendecke <vl@samba.org> >(cherry picked from commit 4fc166628fda160d1cd38c140a9664defc5844ab) >--- > source3/include/libsmbclient.h | 2 +- > source3/libsmb/libsmb_xattr.c | 4 ++-- > 2 files changed, 3 insertions(+), 3 deletions(-) > >diff --git a/source3/include/libsmbclient.h b/source3/include/libsmbclient.h >index ef8b327e374..056444d008c 100644 >--- a/source3/include/libsmbclient.h >+++ b/source3/include/libsmbclient.h >@@ -2419,7 +2419,7 @@ int smbc_getxattr(const char *url, > * required to hold the attribute value will be returned, > * but nothing will be placed into the value buffer. > * >- * @return 0 on success, < 0 on error with errno set: >+ * @return size on success, < 0 on error with errno set: > * - EINVAL The client library is not properly initialized > * or one of the parameters is not of a correct > * form >diff --git a/source3/libsmb/libsmb_xattr.c b/source3/libsmb/libsmb_xattr.c >index 1e8d2718a22..1f820521193 100644 >--- a/source3/libsmb/libsmb_xattr.c >+++ b/source3/libsmb/libsmb_xattr.c >@@ -2182,9 +2182,9 @@ SMBC_getxattr_ctx(SMBCCTX *context, > TALLOC_FREE(frame); > /* > * static function cacl_get returns a value greater than zero >- * on success. Map this to zero meaning success. >+ * which is needed buffer size needed when size_t is 0. > */ >- return ret < 0 ? -1 : 0; >+ return ret; > } > > /* Unsupported attribute name */ >-- >2.42.0 > > >From 63e525b96be6a4331a9311ebbcf8b984455365f8 Mon Sep 17 00:00:00 2001 >From: Remi Collet <rcollet@redhat.com> >Date: Tue, 4 Apr 2023 12:16:09 +0200 >Subject: [PATCH 2/2] libsmb: Fix test for smbc_getxattr > >Bug: https://bugzilla.samba.org/show_bug.cgi?id=14808 >Signed-off-by: Remi Collet <rcollet@redhat.com> >Reviewed-by: Jeremy Allison <jra@samba.org> >Reviewed-by: Volker Lendecke <vl@samba.org> > >Autobuild-User(master): Volker Lendecke <vl@samba.org> >Autobuild-Date(master): Sun Apr 9 10:44:38 UTC 2023 on atb-devel-224 > >(cherry picked from commit 0cd66fe6bd4ac2aa0b302ddf3eb5068fc9c522ec) >--- > source4/torture/libsmbclient/libsmbclient.c | 25 ++++++++++++++++----- > 1 file changed, 19 insertions(+), 6 deletions(-) > >diff --git a/source4/torture/libsmbclient/libsmbclient.c b/source4/torture/libsmbclient/libsmbclient.c >index 55ea26f5bc8..72af8fc01c9 100644 >--- a/source4/torture/libsmbclient/libsmbclient.c >+++ b/source4/torture/libsmbclient/libsmbclient.c >@@ -1542,17 +1542,30 @@ static bool torture_libsmbclient_getxattr(struct torture_context *tctx) > ret)); > > /* >- * Ensure getting a valid attribute returns 0. >+ * Ensure getting a valid attribute computes its size. >+ */ >+ ret = smbc_getxattr(getxattr_name, "system.*", NULL, 0); >+ torture_assert_goto(tctx, >+ ret >= 0, >+ ok, >+ done, >+ talloc_asprintf(tctx, >+ "smbc_getxattr(foobar, NULL) on '%s' should " >+ "get >=0, got %d\n", >+ getxattr_name, >+ ret)); >+ >+ /* >+ * Ensure getting a valid attribute returns its size. > */ > ret = smbc_getxattr(getxattr_name, "system.*", value, sizeof(value)); >- torture_assert_int_equal_goto(tctx, >- ret, >- 0, >+ torture_assert_goto(tctx, >+ ret >= 0, > ok, > done, > talloc_asprintf(tctx, >- "smbc_getxattr(foobar) on '%s' should " >- "get -1, got %d\n", >+ "smbc_getxattr(foobar, value) on '%s' should " >+ "get >=0, got %d\n", > getxattr_name, > ret)); > >-- >2.42.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
jra
:
review+
slow
:
review+
Actions:
View
Attachments on
bug 14808
:
17610
| 18078