diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2014-05-07 16:07:12 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2014-05-07 16:07:12 +0400 |
commit | 951bc34df496e1f8fa31db778534ea3c86f71827 (patch) | |
tree | 371378af083369c16a93599858349e8bbdd9f1b8 /winsup/cygwin/uinfo.cc | |
parent | 20de26ebf982c2645b724b126b103cc8629f51eb (diff) |
* uinfo.cc (pwdgrp::fetch_account_from_windows): Tweak SID<->uid
conversion to cover S-1-5-113, S-1-5-114, and S-1-5-1000 groups.
Diffstat (limited to 'winsup/cygwin/uinfo.cc')
-rw-r--r-- | winsup/cygwin/uinfo.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/winsup/cygwin/uinfo.cc b/winsup/cygwin/uinfo.cc index 1de113202..5d69f4236 100644 --- a/winsup/cygwin/uinfo.cc +++ b/winsup/cygwin/uinfo.cc @@ -1271,6 +1271,8 @@ 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 == 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 @@ -1659,7 +1661,8 @@ pwdgrp::fetch_account_from_windows (fetch_user_arg_t &arg, cyg_ldap *pldap) if (sid_id_auth (sid) != 5 /* SECURITY_NT_AUTHORITY */) uid = 0x10000 + 0x100 * sid_id_auth (sid) + (sid_sub_auth_rid (sid) & 0xff); - else if (sid_sub_auth (sid, 0) < SECURITY_PACKAGE_BASE_RID) + else if (sid_sub_auth (sid, 0) < SECURITY_PACKAGE_BASE_RID + || sid_sub_auth (sid, 0) > SECURITY_MAX_BASE_RID) uid = sid_sub_auth_rid (sid) & 0x7ff; else { |