s3:winbind: remove the method SET_MAPPING from winbind's API
authorMichael Adam <obnox@samba.org>
Thu, 22 Jan 2009 13:29:15 +0000 (14:29 +0100)
committerMichael Adam <obnox@samba.org>
Sat, 14 Aug 2010 00:10:33 +0000 (02:10 +0200)
Michael

nsswitch/winbind_struct_protocol.h
source3/Makefile.in
source3/librpc/idl/wbint.idl
source3/winbindd/winbindd.c
source3/winbindd/winbindd_dual_srv.c
source3/winbindd/winbindd_proto.h
source3/winbindd/winbindd_set_mapping.c [deleted file]

index 7554d5799a6c16a1d34138511e95514e74ca72f8..2d6c8b326dbbafe185fa5a22a053a189cc08489e 100644 (file)
@@ -115,7 +115,6 @@ enum winbindd_cmd {
 
        WINBINDD_ALLOCATE_UID,
        WINBINDD_ALLOCATE_GID,
 
        WINBINDD_ALLOCATE_UID,
        WINBINDD_ALLOCATE_GID,
-       WINBINDD_SET_MAPPING,
        WINBINDD_REMOVE_MAPPING,
 
        /* Miscellaneous other stuff */
        WINBINDD_REMOVE_MAPPING,
 
        /* Miscellaneous other stuff */
@@ -166,7 +165,6 @@ enum winbindd_cmd {
        WINBINDD_DUAL_SIDS2XIDS,
        WINBINDD_DUAL_UID2SID,
        WINBINDD_DUAL_GID2SID,
        WINBINDD_DUAL_SIDS2XIDS,
        WINBINDD_DUAL_UID2SID,
        WINBINDD_DUAL_GID2SID,
-       WINBINDD_DUAL_SET_MAPPING,
        WINBINDD_DUAL_REMOVE_MAPPING,
 
        /* Wrapper around possibly blocking unix nss calls */
        WINBINDD_DUAL_REMOVE_MAPPING,
 
        /* Wrapper around possibly blocking unix nss calls */
index 2d56e943b55b3e3aa50773d38b3ddb947d209319..9c337ae39fe23e7e92ee0651e022968eace6c7be 100644 (file)
@@ -1300,7 +1300,6 @@ WINBINDD_OBJ1 = \
                winbindd/winbindd_check_machine_acct.o \
                winbindd/winbindd_change_machine_acct.o \
                winbindd/winbindd_ping_dc.o \
                winbindd/winbindd_check_machine_acct.o \
                winbindd/winbindd_change_machine_acct.o \
                winbindd/winbindd_ping_dc.o \
-               winbindd/winbindd_set_mapping.o \
                winbindd/winbindd_remove_mapping.o \
                winbindd/winbindd_pam_auth.o \
                winbindd/winbindd_pam_auth_crap.o \
                winbindd/winbindd_remove_mapping.o \
                winbindd/winbindd_pam_auth.o \
                winbindd/winbindd_pam_auth_crap.o \
index d1557f895597289fd9180c7d88334b23f4bd91ec..62d0b4170f3ee6f3f6c9ab2591ef119a208fb63e 100644 (file)
@@ -160,12 +160,6 @@ interface wbint
        WBINT_ID_TYPE_GID
     } wbint_IdType;
 
        WBINT_ID_TYPE_GID
     } wbint_IdType;
 
