1
0
mirror of https://github.com/samba-team/samba.git synced 2025-09-16 01:44:21 +03:00

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

Fixes OpenDir_fsp(). 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:47:31 -07:00
committed by Andreas Schneider
parent 8ad519c408
commit cc4ac86b95

View File

@@ -1714,9 +1714,9 @@ static struct smb_Dir *OpenDir_fsp(TALLOC_CTX *mem_ctx, connection_struct *conn,
const char *mask, const char *mask,
uint32_t attr) uint32_t attr)
{ {
struct smb_Dir *dirp = talloc_zero(mem_ctx, struct smb_Dir); struct smb_Dir *dir_hnd = talloc_zero(mem_ctx, struct smb_Dir);
if (!dirp) { if (!dir_hnd) {
goto fail; goto fail;
} }
@@ -1730,7 +1730,7 @@ static struct smb_Dir *OpenDir_fsp(TALLOC_CTX *mem_ctx, connection_struct *conn,
goto fail; goto fail;
} }
dirp->conn = conn; dir_hnd->conn = conn;
if (!conn->sconn->using_smb2) { if (!conn->sconn->using_smb2) {
/* /*
@@ -1739,48 +1739,49 @@ static struct smb_Dir *OpenDir_fsp(TALLOC_CTX *mem_ctx, connection_struct *conn,
* position (unless it's told to restart or close-and-reopen the * position (unless it's told to restart or close-and-reopen the
* listing). * listing).
*/ */
dirp->name_cache_size = lp_directory_name_cache_size(SNUM(conn)); dir_hnd->name_cache_size =
lp_directory_name_cache_size(SNUM(conn));
} }
dirp->dir_smb_fname = cp_smb_filename(dirp, fsp->fsp_name); dir_hnd->dir_smb_fname = cp_smb_filename(dir_hnd, fsp->fsp_name);
if (!dirp->dir_smb_fname) { if (!dir_hnd->dir_smb_fname) {
errno = ENOMEM; errno = ENOMEM;
goto fail; goto fail;
} }
dirp->dir = SMB_VFS_FDOPENDIR(fsp, mask, attr); dir_hnd->dir = SMB_VFS_FDOPENDIR(fsp, mask, attr);
if (dirp->dir != NULL) { if (dir_hnd->dir != NULL) {
dirp->fsp = fsp; dir_hnd->fsp = fsp;
} else { } else {
DEBUG(10,("OpenDir_fsp: SMB_VFS_FDOPENDIR on %s returned " DEBUG(10,("OpenDir_fsp: SMB_VFS_FDOPENDIR on %s returned "
"NULL (%s)\n", "NULL (%s)\n",
dirp->dir_smb_fname->base_name, dir_hnd->dir_smb_fname->base_name,
strerror(errno))); strerror(errno)));
if (errno != ENOSYS) { if (errno != ENOSYS) {
goto fail; goto fail;
} }
} }
if (dirp->dir == NULL) { if (dir_hnd->dir == NULL) {
/* FDOPENDIR is not supported. Use OPENDIR instead. */ /* FDOPENDIR is not supported. Use OPENDIR instead. */
TALLOC_FREE(dirp); TALLOC_FREE(dir_hnd);
dirp = open_dir_safely(mem_ctx, dir_hnd = open_dir_safely(mem_ctx,
conn, conn,
fsp->fsp_name, fsp->fsp_name,
mask, mask,
attr); attr);
if (dirp == NULL) { if (dir_hnd == NULL) {
errno = ENOMEM; errno = ENOMEM;
goto fail; goto fail;
} }
} }
talloc_set_destructor(dirp, smb_Dir_destructor); talloc_set_destructor(dir_hnd, smb_Dir_destructor);
return dirp; return dir_hnd;
fail: fail:
TALLOC_FREE(dirp); TALLOC_FREE(dir_hnd);
return NULL; return NULL;
} }