vfs_acl_common: rename pdesc_next to psd_fs
authorRalph Boehme <slow@samba.org>
Tue, 23 Aug 2016 11:11:24 +0000 (13:11 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 30 Aug 2016 19:12:25 +0000 (21:12 +0200)
In most realistic cases the "next" VFS op will return the permissions
from the filesystem. This rename makes it explicit where the SD is
originating from. No change in behaviour.

This just paves the way for a later change that will simplify the whole
logic and talloc hierarchy.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=12177

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/modules/vfs_acl_common.c

index 1adc875230523393e910df641255696b0618c883..fb01bf4203444353fdfc15b748de8d2211c2e39d 100644 (file)
@@ -489,7 +489,7 @@ static NTSTATUS get_nt_acl_internal(vfs_handle_struct *handle,
        uint8_t hash_tmp[XATTR_SD_HASH_SIZE];
        uint8_t sys_acl_hash_tmp[XATTR_SD_HASH_SIZE];
        struct security_descriptor *psd_blob = NULL;
-       struct security_descriptor *pdesc_next = NULL;
+       struct security_descriptor *psd_fs = NULL;
        const struct smb_filename *smb_fname = NULL;
        bool ignore_file_system_acl = lp_parm_bool(SNUM(handle->conn),
                                                ACL_MODULE_NAME,
@@ -618,13 +618,13 @@ static NTSTATUS get_nt_acl_internal(vfs_handle_struct *handle,
                                                          fsp,
                                                          HASH_SECURITY_INFO,
                                                          mem_ctx,
-                                                         &pdesc_next);
+                                                         &psd_fs);
                } else {
                        status = SMB_VFS_NEXT_GET_NT_ACL(handle,
                                                         smb_fname,
                                                         HASH_SECURITY_INFO,
                                                         mem_ctx,
-                                                        &pdesc_next);
+                                                        &psd_fs);
                }
 
                if (!NT_STATUS_IS_OK(status)) {
@@ -636,17 +636,17 @@ static NTSTATUS get_nt_acl_internal(vfs_handle_struct *handle,
                        return status;
                }
 
-               /* Ensure we don't leak psd_next if we don't choose it.
+               /* Ensure we don't leak psd_fs if we don't choose it.
                 *
                 * We don't allocate it onto frame as it is preferred not to
                 * steal from a talloc pool.
                 */
-               talloc_steal(frame, pdesc_next);
+               talloc_steal(frame, psd_fs);
 
-               status = hash_sd_sha256(pdesc_next, hash_tmp);
+               status = hash_sd_sha256(psd_fs, hash_tmp);
                if (!NT_STATUS_IS_OK(status)) {
                        TALLOC_FREE(psd_blob);
-                       psd_blob = pdesc_next;
+                       psd_blob = psd_fs;
                        goto out;
                }
 
@@ -667,11 +667,11 @@ static NTSTATUS get_nt_acl_internal(vfs_handle_struct *handle,
                if (DEBUGLEVEL >= 10) {
                        DEBUG(10,("get_nt_acl_internal: acl for blob hash for %s is:\n",
                                  smb_fname->base_name ));
-                       NDR_PRINT_DEBUG(security_descriptor, pdesc_next);
+                       NDR_PRINT_DEBUG(security_descriptor, psd_fs);
                }
 
                TALLOC_FREE(psd_blob);
-               psd_blob = pdesc_next;
+               psd_blob = psd_fs;
        }
   out:
 
@@ -684,13 +684,13 @@ static NTSTATUS get_nt_acl_internal(vfs_handle_struct *handle,
                                                          fsp,
                                                          security_info,
                                                          mem_ctx,
-                                                         &pdesc_next);
+                                                         &psd_fs);
                } else {
                        status = SMB_VFS_NEXT_GET_NT_ACL(handle,
                                                         smb_fname,
                                                         security_info,
                                                         mem_ctx,
-                                                        &pdesc_next);
+                                                        &psd_fs);
                }
 
                if (!NT_STATUS_IS_OK(status)) {
@@ -702,19 +702,19 @@ static NTSTATUS get_nt_acl_internal(vfs_handle_struct *handle,
                        return status;
                }
 
-               /* Ensure we don't leak psd_next if we don't choose it.
+               /* Ensure we don't leak psd_fs if we don't choose it.
                 *
                 * We don't allocate it onto frame as it is preferred not to
                 * steal from a talloc pool.
                 */
-               talloc_steal(frame, pdesc_next);
-               psd_blob = pdesc_next;
+               talloc_steal(frame, psd_fs);
+               psd_blob = psd_fs;
        }
 
-       if (psd_blob != pdesc_next) {
+       if (psd_blob != psd_fs) {
                /* We're returning the blob, throw
                 * away the filesystem SD. */
-               TALLOC_FREE(pdesc_next);
+               TALLOC_FREE(psd_fs);
        } else {
                SMB_STRUCT_STAT sbuf;
                SMB_STRUCT_STAT *psbuf = &sbuf;
@@ -760,7 +760,7 @@ static NTSTATUS get_nt_acl_internal(vfs_handle_struct *handle,
                is_directory = S_ISDIR(psbuf->st_ex_mode);
 
                if (ignore_file_system_acl) {
-                       TALLOC_FREE(pdesc_next);
+                       TALLOC_FREE(psd_fs);
                        status = make_default_filesystem_acl(mem_ctx,
                                                smb_fname->base_name,
                                                psbuf,