-    NTSTATUS wbint_SetMapping(
-       [in] dom_sid *sid,
-       [in] wbint_IdType type,
-       [in] hyper id
-       );
-
     NTSTATUS wbint_RemoveMapping(
        [in] dom_sid *sid,
        [in] wbint_IdType type,
     NTSTATUS wbint_RemoveMapping(
        [in] dom_sid *sid,
        [in] wbint_IdType type,
index 6221422f0ce6108417158935abf7bc98c2905a4e..673addd3398394751d643c417fa0a983232e8279 100644 (file)
@@ -543,8 +543,6 @@ static struct winbindd_async_dispatch_table async_priv_table[] = {
          winbindd_allocate_uid_send, winbindd_allocate_uid_recv },
        { WINBINDD_ALLOCATE_GID, "ALLOCATE_GID",
          winbindd_allocate_gid_send, winbindd_allocate_gid_recv },
          winbindd_allocate_uid_send, winbindd_allocate_uid_recv },
        { WINBINDD_ALLOCATE_GID, "ALLOCATE_GID",
          winbindd_allocate_gid_send, winbindd_allocate_gid_recv },
-       { WINBINDD_SET_MAPPING, "SET_MAPPING",
-         winbindd_set_mapping_send, winbindd_set_mapping_recv },
        { WINBINDD_REMOVE_MAPPING, "SET_MAPPING",
          winbindd_remove_mapping_send, winbindd_remove_mapping_recv },
        { WINBINDD_CHANGE_MACHACC, "CHANGE_MACHACC",
        { WINBINDD_REMOVE_MAPPING, "SET_MAPPING",
          winbindd_remove_mapping_send, winbindd_remove_mapping_recv },
        { WINBINDD_CHANGE_MACHACC, "CHANGE_MACHACC",
index 5a94e755111ec9efa9197994300224b4183b9f21..85467d09d7e9039c109718f60b9689f6353172c4 100644 (file)
@@ -563,28 +563,6 @@ NTSTATUS _wbint_PingDc(struct pipes_struct *p, struct wbint_PingDc *r)
        return NT_STATUS_OK;
 }
 
        return NT_STATUS_OK;
 }
 
-NTSTATUS _wbint_SetMapping(struct pipes_struct *p, struct wbint_SetMapping *r)
-{
-       struct id_map map;
-
-       map.sid = r->in.sid;
-       map.xid.id = r->in.id;
-       map.status = ID_MAPPED;
-
-       switch (r->in.type) {
-       case WBINT_ID_TYPE_UID:
-               map.xid.type = ID_TYPE_UID;
-               break;
-       case WBINT_ID_TYPE_GID:
-               map.xid.type = ID_TYPE_GID;
-               break;
-       default:
-               return NT_STATUS_INVALID_PARAMETER;
-       }
-
-       return idmap_set_mapping(&map);
-}
-
 NTSTATUS _wbint_RemoveMapping(struct pipes_struct *p,
                              struct wbint_RemoveMapping *r)
 {
 NTSTATUS _wbint_RemoveMapping(struct pipes_struct *p,
                              struct wbint_RemoveMapping *r)
 {
index 8ce31d7e2aa8c2dd79406bb8d1593ed4fdc5f158..b90c90a646c7e6eb0e7208febd03f5ae3a6e2d63 100644 (file)
@@ -816,13 +816,6 @@ struct tevent_req *winbindd_change_machine_acct_send(TALLOC_CTX *mem_ctx,
 NTSTATUS winbindd_change_machine_acct_recv(struct tevent_req *req,
                                           struct winbindd_response *presp);
 
 NTSTATUS winbindd_change_machine_acct_recv(struct tevent_req *req,
                                           struct winbindd_response *presp);
 
-struct tevent_req *winbindd_set_mapping_send(TALLOC_CTX *mem_ctx,
-                                            struct tevent_context *ev,
-                                            struct winbindd_cli_state *cli,
-                                            struct winbindd_request *request);
-NTSTATUS winbindd_set_mapping_recv(struct tevent_req *req,
-                                  struct winbindd_response *response);
-
 struct tevent_req *winbindd_remove_mapping_send(TALLOC_CTX *mem_ctx,
                                                struct tevent_context *ev,
                                                struct winbindd_cli_state *cli,
 struct tevent_req *winbindd_remove_mapping_send(TALLOC_CTX *mem_ctx,
                                                struct tevent_context *ev,
                                                struct winbindd_cli_state *cli,
diff --git a/source3/winbindd/winbindd_set_mapping.c b/source3/winbindd/winbindd_set_mapping.c
deleted file mode 100644 (file)
index 7ca564a..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
-   Unix SMB/CIFS implementation.
-   async implementation of WINBINDD_SET_MAPPING
-   Copyright (C) Volker Lendecke 2009
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "includes.h"
-#include "winbindd.h"
-#include "librpc/gen_ndr/cli_wbint.h"
-
-struct winbindd_set_mapping_state {
-       struct dom_sid sid;
-};
-
-static void winbindd_set_mapping_done(struct tevent_req *subreq);
-
-struct tevent_req *winbindd_set_mapping_send(TALLOC_CTX *mem_ctx,
-                                            struct tevent_context *ev,
-                                            struct winbindd_cli_state *cli,
-                                            struct winbindd_request *request)
-{
-       struct tevent_req *req, *subreq;
-       struct winbindd_set_mapping_state *state;
-       struct winbindd_child *child;
-       enum wbint_IdType type;
-
-       req = tevent_req_create(mem_ctx, &state,
-                               struct winbindd_set_mapping_state);
-       if (req == NULL) {
-               return NULL;
-       }
-
-       /* Ensure null termination */
-       request->data.dual_idmapset.sid[
-               sizeof(request->data.dual_idmapset.sid)-1]='\0';
-
-       DEBUG(3, ("set_mapping %s\n", request->data.dual_idmapset.sid));
-
-       if (!string_to_sid(&state->sid, request->data.dual_idmapset.sid)) {
-               DEBUG(5, ("%s not a SID\n", request->data.dual_idmapset.sid));
-               tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER);
-               return tevent_req_post(req, ev);
-       }
-
-       switch (request->data.dual_idmapset.type) {
-       case ID_TYPE_UID:
-               type = WBINT_ID_TYPE_UID;
-               break;
-       case ID_TYPE_GID:
-               type = WBINT_ID_TYPE_GID;
-               break;
-       default:
-               tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER);
-               return tevent_req_post(req, ev);
-       }
-
-       child = idmap_child();
-
-       subreq = rpccli_wbint_SetMapping_send(state, ev, child->rpccli,
-                                             &state->sid, type,
-                                             request->data.dual_idmapset.id);
-       if (tevent_req_nomem(subreq, req)) {
-               return tevent_req_post(req, ev);
-       }
-       tevent_req_set_callback(subreq, winbindd_set_mapping_done, req);
-       return req;
-}
-
-static void winbindd_set_mapping_done(struct tevent_req *subreq)
-{
-       struct tevent_req *req = tevent_req_callback_data(
-               subreq, struct tevent_req);
-       struct winbindd_set_mapping_state *state = tevent_req_data(
-               req, struct winbindd_set_mapping_state);
-       NTSTATUS status, result;
-
-       status = rpccli_wbint_SetMapping_recv(subreq, state, &result);
-       if (!NT_STATUS_IS_OK(status)) {
-               tevent_req_nterror(req, status);
-               return;
-       }
-       if (!NT_STATUS_IS_OK(result)) {
-               tevent_req_nterror(req, result);
-               return;
-       }
-       tevent_req_done(req);
-}
-
-NTSTATUS winbindd_set_mapping_recv(struct tevent_req *req,
-                                  struct winbindd_response *response)
-{
-       return tevent_req_simple_recv_ntstatus(req);
-}