s3:winbindd:getgrnam: also produce a group struct for a user with ID_TYPE_BOTH
authorMichael Adam <obnox@samba.org>
Thu, 6 Dec 2012 23:55:18 +0000 (00:55 +0100)
committerStefan Metzmacher <metze@samba.org>
Tue, 29 Jan 2013 20:56:58 +0000 (21:56 +0100)
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source3/winbindd/winbindd_getgrnam.c

index 9a2f64e4ad0ee91dc1fd69ba24881c91f8e24aa4..bc970cbf22636a9ce3d2d7375f84e0ca710078aa 100644 (file)
@@ -101,8 +101,19 @@ static void winbindd_getgrnam_lookupname_done(struct tevent_req *subreq)
                return;
        }
 
-       if ( (type != SID_NAME_DOM_GRP) && (type != SID_NAME_ALIAS) ) {
-               DEBUG(5,("getgrnam_recv: not a group!\n"));
+       switch (type) {
+       case SID_NAME_DOM_GRP:
+       case SID_NAME_ALIAS:
+       case SID_NAME_WKN_GRP:
+       /*
+        * Also give user types a chance:
+        * These might be user sids mapped to the ID_TYPE_BOTH,
+        * and in that case we should construct a group struct.
+        */
+       case SID_NAME_USER:
+       case SID_NAME_COMPUTER:
+               break;
+       default:
                tevent_req_nterror(req, NT_STATUS_NO_SUCH_GROUP);
                return;
        }