public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
From: Corinna Vinschen <corinna@sourceware.org>
To: cygwin-cvs@sourceware.org
Subject: [newlib-cygwin] Cygwin: ACLs: don't set indicator for default ACEs prematurely
Date: Tue, 25 Jan 2022 19:03:33 +0000 (GMT)	[thread overview]
Message-ID: <20220125190333.0B2B2385AC33@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=f467a1da58e86bed7730c2d20fb4c2c0444750bb

commit f467a1da58e86bed7730c2d20fb4c2c0444750bb
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Tue Jan 25 19:53:40 2022 +0100

    Cygwin: ACLs: don't set indicator for default ACEs prematurely
    
    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.
    
    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.
    
    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.
    
    Fixes: a2bfe7cae61a ("Cygwin: ACLs: ignore *_INHERIT flags in file ACLs")
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

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 == well_known_creator_owner_sid)
 	{
 	  type = DEF_USER_OBJ;
-	  types_def |= type;
 	  id = ACL_UNDEFINED_ID;
 	  saw_def_user_obj = true;
 	}
       else if (ace_sid == well_known_creator_group_sid)
 	{
 	  type = DEF_GROUP_OBJ;
-	  types_def |= type;
 	  id = ACL_UNDEFINED_ID;
 	  saw_def_group_obj = true;
 	}


                 reply	other threads:[~2022-01-25 19:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220125190333.0B2B2385AC33@sourceware.org \
    --to=corinna@sourceware.org \
    --cc=cygwin-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).