winbindd: remove currently disabled WINBINDD_SIDS_TO_XIDS support
authorStefan Metzmacher <metze@sernet.de>
Wed, 12 Dec 2007 08:07:13 +0000 (09:07 +0100)
committerStefan Metzmacher <metze@sernet.de>
Fri, 2 May 2008 14:12:21 +0000 (16:12 +0200)
metze

source/nsswitch/winbind_struct_protocol.h
source/winbindd/winbindd.c
source/winbindd/winbindd_idmap.c
source/winbindd/winbindd_sid.c

index e81813c77b37d225c0cec87a184a83bbf5483283..4b4ce7864338540c619c556c9bca9fb64832f1a0 100644 (file)
@@ -146,7 +146,6 @@ enum winbindd_cmd {
         * between parent and children */
        WINBINDD_DUAL_SID2UID,
        WINBINDD_DUAL_SID2GID,
-       WINBINDD_DUAL_SIDS2XIDS,
        WINBINDD_DUAL_UID2SID,
        WINBINDD_DUAL_GID2SID,
        WINBINDD_DUAL_SET_MAPPING,
index 1072f8e762b39de0802607d9cdd2054c880d9663..88e59e2341393d747526407200ce9514b1975656 100644 (file)
@@ -326,9 +326,6 @@ static struct winbindd_dispatch_table {
        { WINBINDD_SID_TO_GID, winbindd_sid_to_gid, "SID_TO_GID" },
        { WINBINDD_UID_TO_SID, winbindd_uid_to_sid, "UID_TO_SID" },
        { WINBINDD_GID_TO_SID, winbindd_gid_to_sid, "GID_TO_SID" },
-#if 0   /* DISABLED until we fix the interface in Samba 3.0.26 --jerry */
-       { WINBINDD_SIDS_TO_XIDS, winbindd_sids_to_unixids, "SIDS_TO_XIDS" },
-#endif  /* end DISABLED */
        { WINBINDD_ALLOCATE_UID, winbindd_allocate_uid, "ALLOCATE_UID" },
        { WINBINDD_ALLOCATE_GID, winbindd_allocate_gid, "ALLOCATE_GID" },
        { WINBINDD_SET_MAPPING, winbindd_set_mapping, "SET_MAPPING" },
index 3c7aa2d0c22d173df0f912a5ba208e1bce3fce4e..41782ff0d151c8c75c94db44f30223a71de99309 100644 (file)
@@ -170,108 +170,6 @@ enum winbindd_result winbindd_dual_set_hwm(struct winbindd_domain *domain,
        return NT_STATUS_IS_OK(result) ? WINBINDD_OK : WINBINDD_ERROR;
 }
 
-static void winbindd_sids2xids_recv(TALLOC_CTX *mem_ctx, bool success,
-                              struct winbindd_response *response,
-                              void *c, void *private_data)
-{
-       void (*cont)(void *priv, bool succ, void *, int) =
-               (void (*)(void *, bool, void *, int))c;
-
-       if (!success) {
-               DEBUG(5, ("Could not trigger sids2xids\n"));
-               cont(private_data, False, NULL, 0);
-               return;
-       }
-
-       if (response->result != WINBINDD_OK) {
-               DEBUG(5, ("sids2xids returned an error\n"));
-               cont(private_data, False, NULL, 0);
-               return;
-       }
-
-       cont(private_data, True, response->extra_data.data, response->length - sizeof(response));
-}
-
-void winbindd_sids2xids_async(TALLOC_CTX *mem_ctx, void *sids, int size,
-                        void (*cont)(void *private_data, bool success, void *data, int len),
-                        void *private_data)
-{
-       struct winbindd_request request;
-       ZERO_STRUCT(request);
-       request.cmd = WINBINDD_DUAL_SIDS2XIDS;
-       request.extra_data.data = (char *)sids;
-       request.extra_len = size;
-       do_async(mem_ctx, idmap_child(), &request, winbindd_sids2xids_recv,
-                (void *)cont, private_data);
-}
-
-enum winbindd_result winbindd_dual_sids2xids(struct winbindd_domain *domain,
-                                          struct winbindd_cli_state *state)
-{
-       DOM_SID *sids;
-       struct unixid *xids;
-       struct id_map **ids;
-       NTSTATUS result;
-       int num, i;
-
-       DEBUG(3, ("[%5lu]: sids to unix ids\n", (unsigned long)state->pid));
-
-       if (state->request.extra_len == 0) {
-               DEBUG(0, ("Invalid buffer size!\n"));
-               return WINBINDD_ERROR;
-       }
-
-       sids = (DOM_SID *)state->request.extra_data.data;
-       num = state->request.extra_len / sizeof(DOM_SID);
-
-       ids = TALLOC_ZERO_ARRAY(state->mem_ctx, struct id_map *, num + 1);
-       if ( ! ids) {
-               DEBUG(0, ("Out of memory!\n"));
-               return WINBINDD_ERROR;
-       }
-       for (i = 0; i < num; i++) {
-               ids[i] = TALLOC_P(ids, struct id_map);
-               if ( ! ids[i]) {
-                       DEBUG(0, ("Out of memory!\n"));
-                       talloc_free(ids);
-                       return WINBINDD_ERROR;
-               }
-               ids[i]->sid = &sids[i];
-       }
-
-       result = idmap_sids_to_unixids(ids);
-
-       if (NT_STATUS_IS_OK(result)) {
-
-               xids = SMB_MALLOC_ARRAY(struct unixid, num);
-               if ( ! xids) {
-                       DEBUG(0, ("Out of memory!\n"));
-                       talloc_free(ids);
-                       return WINBINDD_ERROR;
-               }
-
-               for (i = 0; i < num; i++) {
-                       if (ids[i]->status == ID_MAPPED) {
-                               xids[i].type = ids[i]->xid.type;
-                               xids[i].id = ids[i]->xid.id;
-                       } else {
-                               xids[i].type = -1;
-                       }
-               }
-
-               state->response.length = sizeof(state->response) + (sizeof(struct unixid) * num);
-               state->response.extra_data.data = xids;
-
-       } else {
-               DEBUG (2, ("idmap_sids_to_unixids returned an error: 0x%08x\n", NT_STATUS_V(result)));
-               talloc_free(ids);
-               return WINBINDD_ERROR;
-       }
-
-       talloc_free(ids);
-       return WINBINDD_OK;
-}
-
 static void winbindd_sid2uid_recv(TALLOC_CTX *mem_ctx, bool success,
                               struct winbindd_response *response,
                               void *c, void *private_data)
@@ -521,12 +419,6 @@ static const struct winbindd_child_dispatch_table idmap_dispatch_table[] = {
                .name           = "DUAL_SID2GID",
                .struct_cmd     = WINBINDD_DUAL_SID2GID,
                .struct_fn      = winbindd_dual_sid2gid,
-#if 0   /* DISABLED until we fix the interface in Samba 3.0.26 --jerry */
-       },{
-               .name           = "DUAL_SIDS2XIDS",
-               .struct_cmd     = WINBINDD_DUAL_SIDS2XIDS,
-               .struct_fn      = winbindd_dual_sids2xids,
-#endif  /* end DISABLED */
        },{
                .name           = "DUAL_UID2SID",
                .struct_cmd     = WINBINDD_DUAL_UID2SID,
index 0e8e6ca00bf9ffa50df770543fc205928a6f9827..f68399538b3c288abfcce051c6cfaa160834355e 100644 (file)
@@ -309,32 +309,6 @@ void winbindd_sid_to_gid(struct winbindd_cli_state *state)
        winbindd_lookupsid_async( state->mem_ctx, &sid, sid2gid_lookupsid_recv, state );        
 }
 
-static void sids2xids_recv(void *private_data, bool success, void *data, int len)
-{
-       struct winbindd_cli_state *state =
-               talloc_get_type_abort(private_data, struct winbindd_cli_state);
-
-       if (!success) {
-               DEBUG(5, ("Could not convert sids to xids\n"));
-               request_error(state);
-               return;
-       }
-
-       state->response.extra_data.data = data;
-       state->response.length = sizeof(state->response) + len;
-       request_ok(state);
-}
-
-void winbindd_sids_to_unixids(struct winbindd_cli_state *state)
-{
-       DEBUG(3, ("[%5lu]: sids to xids\n", (unsigned long)state->pid));
-
-       winbindd_sids2xids_async(state->mem_ctx,
-                       state->request.extra_data.data,
-                       state->request.extra_len,
-                       sids2xids_recv, state);
-}
-
 static void set_mapping_recv(void *private_data, bool success)
 {
        struct winbindd_cli_state *state =