From: Jeremy Allison Date: Thu, 13 Jun 2019 23:06:10 +0000 (-0700) Subject: s3: smbd: Make data offset use clearer in smb_set_posix_acl() X-Git-Tag: ldb-2.0.5~248 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=42712ccb8767f8c653a75201ff034cd95c949c54;p=thirdparty%2Fsamba.git s3: smbd: Make data offset use clearer in smb_set_posix_acl() Signed-off-by: Jeremy Allison Reviewed-by: Volker Lendecke --- diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index cd1a49820b3..b860bff50d9 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -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; }