From 03bf7072ac9e390c53290a0343e6f8eaba09f5ac Mon Sep 17 00:00:00 2001 From: Christian Ambach Date: Thu, 4 Feb 2016 21:38:20 +0100 Subject: [PATCH 1/2] s3:utils/smbget add a error message on allocation error Signed-off-by: Christian Ambach Reviewed-by: Volker Lendecke (cherry picked from commit 64121471f98cfeaf48b701b3b85614a7436d3da9) --- source3/utils/smbget.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source3/utils/smbget.c b/source3/utils/smbget.c index 1dd8d77..417ed84 100644 --- a/source3/utils/smbget.c +++ b/source3/utils/smbget.c @@ -585,6 +585,8 @@ static bool smb_download_file(const char *base, const char *name, readbuf = (char *)SMB_MALLOC(opt.blocksize); if (!readbuf) { + fprintf(stderr, "Failed to allocate %zu bytes for read " + "buffer (%s)", opt.blocksize, strerror(errno)); if (localhandle != STDOUT_FILENO) { close(localhandle); } -- 1.9.1 From a343f57a9623b4e68fc7ce16a7dee09fd73bbd50 Mon Sep 17 00:00:00 2001 From: Christian Ambach Date: Thu, 4 Feb 2016 21:39:47 +0100 Subject: [PATCH 2/2] s3:utils/smbget set default blocksize this got lost in the recent refactorings and causes problems when smbget attempts to use a zero byte read buffer Signed-off-by: Christian Ambach Reviewed-by: Volker Lendecke Autobuild-User(master): Volker Lendecke Autobuild-Date(master): Fri Feb 5 12:10:16 CET 2016 on sn-devel-144 (cherry picked from commit da2aae933e3964aafce05c74755244e0f2b4d982) --- source3/utils/smbget.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source3/utils/smbget.c b/source3/utils/smbget.c index 417ed84..91809d1 100644 --- a/source3/utils/smbget.c +++ b/source3/utils/smbget.c @@ -57,7 +57,7 @@ struct opt { bool update; int debuglevel; }; -static struct opt opt; +static struct opt opt = { .blocksize = SMB_DEFAULT_BLOCKSIZE }; static bool smb_download_file(const char *base, const char *name, bool recursive, bool resume, bool toplevel, -- 1.9.1