From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 0B2B2385AC33; Tue, 25 Jan 2022 19:03:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0B2B2385AC33 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Corinna Vinschen To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: ACLs: don't set indicator for default ACEs prematurely X-Act-Checkin: newlib-cygwin X-Git-Author: Corinna Vinschen X-Git-Refname: refs/heads/master X-Git-Oldrev: 5dc4e2089afdc0f21792e32bb4ba408e001106d5 X-Git-Newrev: f467a1da58e86bed7730c2d20fb4c2c0444750bb Message-Id: <20220125190333.0B2B2385AC33@sourceware.org> Date: Tue, 25 Jan 2022 19:03:33 +0000 (GMT) X-BeenThere: cygwin-cvs@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component git logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2022 19:03:33 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3Df467a1da58e= 86bed7730c2d20fb4c2c0444750bb commit f467a1da58e86bed7730c2d20fb4c2c0444750bb Author: Corinna Vinschen Date: Tue Jan 25 19:53:40 2022 +0100 Cygwin: ACLs: don't set indicator for default ACEs prematurely =20 Commit a2bfe7cae61a introduced a change ignoring default ACEs on files to come up with a valid POSIX ACL, reflecting the Windows ACEs actually making sense on files. =20 However, if CREATOR OWNER or CREATOR GROUP ACEs - both only making sense as default ACEs - are found in the ACL, a value indicating the presence of default ACEs gets set, even on files. This in turn breaks a subsequent integrity check and get_posix_access returns EINVAL. =20 The code path handling default ACEs on directories sets this indicator anyway, so don't set it just because one of the above SIDs are found. =20 Fixes: a2bfe7cae61a ("Cygwin: ACLs: ignore *_INHERIT flags in file ACLs= ") Signed-off-by: Corinna Vinschen Diff: --- winsup/cygwin/sec_acl.cc | 2 -- 1 file changed, 2 deletions(-) diff --git a/winsup/cygwin/sec_acl.cc b/winsup/cygwin/sec_acl.cc index 98d2391b1..32edf0d32 100644 --- a/winsup/cygwin/sec_acl.cc +++ b/winsup/cygwin/sec_acl.cc @@ -850,14 +850,12 @@ get_posix_access (PSECURITY_DESCRIPTOR psd, else if (ace_sid =3D=3D well_known_creator_owner_sid) { type =3D DEF_USER_OBJ; - types_def |=3D type; id =3D ACL_UNDEFINED_ID; saw_def_user_obj =3D true; } else if (ace_sid =3D=3D well_known_creator_group_sid) { type =3D DEF_GROUP_OBJ; - types_def |=3D type; id =3D ACL_UNDEFINED_ID; saw_def_group_obj =3D true; }