summaryrefslogtreecommitdiff
path: root/source4/ntvfs/posix/pvfs_resolve.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-10-29 04:43:28 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:04:58 -0500
commit78b85c96c946069cd16ad7399b0dd8cfb7e2590b (patch)
treeecda6d9b586bb20f3db77719668e258565e63a9c /source4/ntvfs/posix/pvfs_resolve.c
parent4676de010f1b1680ce70e2e4ae1eb4af4de26695 (diff)
downloadsamba-78b85c96c946069cd16ad7399b0dd8cfb7e2590b.tar.gz
samba-78b85c96c946069cd16ad7399b0dd8cfb7e2590b.tar.bz2
samba-78b85c96c946069cd16ad7399b0dd8cfb7e2590b.zip
r3351: handle far more operations on open directory handles. pvfs was failing
with a wxp client because of qfileinfo operations on directories failing with NT_STATUS_INVALID_HANDLE after the fstat() failed (as pvfs sets f->fd to -1 for directories) (This used to be commit 1993128cb1dbf49db6e3e0387996ecf2a14b8d76)
Diffstat (limited to 'source4/ntvfs/posix/pvfs_resolve.c')
-rw-r--r--source4/ntvfs/posix/pvfs_resolve.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source4/ntvfs/posix/pvfs_resolve.c b/source4/ntvfs/posix/pvfs_resolve.c
index 75fbeb39a5..be1662437e 100644
--- a/source4/ntvfs/posix/pvfs_resolve.c
+++ b/source4/ntvfs/posix/pvfs_resolve.c
@@ -510,8 +510,14 @@ NTSTATUS pvfs_resolve_name_fd(struct pvfs_state *pvfs, int fd,
inode = name->st.st_ino;
}
- if (fstat(fd, &name->st) == -1) {
- return NT_STATUS_INVALID_HANDLE;
+ if (name->dos.attrib & FILE_ATTRIBUTE_DIRECTORY) {
+ if (stat(name->full_name, &name->st) == -1) {
+ return NT_STATUS_INVALID_HANDLE;
+ }
+ } else {
+ if (fstat(fd, &name->st) == -1) {
+ return NT_STATUS_INVALID_HANDLE;
+ }
}
if (name->exists &&