Add and delete aliases via srv_samr_nt. For that I added a RID allocation call
[sfrench/samba-autobuild/.git] / source3 / nsswitch / wb_client.c
index 90e4584daba026676b7d0f42acea0de2e13e9527..32dfc8decac7848fbec2919eb27f92c88de9a922 100644 (file)
@@ -235,6 +235,30 @@ BOOL winbind_gid_to_sid(DOM_SID *sid, gid_t gid)
        return (result == NSS_STATUS_SUCCESS);
 }
 
+BOOL winbind_allocate_rid(uint32 *rid)
+{
+       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, &request, &response);
+
+       if (result != NSS_STATUS_SUCCESS)
+               return False;
+
+       /* Copy out result */
+       *rid = response.data.rid;
+
+       return True;
+}
+
 /* Fetch the list of groups a user is a member of from winbindd.  This is
    used by winbind_getgroups. */
 
@@ -595,8 +619,6 @@ BOOL winbind_delete_group( const char *group )
 }
 
 /***********************************************************************/
-#if 0  /* not needed currently since winbindd_acct was added -- jerry */
-
 /* Call winbindd to convert SID to uid. Do not allocate */
 
 BOOL winbind_sid_to_uid_query(uid_t *puid, const DOM_SID *sid)
@@ -667,7 +689,5 @@ BOOL winbind_sid_to_gid_query(gid_t *pgid, const DOM_SID *sid)
        return (result == NSS_STATUS_SUCCESS);
 }
 
-#endif         /* JERRY */
-
 /***********************************************************************/