r7415: * big change -- volker's new async winbindd from trunk
[abartlet/samba.git/.git] / source3 / nsswitch / wb_client.c
index 5005f72457a02f4be056c0e4c229bfb352aa3c9f..32ac4319a0382bd65f0b10ed1f886d0c45de0f24 100644 (file)
@@ -257,6 +257,32 @@ BOOL winbind_allocate_rid(uint32 *rid)
        return True;
 }
 
+BOOL winbind_allocate_rid_and_gid(uint32 *rid, gid_t *gid)
+{
+       struct winbindd_request request;
+       struct winbindd_response response;
+       int result;
+
+       /* Initialise request */
+
+       ZERO_STRUCT(request);
+       ZERO_STRUCT(response);
+
+       /* Make request */
+
+       result = winbindd_request(WINBINDD_ALLOCATE_RID_AND_GID, &request,
+                                 &response);
+
+       if (result != NSS_STATUS_SUCCESS)
+               return False;
+
+       /* Copy out result */
+       *rid = response.data.rid_and_gid.rid;
+       *gid = response.data.rid_and_gid.gid;
+
+       return True;
+}
+
 /* Fetch the list of groups a user is a member of from winbindd.  This is
    used by winbind_getgroups. */