r2566: Fix creation of aliases via usrmgr. Winbind was too strict checking the type
authorVolker Lendecke <vlendec@samba.org>
Thu, 23 Sep 2004 15:21:02 +0000 (15:21 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:52:46 +0000 (10:52 -0500)
of sids.

Volker

source/nsswitch/winbindd_sid.c

index c6e503bef39d6651a142a1895ec65e1b8a9e0947..97e676813dde211e1c14521834e49391d269025c 100644 (file)
@@ -316,8 +316,16 @@ enum winbindd_result winbindd_sid_to_gid(struct winbindd_cli_state *state)
                fstring dom_name, name;
                enum SID_NAME_USE type;
 
-               if (!winbindd_lookup_name_by_sid(&sid, dom_name, name, &type))
-                       return WINBINDD_ERROR;
+               if (sid_check_is_in_our_domain(&sid)) {
+                       /* This is for half-created aliases... */
+                       type = SID_NAME_ALIAS;
+               } else {
+                       /* Foreign domains need to be looked up by the DC if
+                        * it's the right type */
+                       if (!winbindd_lookup_name_by_sid(&sid, dom_name, name,
+                                                        &type))
+                               return WINBINDD_ERROR;
+               }
 
                if ((type != SID_NAME_DOM_GRP) && (type != SID_NAME_ALIAS) &&
                    (type != SID_NAME_WKN_GRP))