summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2013-04-10 16:21:39 -0700
committerAndreas Schneider <asn@samba.org>2013-04-12 14:29:51 +0200
commite89ec641fc98ffd7f7193deb3728b0a284a093eb (patch)
treef692e50611bcf8a07f8662f4c23150276a80566c
parent237ec2fbac4c69f642eab481813350fb9568ebaf (diff)
downloadsamba-e89ec641fc98ffd7f7193deb3728b0a284a093eb.tar.gz
samba-e89ec641fc98ffd7f7193deb3728b0a284a093eb.tar.bz2
samba-e89ec641fc98ffd7f7193deb3728b0a284a093eb.zip
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>
-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 f1c177f2d7..e6233166a0 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 {
@@ -1540,7 +1542,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,