From 56c48154028207a831242fe6f4ca28fb64b60faf Mon Sep 17 00:00:00 2001 From: Noel Power Date: Wed, 28 Aug 2024 16:19:27 +0100 Subject: [PATCH] libcli/smb: Fix failure of Smb3UnixTests.test_create_context_reparse On tumbleweed at least the definition in py_reparse_put of 'reserved' as 'unsigned' causes the tag value to be overwritten. Note: ParseTuple is given a format of 'Kk' where K = unsigned long long (for tag) k = unsigned long (for reserved) The problem is 'reserved' is defined as 'unsigned' which on a 64 bit linux system has size 4. The size however of the 'unsigned long' type on the same 64 bit system is 8. This causes 'tag' to be overwritten by the value of 'reserved' because it's destination size is smaller than expected. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15702 Signed-off-by: Noel Power Reviewed-by: Volker Lendecke Autobuild-User(master): Volker Lendecke Autobuild-Date(master): Wed Aug 28 18:38:01 UTC 2024 on atb-devel-224 --- libcli/smb/py_reparse_symlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcli/smb/py_reparse_symlink.c b/libcli/smb/py_reparse_symlink.c index d28a8fd8b93..5e2e961ef01 100644 --- a/libcli/smb/py_reparse_symlink.c +++ b/libcli/smb/py_reparse_symlink.c @@ -30,7 +30,7 @@ static PyObject *py_reparse_put(PyObject *module, PyObject *args) char *reparse = NULL; Py_ssize_t reparse_len; unsigned long long tag = 0; - unsigned reserved = 0; + unsigned long reserved = 0; uint8_t *buf = NULL; ssize_t buflen; PyObject *result = NULL;