From: Ralph Boehme Date: Sun, 29 Oct 2023 13:59:22 +0000 (+0100) Subject: libsmb: use K format for parsing unsigned long long X-Git-Tag: talloc-2.4.2~963 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3dc1911f7c434de9631ddd28beeac04aa7af9f87;p=thirdparty%2Fsamba.git libsmb: use K format for parsing unsigned long long Signed-off-by: Ralph Boehme Reviewed-by: David Mulder --- diff --git a/source3/libsmb/pylibsmb.c b/source3/libsmb/pylibsmb.c index 00f7e010cf7..5330cffbf50 100644 --- a/source3/libsmb/pylibsmb.c +++ b/source3/libsmb/pylibsmb.c @@ -1886,17 +1886,15 @@ static NTSTATUS list_posix_helper(struct file_info *finfo, { PyObject *result = (PyObject *)state; PyObject *file = NULL; - PyObject *size = NULL; int ret; - size = PyLong_FromUnsignedLongLong(finfo->size); /* * Build a dictionary representing the file info. */ - file = Py_BuildValue("{s:s,s:i,s:O,s:l,s:i,s:i,s:i,s:s,s:s}", + file = Py_BuildValue("{s:s,s:i,s:K,s:l,s:i,s:i,s:i,s:s,s:s}", "name", finfo->name, "attrib", (int)finfo->attr, - "size", size, + "size", finfo->size, "mtime", convert_timespec_to_time_t(finfo->mtime_ts), "perms", finfo->st_ex_mode, @@ -1906,9 +1904,6 @@ static NTSTATUS list_posix_helper(struct file_info *finfo, dom_sid_string(finfo, &finfo->owner_sid), "group_sid", dom_sid_string(finfo, &finfo->group_sid)); - - Py_CLEAR(size); - if (file == NULL) { return NT_STATUS_NO_MEMORY; }