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

commit 3858f07dd8c92e2084b07d272998cdb7a6b6bbc9
Author:     Corinna Vinschen <cori...@vinschen.de>
AuthorDate: Wed Jan 15 11:40:14 2025 +0100
Commit:     Corinna Vinschen <cori...@vinschen.de>
CommitDate: Wed Jan 15 12:27:03 2025 +0100

    Cygwin: get_posix_access: fix id in default:user and default:group entry
    
    Setting the a_id in the default:user and default:group entries to
    the actual uid and gid of the current owner/group doesn't make
    sense.  Change to ACL_UNDEFINED_ID.
    
    Fixes: bc444e5aa4ca ("Reapply POSIX ACL changes.")
    Signed-off-by: Corinna Vinschen <cori...@vinschen.de>

Diff:
---
 winsup/cygwin/sec/acl.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/winsup/cygwin/sec/acl.cc b/winsup/cygwin/sec/acl.cc
index d68bebf928f3..1d374b5e5a6d 100644
--- a/winsup/cygwin/sec/acl.cc
+++ b/winsup/cygwin/sec/acl.cc
@@ -1054,7 +1054,7 @@ get_posix_access (PSECURITY_DESCRIPTOR psd,
       if (!(types_def & USER_OBJ))
        {
          lacl[pos].a_type = DEF_USER_OBJ;
-         lacl[pos].a_id = uid;
+         lacl[pos].a_id = ACL_UNDEFINED_ID;
          lacl[pos].a_perm = lacl[0].a_perm;
          aclsid[pos] = well_known_creator_owner_sid;
          pos++;
@@ -1062,7 +1062,7 @@ get_posix_access (PSECURITY_DESCRIPTOR psd,
       if (!(types_def & GROUP_OBJ) && pos < MAX_ACL_ENTRIES)
        {
          lacl[pos].a_type = DEF_GROUP_OBJ;
-         lacl[pos].a_id = gid;
+         lacl[pos].a_id = ACL_UNDEFINED_ID;
          lacl[pos].a_perm = lacl[1].a_perm;
          /* If owner == group, the owner perms should be used. */
          if (owner_eq_group)

Reply via email to