summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/smbd/open.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index e501d9ded8..23d95eadfd 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -133,7 +133,11 @@ static BOOL open_file(files_struct *fsp,connection_struct *conn,
return False;
}
- conn->vfs_ops.fstat(fsp->fd, &sbuf);
+ if (conn->vfs_ops.fstat(fsp->fd, &sbuf) == -1) {
+ DEBUG(0,("Error doing fstat on open file %s (%s)\n", fname,strerror(errno) ));
+ fd_close(conn, fsp);
+ return False;
+ }
/*
* POSIX allows read-only opens of directories. We don't