From 3dda9177708df4d3f2451d23a186b03a856aba87 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 13 Dec 2012 14:26:40 +0100 Subject: s3-smbd: Check return code of SMB_VFS_{L}STAT. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Found by Coverity. Signed-off-by: Andreas Schneider Reviewed-by: Günther Deschner --- source3/smbd/reply.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'source3') diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index 8db9c623f7..b511025d80 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -6485,6 +6485,7 @@ NTSTATUS rename_internals(TALLOC_CTX *ctx, long offset = 0; int create_options = 0; bool posix_pathnames = lp_posix_pathnames(); + int rc; /* * Split the old name into directory and last component @@ -6577,9 +6578,13 @@ NTSTATUS rename_internals(TALLOC_CTX *ctx, ZERO_STRUCT(smb_fname_src->st); if (posix_pathnames) { - SMB_VFS_LSTAT(conn, smb_fname_src); + rc = SMB_VFS_LSTAT(conn, smb_fname_src); } else { - SMB_VFS_STAT(conn, smb_fname_src); + rc = SMB_VFS_STAT(conn, smb_fname_src); + } + if (rc == -1) { + status = map_nt_error_from_unix_common(errno); + goto out; } if (S_ISDIR(smb_fname_src->st.st_ex_mode)) { -- cgit