diff options
Diffstat (limited to 'source4/ntvfs/posix/pvfs_resolve.c')
-rw-r--r-- | source4/ntvfs/posix/pvfs_resolve.c | 10 |
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 && |