From e7414a317af672144940ba405d3d890227ddb176 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Sun, 29 Nov 2015 21:21:35 +0100 Subject: [PATCH] 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 --- 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 4644d35cb..f537983a8 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2015-11-29 Corinna Vinschen + + * uinfo.cc (pwdgrp::fetch_account_from_windows): Only create 1-5-32-x + SIDs from ids for x <= 999. + 2015-11-29 Corinna Vinschen * sec_acl.cc (get_posix_access): In case owner SID == group SID, when diff --git a/winsup/cygwin/uinfo.cc b/winsup/cygwin/uinfo.cc index df7d42f8e..c9b3e099a 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)