winbind: Remove unused WINBINDD_SID_TO_GID
authorVolker Lendecke <vl@samba.org>
Tue, 9 Feb 2016 07:02:22 +0000 (08:02 +0100)
committerRalph Boehme <slow@samba.org>
Mon, 22 Feb 2016 19:29:16 +0000 (20:29 +0100)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
nsswitch/winbind_struct_protocol.h
source3/winbindd/winbindd.c
source3/winbindd/winbindd_sid_to_gid.c [deleted file]
source3/wscript_build

index 004e2ede1c87909caf7405da7f7249010fd24b66..f24ba72d19079be3a4035cbc8ff62f7c66f01ce2 100644 (file)
@@ -55,6 +55,7 @@ typedef char fstring[FSTRING_LEN];
  * 27: added WINBINDD_LOOKUPSIDS
  * 28: added WINBINDD_XIDS_TO_SIDS
  *     removed WINBINDD_SID_TO_UID
+ *     removed WINBINDD_SID_TO_GID
  */
 #define WINBIND_INTERFACE_VERSION 28
 
@@ -112,7 +113,6 @@ enum winbindd_cmd {
 
        /* Lookup functions */
 
-       WINBINDD_SID_TO_GID,
        WINBINDD_SIDS_TO_XIDS,
        WINBINDD_XIDS_TO_SIDS,
        WINBINDD_UID_TO_SID,
index e54c6f7e146b48f62034fc351acc1fdb02a1ec0a..e4090bdd42e4545cde325f979ee684f7c1983487 100644 (file)
@@ -608,8 +608,6 @@ static struct winbindd_async_dispatch_table async_nonpriv_table[] = {
          winbindd_lookupsids_send, winbindd_lookupsids_recv },
        { WINBINDD_LOOKUPNAME, "LOOKUPNAME",
          winbindd_lookupname_send, winbindd_lookupname_recv },
-       { WINBINDD_SID_TO_GID, "SID_TO_GID",
-         winbindd_sid_to_gid_send, winbindd_sid_to_gid_recv },
        { WINBINDD_UID_TO_SID, "UID_TO_SID",
          winbindd_uid_to_sid_send, winbindd_uid_to_sid_recv },
        { WINBINDD_GID_TO_SID, "GID_TO_SID",
diff --git a/source3/winbindd/winbindd_sid_to_gid.c b/source3/winbindd/winbindd_sid_to_gid.c
deleted file mode 100644 (file)
index 978ed6a..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
-   Unix SMB/CIFS implementation.
-   async implementation of WINBINDD_SID_TO_GID
-   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 "../libcli/security/security.h"
-
-struct winbindd_sid_to_gid_state {
-       struct dom_sid sid;
-       gid_t gid;
-};
-
-static void winbindd_sid_to_gid_done(struct tevent_req *subreq);
-
-struct tevent_req *winbindd_sid_to_gid_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_sid_to_gid_state *state;
-
-       req = tevent_req_create(mem_ctx, &state,
-                               struct winbindd_sid_to_gid_state);
-       if (req == NULL) {
-               return NULL;
-       }
-
-       /* Ensure null termination */
-       request->data.sid[sizeof(request->data.sid)-1]='\0';
-
-       DEBUG(3, ("sid to gid %s\n", request->data.sid));
-
-       if (!string_to_sid(&state->sid, request->data.sid)) {
-               DEBUG(1, ("Could not get convert sid %s from string\n",
-                         request->data.sid));
-               tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER);
-               return tevent_req_post(req, ev);
-       }
-
-       subreq = wb_sids2xids_send(state, ev, &state->sid, 1);
-       if (tevent_req_nomem(subreq, req)) {
-               return tevent_req_post(req, ev);
-       }
-       tevent_req_set_callback(subreq, winbindd_sid_to_gid_done, req);
-       return req;
-}
-
-static void winbindd_sid_to_gid_done(struct tevent_req *subreq)
-{
-       struct tevent_req *req = tevent_req_callback_data(
-               subreq, struct tevent_req);
-       struct winbindd_sid_to_gid_state *state = tevent_req_data(
-               req, struct winbindd_sid_to_gid_state);
-       NTSTATUS status;
-       struct unixid xids[1];
-
-       status = wb_sids2xids_recv(subreq, xids, ARRAY_SIZE(xids));
-       TALLOC_FREE(subreq);
-       if (tevent_req_nterror(req, status)) {
-               return;
-       }
-
-       /*
-        * We are filtering further down in sids2xids, but that filtering
-        * depends on the actual type of the sid handed in (as determined
-        * by lookupsids). Here we need to filter for the type of object
-        * actually requested, in this case gid.
-        */
-       if (!(xids[0].type == ID_TYPE_GID || xids[0].type == ID_TYPE_BOTH)) {
-               tevent_req_nterror(req, NT_STATUS_NONE_MAPPED);
-               return;
-       }
-
-       state->gid = (gid_t)xids[0].id;
-       tevent_req_done(req);
-}
-
-NTSTATUS winbindd_sid_to_gid_recv(struct tevent_req *req,
-                                 struct winbindd_response *response)
-{
-       struct winbindd_sid_to_gid_state *state = tevent_req_data(
-               req, struct winbindd_sid_to_gid_state);
-       NTSTATUS status;
-
-       if (tevent_req_is_nterror(req, &status)) {
-               DEBUG(5, ("Could not convert sid %s: %s\n",
-                         sid_string_dbg(&state->sid), nt_errstr(status)));
-               return status;
-       }
-       response->data.gid = state->gid;
-       return NT_STATUS_OK;
-}
index b8072bad53a6453b821f0f18739bccfa99c6e17e..ada41ac5e17aeef2704faf10c2a7f829f84faf39 100755 (executable)
@@ -944,7 +944,6 @@ bld.SAMBA3_BINARY('winbindd/winbindd',
                  winbindd/winbindd_lookupsid.c
                  winbindd/winbindd_lookupsids.c
                  winbindd/winbindd_lookupname.c
-                 winbindd/winbindd_sid_to_gid.c
                  winbindd/winbindd_uid_to_sid.c
                  winbindd/winbindd_gid_to_sid.c
                  winbindd/winbindd_sids_to_xids.c