SMB1 doesn't currently do this, but subsequent changes will add handle based
calls to SMB1 so dptr_close() has to be able to cleanly remove any back pointers.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
void dptr_close(struct smbd_server_connection *sconn, int *key)
{
struct dptr_struct *dptr;
+ files_struct *fsp = NULL;
+ struct smb_Dir *dir_hnd = NULL;
SMB_ASSERT(!sconn->using_smb2);
return;
}
+ dir_hnd = dptr->dir_hnd;
+
+ if (dir_hnd != NULL && dir_hnd->fsp != NULL) {
+ SMB_ASSERT(dir_hnd->fsp->dptr->dir_hnd == dir_hnd);
+ fsp = dir_hnd->fsp;
+ }
+
dptr_close_internal(dptr);
+ if (fsp != NULL) {
+ fsp->dptr = NULL;
+ }
+
*key = INVALID_DPTR_KEY;
}