summaryrefslogtreecommitdiff
path: root/source3/smbd/fileio.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2009-11-16 14:55:21 -0800
committerJeremy Allison <jra@samba.org>2009-11-16 14:55:21 -0800
commita2a8dc515cca833c442cc3bb4cf90682e8ba147d (patch)
treea62ef7e79992aa7ff65f8f29fa17f8a667623989 /source3/smbd/fileio.c
parent5c54c73c0ec14e391cd58481249b1eda752d4798 (diff)
downloadsamba-a2a8dc515cca833c442cc3bb4cf90682e8ba147d.tar.gz
samba-a2a8dc515cca833c442cc3bb4cf90682e8ba147d.tar.bz2
samba-a2a8dc515cca833c442cc3bb4cf90682e8ba147d.zip
Don't overwrite a dynamic pointer with the address of a stack
variable. Jeremy.
Diffstat (limited to 'source3/smbd/fileio.c')
-rw-r--r--source3/smbd/fileio.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/source3/smbd/fileio.c b/source3/smbd/fileio.c
index c0deaebcfc..1c27fef09b 100644
--- a/source3/smbd/fileio.c
+++ b/source3/smbd/fileio.c
@@ -982,17 +982,15 @@ NTSTATUS sync_file(connection_struct *conn, files_struct *fsp, bool write_throug
Perform a stat whether a valid fd or not.
************************************************************/
-int fsp_stat(files_struct *fsp, SMB_STRUCT_STAT *pst)
+int fsp_stat(files_struct *fsp)
{
if (fsp->fh->fd == -1) {
- int ret;
-
- ret = SMB_VFS_STAT(fsp->conn, fsp->fsp_name);
- if (ret != -1) {
- *pst = fsp->fsp_name->st;
+ if (fsp->posix_open) {
+ return SMB_VFS_LSTAT(fsp->conn, fsp->fsp_name);
+ } else {
+ return SMB_VFS_STAT(fsp->conn, fsp->fsp_name);
}
- return ret;
} else {
- return SMB_VFS_FSTAT(fsp, pst);
+ return SMB_VFS_FSTAT(fsp, &fsp->fsp_name->st);
}
}