]> sourceware.org Git - newlib-cygwin.git/commitdiff
* uinfo.cc (pwdgrp::fetch_account_from_windows): Tweak SID<->uid
authorCorinna Vinschen <corinna@vinschen.de>
Wed, 7 May 2014 12:07:12 +0000 (12:07 +0000)
committerCorinna Vinschen <corinna@vinschen.de>
Wed, 7 May 2014 12:07:12 +0000 (12:07 +0000)
conversion to cover S-1-5-113, S-1-5-114, and S-1-5-1000 groups.

winsup/cygwin/ChangeLog
winsup/cygwin/uinfo.cc

index 99a8439356b7ba172ad4882f2d1d468cf48fd910..a9c3f9f02c611361e89b30cc72f5739d962426c7 100644 (file)
@@ -1,3 +1,8 @@
+2014-05-07  Corinna Vinschen  <corinna@vinschen.de>
+
+       * 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.
+
 2014-05-07  Corinna Vinschen  <corinna@vinschen.de>
 
        * grp.cc (pwdgrp::parse_group): Set grp.len.  Drop generating any
index 1de113202e8249b5636fde352a47df9a6ce992c3..5d69f423660cfde64aa3d9200b453c0f5398aaf0 100644 (file)
@@ -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
            {
This page took 0.03604 seconds and 5 git commands to generate.