]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: Naming consistency. Change all uses of struct smb_Dir * variables to be...
authorJeremy Allison <jra@samba.org>
Wed, 17 Jul 2019 16:47:31 +0000 (09:47 -0700)
committerAndreas Schneider <asn@cryptomilk.org>
Wed, 24 Jul 2019 07:40:23 +0000 (07:40 +0000)
Fixes OpenDir_fsp(). No logic changes.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/smbd/dir.c

index 84f37d0e121b71c7c349741e30f68eca28e29890..dbb55e27ae0c15b2b40373766443d7f1225d386d 100644 (file)
@@ -1714,9 +1714,9 @@ static struct smb_Dir *OpenDir_fsp(TALLOC_CTX *mem_ctx, connection_struct *conn,
                        const char *mask,
                        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;
        }
 
@@ -1730,7 +1730,7 @@ static struct smb_Dir *OpenDir_fsp(TALLOC_CTX *mem_ctx, connection_struct *conn,
                goto fail;
        }
 
-       dirp->conn = conn;
+       dir_hnd->conn = conn;
 
        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
                 * 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);
-       if (!dirp->dir_smb_fname) {
+       dir_hnd->dir_smb_fname = cp_smb_filename(dir_hnd, fsp->fsp_name);
+       if (!dir_hnd->dir_smb_fname) {
                errno = ENOMEM;
                goto fail;
        }
 
-       dirp->dir = SMB_VFS_FDOPENDIR(fsp, mask, attr);
-       if (dirp->dir != NULL) {
-               dirp->fsp = fsp;
+       dir_hnd->dir = SMB_VFS_FDOPENDIR(fsp, mask, attr);
+       if (dir_hnd->dir != NULL) {
+               dir_hnd->fsp = fsp;
        } else {
                DEBUG(10,("OpenDir_fsp: SMB_VFS_FDOPENDIR on %s returned "
                        "NULL (%s)\n",
-                       dirp->dir_smb_fname->base_name,
+                       dir_hnd->dir_smb_fname->base_name,
                        strerror(errno)));
                if (errno != ENOSYS) {
                        goto fail;
                }
        }
 
-       if (dirp->dir == NULL) {
+       if (dir_hnd->dir == NULL) {
                /* FDOPENDIR is not supported. Use OPENDIR instead. */
-               TALLOC_FREE(dirp);
-               dirp = open_dir_safely(mem_ctx,
+               TALLOC_FREE(dir_hnd);
+               dir_hnd = open_dir_safely(mem_ctx,
                                        conn,
                                        fsp->fsp_name,
                                        mask,
                                        attr);
-               if (dirp == NULL) {
+               if (dir_hnd == NULL) {
                        errno = ENOMEM;
                        goto fail;
                }
        }
 
-       talloc_set_destructor(dirp, smb_Dir_destructor);
+       talloc_set_destructor(dir_hnd, smb_Dir_destructor);
 
-       return dirp;
+       return dir_hnd;
 
   fail:
-       TALLOC_FREE(dirp);
+       TALLOC_FREE(dir_hnd);
        return NULL;
 }