pastebin - collaborative debugging tool
nrubsig.kpaste.net RSS


cygwin uid/gid hack
Posted by Anonymous on Wed 8th Oct 2025 11:03
raw | new post
modification of post by Anonymous (view diff)

  1. # https://gitforwindows.org/building-msys2-runtime.html
  2. diff --git a/winsup/cygwin/fhandler/disk_file.cc b/winsup/cygwin/fhandler/disk_file.cc
  3. index d54d3747e..92a54d9db 100644
  4. --- a/winsup/cygwin/fhandler/disk_file.cc
  5. +++ b/winsup/cygwin/fhandler/disk_file.cc
  6. @@ -239,8 +239,12 @@ fhandler_base::fstat_by_nfs_ea (struct stat *buf)
  7.           domain = cygheap->dom.get_rfc2307_domain ();
  8.           if ((ldap_open = (cldap.open (domain) == NO_ERROR)))
  9.             map_uid = cldap.remap_uid (nfs_attr->uid);
  10. -         if (map_uid == ILLEGAL_UID)
  11. -           map_uid = MAP_UNIX_TO_CYGWIN_ID (nfs_attr->uid);
  12. +         if (map_uid == ILLEGAL_UID) {
  13. +            if (pc.has_acls())
  14. +              map_uid = nfs_attr->uid;
  15. +            else
  16. +              map_uid = MAP_UNIX_TO_CYGWIN_ID (nfs_attr->uid);
  17. +          }
  18.           cygheap->ugid_cache.add_uid (nfs_attr->uid, map_uid);
  19.           buf->st_uid = map_uid;
  20.         }
  21. @@ -258,8 +262,12 @@ fhandler_base::fstat_by_nfs_ea (struct stat *buf)
  22.           domain = cygheap->dom.get_rfc2307_domain ();
  23.           if ((ldap_open || cldap.open (domain) == NO_ERROR))
  24.             map_gid = cldap.remap_gid (nfs_attr->gid);
  25. -         if (map_gid == ILLEGAL_GID)
  26. -           map_gid = MAP_UNIX_TO_CYGWIN_ID (nfs_attr->gid);
  27. +         if (map_gid == ILLEGAL_GID) {
  28. +            if (pc.has_acls())
  29. +              map_gid = nfs_attr->gid;
  30. +            else
  31. +             map_gid = MAP_UNIX_TO_CYGWIN_ID (nfs_attr->gid);
  32. +          }
  33.           cygheap->ugid_cache.add_gid (nfs_attr->gid, map_gid);
  34.           buf->st_gid = map_gid;
  35.         }

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at