]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: Make data offset use clearer in smb_set_posix_acl()
authorJeremy Allison <jra@samba.org>
Thu, 13 Jun 2019 23:06:10 +0000 (16:06 -0700)
committerJeremy Allison <jra@samba.org>
Mon, 24 Jun 2019 18:49:08 +0000 (18:49 +0000)
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
source3/smbd/trans2.c

index cd1a49820b37e29231d245171a5c174cb7bb1fef..b860bff50d9b9a2c255e91f026b3b7df7f659643 100644 (file)
@@ -7283,17 +7283,22 @@ static NTSTATUS smb_set_posix_acl(connection_struct *conn,
                  num_file_acls,
                  num_def_acls);
 
+       /* Move pdata to the start of the file ACL entries. */
+       pdata += SMB_POSIX_ACL_HEADER_SIZE;
+
        if (valid_file_acls && !set_unix_posix_acl(conn, fsp,
                smb_fname, num_file_acls,
-               pdata + SMB_POSIX_ACL_HEADER_SIZE)) {
+               pdata)) {
                status = map_nt_error_from_unix(errno);
                goto out;
        }
 
+       /* Move pdata to the start of the default ACL entries. */
+       pdata += (num_file_acls*SMB_POSIX_ACL_ENTRY_SIZE);
+
        if (valid_def_acls && !set_unix_posix_default_acl(conn,
                smb_fname, num_def_acls,
-               pdata + SMB_POSIX_ACL_HEADER_SIZE +
-               (num_file_acls*SMB_POSIX_ACL_ENTRY_SIZE))) {
+               pdata)) {
                status = map_nt_error_from_unix(errno);
                goto out;
        }