1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00

s3: smbd: Naming consistency. Change all uses of struct smb_Dir * variables to be dir_hnd.

Fixes smb_Dir_destructor(). No logic changes.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
This commit is contained in:
Jeremy Allison 2019-07-17 09:40:04 -07:00 committed by Andreas Schneider
parent eb5fa8ac84
commit 79eae9e38a

View File

@ -90,7 +90,7 @@ static struct smb_Dir *open_dir_safely(TALLOC_CTX *ctx,
const struct smb_filename *smb_dname,
const char *wcard,
uint32_t attr);
static int smb_Dir_destructor(struct smb_Dir *dirp);
static int smb_Dir_destructor(struct smb_Dir *dir_hnd);
#define INVALID_DPTR_KEY (-3)
@ -1512,22 +1512,23 @@ bool is_visible_file(connection_struct *conn, const char *dir_path,
return ret;
}
static int smb_Dir_destructor(struct smb_Dir *dirp)
static int smb_Dir_destructor(struct smb_Dir *dir_hnd)
{
if (dirp->dir != NULL) {
SMB_VFS_CLOSEDIR(dirp->conn,dirp->dir);
if (dirp->fsp != NULL) {
if (dir_hnd->dir != NULL) {
SMB_VFS_CLOSEDIR(dir_hnd->conn, dir_hnd->dir);
if (dir_hnd->fsp != NULL) {
/*
* The SMB_VFS_CLOSEDIR above
* closes the underlying fd inside
* dirp->fsp.
*/
dirp->fsp->fh->fd = -1;
if (dirp->fsp->dptr != NULL) {
SMB_ASSERT(dirp->fsp->dptr->dir_hnd == dirp);
dirp->fsp->dptr->dir_hnd = NULL;
dir_hnd->fsp->fh->fd = -1;
if (dir_hnd->fsp->dptr != NULL) {
SMB_ASSERT(dir_hnd->fsp->dptr->dir_hnd ==
dir_hnd);
dir_hnd->fsp->dptr->dir_hnd = NULL;
}
dirp->fsp = NULL;
dir_hnd->fsp = NULL;
}
}
return 0;