summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2013-04-10 16:21:39 -0700
committerKarolin Seeger <kseeger@samba.org>2013-05-06 21:15:49 +0200
commitecdcb622bfaf636f87d13064dcf6c6fade880260 (patch)
tree2782c7b1273e4f443fb84fd1ee8d80ff9da68d20
parent2a09b5d2cd04840a733cf06c95bea6f0f7377a45 (diff)
downloadsamba-ecdcb622bfaf636f87d13064dcf6c6fade880260.tar.gz
Maintain a back-pointer to the fsp in struct smb_Dir when opening with FDOPENDIR.
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> (cherry picked from commit e89ec641fc98ffd7f7193deb3728b0a284a093eb)
-rw-r--r--source3/smbd/dir.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c
index a06fc5f3128..0dd75b18014 100644
--- a/source3/smbd/dir.c
+++ b/source3/smbd/dir.c
@@ -50,6 +50,8 @@ struct smb_Dir {
struct name_cache_entry *name_cache;
unsigned int name_cache_index;
unsigned int file_number;
+ files_struct *fsp; /* Back pointer to containing fsp, only
+ set from OpenDir_fsp(). */
};
struct dptr_struct {
@@ -1537,7 +1539,9 @@ static struct smb_Dir *OpenDir_fsp(TALLOC_CTX *mem_ctx, connection_struct *conn,
if (fsp->is_directory && fsp->fh->fd != -1) {
dirp->dir = SMB_VFS_FDOPENDIR(fsp, mask, attr);
- if (dirp->dir == NULL) {
+ if (dirp->dir != NULL) {
+ dirp->fsp = fsp;
+ } else {
DEBUG(10,("OpenDir_fsp: SMB_VFS_FDOPENDIR on %s returned "
"NULL (%s)\n",
dirp->dir_path,