pastebin - collaborative debugging tool
nrubsig.kpaste.net RSS


cygwin uid/gid hack
Posted by Anonymous on Sat 27th Sep 2025 17:05
raw | new post

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

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