This is the mail archive of the cygwin-cvs@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[newlib-cygwin] Only generate BUILTIN SIDs for uid/gid values <= 999


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

commit e7414a317af672144940ba405d3d890227ddb176
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Sun Nov 29 21:21:35 2015 +0100

    Only generate BUILTIN SIDs for uid/gid values <= 999
    
    	* uinfo.cc (pwdgrp::fetch_account_from_windows): Only create 1-5-32-x
    	SIDs from ids for x <= 999.
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 winsup/cygwin/ChangeLog | 5 +++++
 winsup/cygwin/uinfo.cc  | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 4644d35..f537983 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,10 @@
 2015-11-29  Corinna Vinschen  <corinna@vinschen.de>
 
+	* uinfo.cc (pwdgrp::fetch_account_from_windows): Only create 1-5-32-x
+	SIDs from ids for x <= 999.
+
+2015-11-29  Corinna Vinschen  <corinna@vinschen.de>
+
 	* sec_acl.cc (get_posix_access): In case owner SID == group SID, when
 	encountering the group entry, change the value of `id' accordingly.
 	Explain why.
diff --git a/winsup/cygwin/uinfo.cc b/winsup/cygwin/uinfo.cc
index df7d42f..c9b3e09 100644
--- a/winsup/cygwin/uinfo.cc
+++ b/winsup/cygwin/uinfo.cc
@@ -1953,10 +1953,10 @@ pwdgrp::fetch_account_from_windows (fetch_user_arg_t &arg, cyg_ldap *pldap)
 	 by mkpasswd/mkgroup. */
       if (arg.id < 0x200)
 	__small_swprintf (sidstr, L"S-1-5-%u", arg.id & 0x1ff);
+      else if (arg.id <= 0x3e7)
+	__small_swprintf (sidstr, L"S-1-5-32-%u", arg.id & 0x3ff);
       else if (arg.id == 0x3e8) /* Special case "Other Organization" */
 	wcpcpy (sidstr, L"S-1-5-1000");
-      else if (arg.id <= 0x7ff)
-	__small_swprintf (sidstr, L"S-1-5-32-%u", arg.id & 0x7ff);
       else
 #endif
       if (arg.id == 0xffe)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]