1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

s3:winbind: remove the method REMOVE_MAPPING from winbind's API

Michael
This commit is contained in:
Michael Adam 2009-01-22 14:34:50 +01:00
parent 6740c180e6
commit 3b56f7f6b5
7 changed files with 0 additions and 153 deletions

View File

@ -115,7 +115,6 @@ enum winbindd_cmd {
WINBINDD_ALLOCATE_UID,
WINBINDD_ALLOCATE_GID,
WINBINDD_REMOVE_MAPPING,
/* Miscellaneous other stuff */
@ -165,7 +164,6 @@ enum winbindd_cmd {
WINBINDD_DUAL_SIDS2XIDS,
WINBINDD_DUAL_UID2SID,
WINBINDD_DUAL_GID2SID,
WINBINDD_DUAL_REMOVE_MAPPING,
/* Wrapper around possibly blocking unix nss calls */
WINBINDD_DUAL_USERINFO,

View 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_remove_mapping.o \
winbindd/winbindd_pam_auth.o \
winbindd/winbindd_pam_auth_crap.o \
winbindd/winbindd_pam_chauthtok.o \

View File

@ -153,16 +153,4 @@ interface wbint
NTSTATUS wbint_PingDc(
);
typedef [public] enum {
WBINT_ID_TYPE_NOT_SPECIFIED,
WBINT_ID_TYPE_UID,
WBINT_ID_TYPE_GID
} wbint_IdType;
NTSTATUS wbint_RemoveMapping(
[in] dom_sid *sid,
[in] wbint_IdType type,
[in] hyper id
);
}

View 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_REMOVE_MAPPING, "SET_MAPPING",
winbindd_remove_mapping_send, winbindd_remove_mapping_recv },
{ WINBINDD_CHANGE_MACHACC, "CHANGE_MACHACC",
winbindd_change_machine_acct_send, winbindd_change_machine_acct_recv },
{ WINBINDD_PAM_AUTH_CRAP, "PAM_AUTH_CRAP",

View File

@ -562,26 +562,3 @@ NTSTATUS _wbint_PingDc(struct pipes_struct *p, struct wbint_PingDc *r)
DEBUG(5, ("winbindd_dual_ping_dc succeeded\n"));
return NT_STATUS_OK;
}
NTSTATUS _wbint_RemoveMapping(struct pipes_struct *p,
struct wbint_RemoveMapping *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_remove_mapping(&map);
}

View 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);
struct tevent_req *winbindd_remove_mapping_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
struct winbindd_cli_state *cli,
struct winbindd_request *request);
NTSTATUS winbindd_remove_mapping_recv(struct tevent_req *req,
struct winbindd_response *response);
struct tevent_req *winbindd_pam_auth_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
struct winbindd_cli_state *cli,

View File

@ -1,106 +0,0 @@
/*
Unix SMB/CIFS implementation.
async implementation of WINBINDD_REMOVE_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_remove_mapping_state {
struct dom_sid sid;
};
static void winbindd_remove_mapping_done(struct tevent_req *subreq);
struct tevent_req *winbindd_remove_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_remove_mapping_state *state;
struct winbindd_child *child;
enum wbint_IdType type;
req = tevent_req_create(mem_ctx, &state,
struct winbindd_remove_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_RemoveMapping_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_remove_mapping_done, req);
return req;
}
static void winbindd_remove_mapping_done(struct tevent_req *subreq)
{
struct tevent_req *req = tevent_req_callback_data(
subreq, struct tevent_req);
struct winbindd_remove_mapping_state *state = tevent_req_data(
req, struct winbindd_remove_mapping_state);
NTSTATUS status, result;
status = rpccli_wbint_RemoveMapping_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_remove_mapping_recv(struct tevent_req *req,
struct winbindd_response *response)
{
return tevent_req_simple_recv_ntstatus(req);
}