diff options
author | Andreas Schneider <asn@samba.org> | 2012-12-13 14:26:40 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2012-12-21 13:55:59 +0100 |
commit | 3dda9177708df4d3f2451d23a186b03a856aba87 (patch) | |
tree | a3a48519e01b4cc797f38807619996623e1065a1 | |
parent | 8631a9090bd22f5ce3036dd596a213dd9d8a67c4 (diff) | |
download | samba-3dda9177708df4d3f2451d23a186b03a856aba87.tar.gz samba-3dda9177708df4d3f2451d23a186b03a856aba87.tar.bz2 samba-3dda9177708df4d3f2451d23a186b03a856aba87.zip |
s3-smbd: Check return code of SMB_VFS_{L}STAT.
Found by Coverity.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
-rw-r--r-- | source3/smbd/reply.c | 9 |
1 files changed, 7 insertions, 2 deletions
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)) { |