[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Wed Jun 24 14:35:05 MDT 2015


The branch, master has been updated
       via  c31c300 s4-winbindd: Remove the winbind rewrite from the samba4 effort
       via  45b7992 Allow winbind removal by matching delays to Samba3.pm
       via  fb63fd1 s3:winbindd: remove unused argument 'server' from winbind_samlogon_retry_loop()
      from  0438027 auth: Explain why GSS_KRB5_CRED_NO_CI_FLAGS_X is needed

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit c31c30043bdb0b3736f81c4b391ec96f236bc227
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Fri Jun 12 14:41:20 2015 +1200

    s4-winbindd: Remove the winbind rewrite from the samba4 effort
    
    This winbind implementation is undermaintained, out of date and not the
    future of even the AD DC, let alone any other purpose.
    
    Removing it will reduce our security and bug exposure on this
    off by default subsystem
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Wed Jun 24 22:34:57 CEST 2015 on sn-devel-104

commit 45b7992428f646b8586974e1d86e3cdad869b059
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Fri Jun 19 16:49:41 2015 +1200

    Allow winbind removal by matching delays to Samba3.pm
    
    When using winbindd with the ntvfs file server, the responses are faster than
    they were in the past.  Therefore, set:
     posix:sharedelay = 100000
     posix:writetimeupdatedelay = 500000
    to the values used in Samba3.pm to allow the tests to pass against the NTVFS
    file server without the internal winbind.
    
    This allows the internal winbind to be removed.
    
    Andrew Bartlett
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit fb63fd1dc48b8ed3f714f93bab872bb907df52e1
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Jun 24 11:54:44 2015 +0200

    s3:winbindd: remove unused argument 'server' from winbind_samlogon_retry_loop()
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Guenther Deschner <gd at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 selftest/knownfail                     |   36 +-
 selftest/target/Samba4.pm              |   20 +-
 source3/winbindd/winbindd_pam.c        |    3 -
 source4/selftest/tests.py              |    2 +-
 source4/winbind/wb_cmd_getdcname.c     |  133 ---
 source4/winbind/wb_cmd_getgrent.c      |  124 ---
 source4/winbind/wb_cmd_getgrgid.c      |  181 ----
 source4/winbind/wb_cmd_getgrnam.c      |  174 ----
 source4/winbind/wb_cmd_getgroups.c     |  223 -----
 source4/winbind/wb_cmd_getpwent.c      |  125 ---
 source4/winbind/wb_cmd_getpwnam.c      |  208 ----
 source4/winbind/wb_cmd_getpwuid.c      |  213 -----
 source4/winbind/wb_cmd_list_groups.c   |  206 ----
 source4/winbind/wb_cmd_list_trustdom.c |  199 ----
 source4/winbind/wb_cmd_list_users.c    |  200 ----
 source4/winbind/wb_cmd_lookupname.c    |  121 ---
 source4/winbind/wb_cmd_lookupsid.c     |  120 ---
 source4/winbind/wb_cmd_setgrent.c      |  172 ----
 source4/winbind/wb_cmd_setpwent.c      |  177 ----
 source4/winbind/wb_cmd_userdomgroups.c |  148 ---
 source4/winbind/wb_cmd_usersids.c      |  197 ----
 source4/winbind/wb_connect_lsa.c       |  139 ---
 source4/winbind/wb_connect_sam.c       |  172 ----
 source4/winbind/wb_dom_info.c          |  164 ----
 source4/winbind/wb_dom_info_trusted.c  |  244 -----
 source4/winbind/wb_gid2sid.c           |  100 --
 source4/winbind/wb_init_domain.c       |  485 ----------
 source4/winbind/wb_irpc.c              |  143 ---
 source4/winbind/wb_name2domain.c       |  120 ---
 source4/winbind/wb_pam_auth.c          |  291 ------
 source4/winbind/wb_sam_logon.c         |  243 -----
 source4/winbind/wb_samba3_cmd.c        | 1619 --------------------------------
 source4/winbind/wb_samba3_protocol.c   |  377 --------
 source4/winbind/wb_server.c            |  410 --------
 source4/winbind/wb_server.h            |  194 ----
 source4/winbind/wb_sid2domain.c        |  327 -------
 source4/winbind/wb_sid2gid.c           |  109 ---
 source4/winbind/wb_sid2uid.c           |  109 ---
 source4/winbind/wb_sids2xids.c         |   96 --
 source4/winbind/wb_uid2sid.c           |  102 --
 source4/winbind/wb_update_rodc_dns.c   |  233 -----
 source4/winbind/wb_xids2sids.c         |   93 --
 source4/winbind/winbindd.c             |    6 +-
 source4/winbind/wscript_build          |    9 -
 44 files changed, 20 insertions(+), 8747 deletions(-)
 delete mode 100644 source4/winbind/wb_cmd_getdcname.c
 delete mode 100644 source4/winbind/wb_cmd_getgrent.c
 delete mode 100644 source4/winbind/wb_cmd_getgrgid.c
 delete mode 100644 source4/winbind/wb_cmd_getgrnam.c
 delete mode 100644 source4/winbind/wb_cmd_getgroups.c
 delete mode 100644 source4/winbind/wb_cmd_getpwent.c
 delete mode 100644 source4/winbind/wb_cmd_getpwnam.c
 delete mode 100644 source4/winbind/wb_cmd_getpwuid.c
 delete mode 100644 source4/winbind/wb_cmd_list_groups.c
 delete mode 100644 source4/winbind/wb_cmd_list_trustdom.c
 delete mode 100644 source4/winbind/wb_cmd_list_users.c
 delete mode 100644 source4/winbind/wb_cmd_lookupname.c
 delete mode 100644 source4/winbind/wb_cmd_lookupsid.c
 delete mode 100644 source4/winbind/wb_cmd_setgrent.c
 delete mode 100644 source4/winbind/wb_cmd_setpwent.c
 delete mode 100644 source4/winbind/wb_cmd_userdomgroups.c
 delete mode 100644 source4/winbind/wb_cmd_usersids.c
 delete mode 100644 source4/winbind/wb_connect_lsa.c
 delete mode 100644 source4/winbind/wb_connect_sam.c
 delete mode 100644 source4/winbind/wb_dom_info.c
 delete mode 100644 source4/winbind/wb_dom_info_trusted.c
 delete mode 100644 source4/winbind/wb_gid2sid.c
 delete mode 100644 source4/winbind/wb_init_domain.c
 delete mode 100644 source4/winbind/wb_irpc.c
 delete mode 100644 source4/winbind/wb_name2domain.c
 delete mode 100644 source4/winbind/wb_pam_auth.c
 delete mode 100644 source4/winbind/wb_sam_logon.c
 delete mode 100644 source4/winbind/wb_samba3_cmd.c
 delete mode 100644 source4/winbind/wb_samba3_protocol.c
 delete mode 100644 source4/winbind/wb_server.c
 delete mode 100644 source4/winbind/wb_server.h
 delete mode 100644 source4/winbind/wb_sid2domain.c
 delete mode 100644 source4/winbind/wb_sid2gid.c
 delete mode 100644 source4/winbind/wb_sid2uid.c
 delete mode 100644 source4/winbind/wb_sids2xids.c
 delete mode 100644 source4/winbind/wb_uid2sid.c
 delete mode 100644 source4/winbind/wb_update_rodc_dns.c
 delete mode 100644 source4/winbind/wb_xids2sids.c


Changeset truncated at 500 lines:

diff --git a/selftest/knownfail b/selftest/knownfail
index 5ce3d97..2bf7aec 100644
--- a/selftest/knownfail
+++ b/selftest/knownfail
@@ -239,20 +239,12 @@
 ^samba3.rpc.netlogon.admin.*.LogonControl2\(ad_dc\)
 ^samba3.rpc.netlogon.admin.*.LogonControl\(ad_dc\)
 #
-# The Samba4 winbind does not cover the full winbind protocol, so these are expected
-#
-^samba.blackbox.wbinfo\(ad_dc_ntvfs:local\).wbinfo -N against ad_dc_ntvfs
-^samba.blackbox.wbinfo\(ad_dc_ntvfs:local\).wbinfo -I against ad_dc_ntvfs
-^samba.blackbox.wbinfo\(ad_dc_ntvfs:local\).wbinfo  --trusted-domains against ad_dc_ntvfs
-^samba.blackbox.wbinfo\(ad_dc_ntvfs:local\).wbinfo --all-domains against ad_dc_ntvfs
-#
 # This makes less sense when not running against an AD DC
 #
 ^samba.blackbox.wbinfo\(ad_member:local\).wbinfo -U against ad_member
 ^samba.blackbox.wbinfo\(ad_member:local\).wbinfo -G against ad_member
 ^samba.blackbox.wbinfo\(ad_member:local\).wbinfo -U check for sane mapping
 ^samba.blackbox.wbinfo\(ad_member:local\).wbinfo -G check for sane mapping
-^samba4.winbind.struct.show_sequence\(ad_dc_ntvfs:local\)
 ^samba.wbinfo_simple.\(ad_dc_ntvfs:local\).--allocate-uid
 ^samba.wbinfo_simple.\(ad_dc_ntvfs:local\).--allocate-gid
 ^samba.wbinfo_simple.\(s4member:local\).--allocate-uid
@@ -288,38 +280,14 @@
 ^samba3.local.nss.reentrant enumeration\(ad_member:local\)
 ^samba3.local.nss.enumeration\(ad_member:local\)
 #
-# These just happen to fail for some reason (probably because they run against the s4 winbind)
-#
-^samba4.winbind.struct.getdcname\(ad_member:local\)
-^samba4.winbind.struct.lookup_name_sid\(ad_member:local\)
-^samba4.winbind.struct.lookup_name_sid\(ad_dc_ntvfs:local\)
-^samba4.winbind.struct.list_trustdom\(ad_dc_ntvfs:local\)
-^samba4.winbind.struct.domain_info\(ad_dc_ntvfs:local\)
-^samba4.winbind.struct.getdcname\(ad_dc_ntvfs:local\)
-^samba4.winbind.struct.dsgetdcname\(ad_dc_ntvfs:local\)
-^samba.wbinfo_simple.\(ad_dc_ntvfs:local\).--all-domains.wbinfo\(ad_dc_ntvfs:local\)
-^samba.wbinfo_simple.\(ad_dc_ntvfs:local\).--trusted-domains.wbinfo\(ad_dc_ntvfs:local\)
-^samba.wbinfo_simple.\(ad_dc_ntvfs:local\).--online-status.wbinfo\(ad_dc_ntvfs:local\)
-^samba.wbinfo_simple.\(ad_dc_ntvfs:local\).--online-status --domain=BUILTIN.wbinfo\(ad_dc_ntvfs:local\)
-^samba.wbinfo_simple.\(ad_dc_ntvfs:local\).--online-status --domain=SAMBADOMAIN.wbinfo\(ad_dc_ntvfs:local\)
-^samba.wbinfo_simple.\(ad_dc_ntvfs:local\).--change-secret --domain=SAMBADOMAIN.wbinfo\(ad_dc_ntvfs:local\)
-^samba.wbinfo_simple.\(ad_dc_ntvfs:local\).--online-status --domain=SAMBADOMAIN.wbinfo\(ad_dc_ntvfs:local\)
-^samba.blackbox.wbinfo\(ad_dc_ntvfs:local\).wbinfo -I against ad_dc_ntvfs\(ad_dc_ntvfs:local\)
-^samba.blackbox.wbinfo\(ad_dc_ntvfs:local\).wbinfo  --trusted-domains against ad_dc_ntvfs\(ad_dc_ntvfs:local\)
-^samba.blackbox.wbinfo\(ad_dc_ntvfs:local\).wbinfo --all-domains against ad_dc_ntvfs\(ad_dc_ntvfs:local\)
-#
-# This will fail against the NTVFS DC, because it requires functionality only in winbindd
-#
-^samba4.winbind.pac.*\(ad_dc_ntvfs:local\) # Not implemented
-#
 # These do not work against winbindd in member mode for unknown reasons
 #
 ^samba.blackbox.wbinfo\(ad_member:local\).wbinfo -U against ad_member\(ad_member:local\)
 ^samba.blackbox.wbinfo\(ad_member:local\).wbinfo -U check for sane mapping\(ad_member:local\)
 ^samba.blackbox.wbinfo\(ad_member:local\).wbinfo -G against ad_member\(ad_member:local\)
 ^samba.blackbox.wbinfo\(ad_member:local\).wbinfo -G check for sane mapping\(ad_member:local\)
-^samba.ntlm_auth.\(ad_dc_ntvfs:local\).ntlm_auth against winbindd with failed require-membership-of
-^samba.ntlm_auth.\(ad_dc_ntvfs:local\).ntlm_auth with NTLMSSP gss-spnego-client and gss-spnego server against winbind with failed require-membership-of
+^samba4.winbind.struct.getdcname\(ad_member:local\)
+^samba4.winbind.struct.lookup_name_sid\(ad_member:local\)
 ^samba4.winbind.struct.getdcname\(nt4_member:local\) # Works in other modes, just not against the classic/NT4 DC
 #
 # Differences in our KDC compared to windows
diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm
index 32114c3..ae7eb23 100755
--- a/selftest/target/Samba4.pm
+++ b/selftest/target/Samba4.pm
@@ -925,16 +925,16 @@ sub provision($$$$$$$$$$)
 [tmp]
 	path = $ctx->{share}
 	read only = no
-	posix:sharedelay = 10000
+	posix:sharedelay = 100000
 	posix:oplocktimeout = 3
-	posix:writetimeupdatedelay = 50000
+	posix:writetimeupdatedelay = 500000
 
 [xcopy_share]
 	path = $ctx->{share}
 	read only = no
-	posix:sharedelay = 10000
+	posix:sharedelay = 100000
 	posix:oplocktimeout = 3
-	posix:writetimeupdatedelay = 50000
+	posix:writetimeupdatedelay = 500000
 	create mask = 777
 	force create mode = 777
 
@@ -949,16 +949,16 @@ sub provision($$$$$$$$$$)
 [test1]
 	path = $ctx->{share}/test1
 	read only = no
-	posix:sharedelay = 10000
+	posix:sharedelay = 100000
 	posix:oplocktimeout = 3
-	posix:writetimeupdatedelay = 50000
+	posix:writetimeupdatedelay = 500000
 
 [test2]
 	path = $ctx->{share}/test2
 	read only = no
-	posix:sharedelay = 10000
+	posix:sharedelay = 100000
 	posix:oplocktimeout = 3
-	posix:writetimeupdatedelay = 50000
+	posix:writetimeupdatedelay = 500000
 
 [cifs]
 	path = $ctx->{share}/_ignore_cifs_
@@ -1432,6 +1432,10 @@ sub provision_ad_dc_ntvfs($$)
 {
 	my ($self, $prefix) = @_;
 
+	# We keep the old 'winbind' name here in server services to
+	# ensure upgrades which used that name still work with the now
+	# alias.
+
 	print "PROVISIONING AD DC (NTVFS)...";
         my $extra_conf_options = "netbios aliases = localDC1-a
         server services = +winbind -winbindd";
diff --git a/source3/winbindd/winbindd_pam.c b/source3/winbindd/winbindd_pam.c
index a274d4f..329db62 100644
--- a/source3/winbindd/winbindd_pam.c
+++ b/source3/winbindd/winbindd_pam.c
@@ -1313,7 +1313,6 @@ static NTSTATUS winbindd_dual_auth_passdb(TALLOC_CTX *mem_ctx,
 static NTSTATUS winbind_samlogon_retry_loop(struct winbindd_domain *domain,
 					    TALLOC_CTX *mem_ctx,
 					    uint32_t logon_parameters,
-					    const char *server,
 					    const char *username,
 					    const char *password,
 					    const char *domainname,
@@ -1553,7 +1552,6 @@ static NTSTATUS winbindd_dual_pam_auth_samlogon(TALLOC_CTX *mem_ctx,
 	result = winbind_samlogon_retry_loop(domain,
 					     mem_ctx,
 					     0,
-					     domain->dcname,
 					     name_user,
 					     pass,
 					     name_domain,
@@ -1966,7 +1964,6 @@ NTSTATUS winbind_dual_SamLogon(struct winbindd_domain *domain,
 	result = winbind_samlogon_retry_loop(domain,
 					     mem_ctx,
 					     logon_parameters,
-					     domain->dcname,
 					     name_user,
 					     NULL, /* password */
 					     name_domain,
diff --git a/source4/selftest/tests.py b/source4/selftest/tests.py
index 070586d..ff675ba 100755
--- a/source4/selftest/tests.py
+++ b/source4/selftest/tests.py
@@ -232,7 +232,7 @@ for t in nbt_tests:
     plansmbtorture4testsuite(t, "ad_dc_ntvfs", "//$SERVER/_none_ -U\"$USERNAME%$PASSWORD\"")
 
 # Tests against the NTVFS POSIX backend
-ntvfsargs = ["--option=torture:sharedelay=10000", "--option=torture:oplocktimeout=3", "--option=torture:writetimeupdatedelay=50000"]
+ntvfsargs = ["--option=torture:sharedelay=100000", "--option=torture:oplocktimeout=3", "--option=torture:writetimeupdatedelay=500000"]
 
 smb2 = smbtorture4_testsuites("smb2.")
 #The QFILEINFO-IPC test needs to be on ipc$
diff --git a/source4/winbind/wb_cmd_getdcname.c b/source4/winbind/wb_cmd_getdcname.c
deleted file mode 100644
index f3c2482..0000000
--- a/source4/winbind/wb_cmd_getdcname.c
+++ /dev/null
@@ -1,133 +0,0 @@
-/* 
-   Unix SMB/CIFS implementation.
-
-   Command backend for wbinfo --getdcname
-
-   Copyright (C) Volker Lendecke 2005
-   
-   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 "libcli/composite/composite.h"
-#include "winbind/wb_server.h"
-#include "smbd/service_task.h"
-
-#include "librpc/gen_ndr/ndr_netlogon_c.h"
-
-struct cmd_getdcname_state {
-	struct composite_context *ctx;
-	const char *domain_name;
-
-	struct netr_GetAnyDCName g;
-};
-
-static void getdcname_recv_domain(struct composite_context *ctx);
-static void getdcname_recv_dcname(struct tevent_req *subreq);
-
-struct composite_context *wb_cmd_getdcname_send(TALLOC_CTX *mem_ctx,
-						struct wbsrv_service *service,
-						const char *domain_name)
-{
-	struct composite_context *result, *ctx;
-	struct cmd_getdcname_state *state;
-
-	result = composite_create(mem_ctx, service->task->event_ctx);
-	if (result == NULL) goto failed;
-
-	state = talloc(result, struct cmd_getdcname_state);
-	if (state == NULL) goto failed;
-	state->ctx = result;
-	result->private_data = state;
-
-	state->domain_name = talloc_strdup(state, domain_name);
-	if (state->domain_name == NULL) goto failed;
-
-	ctx = wb_sid2domain_send(state, service, service->primary_sid);
-	if (ctx == NULL) goto failed;
-
-	ctx->async.fn = getdcname_recv_domain;
-	ctx->async.private_data = state;
-	return result;
-
- failed:
-	talloc_free(result);
-	return NULL;
-}
-
-static void getdcname_recv_domain(struct composite_context *ctx)
-{
-	struct cmd_getdcname_state *state =
-		talloc_get_type(ctx->async.private_data,
-				struct cmd_getdcname_state);
-	struct wbsrv_domain *domain;
-	struct tevent_req *subreq;
-
-	state->ctx->status = wb_sid2domain_recv(ctx, &domain);
-	if (!composite_is_ok(state->ctx)) return;
-
-	state->g.in.logon_server = talloc_asprintf(
-		state, "\\\\%s",
-		dcerpc_server_name(domain->netlogon_pipe));
-	state->g.in.domainname = state->domain_name;
-	state->g.out.dcname = talloc(state, const char *);
-
-	subreq = dcerpc_netr_GetAnyDCName_r_send(state,
-						 state->ctx->event_ctx,
-						 domain->netlogon_pipe->binding_handle,
-						 &state->g);
-	if (composite_nomem(subreq, state->ctx)) return;
-
-	tevent_req_set_callback(subreq, getdcname_recv_dcname, state);
-}
-
-static void getdcname_recv_dcname(struct tevent_req *subreq)
-{
-	struct cmd_getdcname_state *state =
-		tevent_req_callback_data(subreq,
-		struct cmd_getdcname_state);
-
-	state->ctx->status = dcerpc_netr_GetAnyDCName_r_recv(subreq, state);
-	TALLOC_FREE(subreq);
-	if (!composite_is_ok(state->ctx)) return;
-	state->ctx->status = werror_to_ntstatus(state->g.out.result);
-	if (!composite_is_ok(state->ctx)) return;
-
-	composite_done(state->ctx);
-}
-
-NTSTATUS wb_cmd_getdcname_recv(struct composite_context *c,
-			       TALLOC_CTX *mem_ctx,
-			       const char **dcname)
-{
-	struct cmd_getdcname_state *state =
-		talloc_get_type(c->private_data, struct cmd_getdcname_state);
-	NTSTATUS status = composite_wait(c);
-	if (NT_STATUS_EQUAL(status, NT_STATUS_NO_SUCH_DOMAIN)) {
-		/* special case: queried DC is PDC */
-		state->g.out.dcname = &state->g.in.logon_server;
-		status = NT_STATUS_OK;
-	}
-	if (NT_STATUS_IS_OK(status)) {
-		const char *p = *(state->g.out.dcname);
-		if (*p == '\\') p += 1;
-		if (*p == '\\') p += 1;
-		*dcname = talloc_strdup(mem_ctx, p);
-		if (*dcname == NULL) {
-			status = NT_STATUS_NO_MEMORY;
-		}
-	}
-	talloc_free(state);
-	return status;
-}
diff --git a/source4/winbind/wb_cmd_getgrent.c b/source4/winbind/wb_cmd_getgrent.c
deleted file mode 100644
index 79a3aff..0000000
--- a/source4/winbind/wb_cmd_getgrent.c
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
-   Unix SMB/CIFS implementation.
-
-   Command backend for getgrent
-
-   Copyright (C) Matthieu Patou 2010
-
-   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 "libcli/composite/composite.h"
-#include "winbind/wb_server.h"
-#include "smbd/service_task.h"
-
-struct cmd_getgrent_state {
-	struct composite_context *ctx;
-	struct wbsrv_service *service;
-
-	struct wbsrv_grent *grent;
-	uint32_t max_groups;
-
-	uint32_t num_groups;
-	struct winbindd_gr *result;
-};
-
-static void cmd_getgrent_recv_grnam(struct composite_context *ctx);
-#if 0 /*FIXME: implement this*/
-static void cmd_getgrent_recv_user_list(struct composite_context *ctx);
-#endif
-
-struct composite_context *wb_cmd_getgrent_send(TALLOC_CTX *mem_ctx,
-		struct wbsrv_service *service, struct wbsrv_grent *grent,
-		uint32_t max_groups)
-{
-	struct composite_context *ctx, *result;
-	struct cmd_getgrent_state *state;
-
-	DEBUG(5, ("wb_cmd_getgrent_send called\n"));
-
-	result = composite_create(mem_ctx, service->task->event_ctx);
-	if (!result) return NULL;
-
-	state = talloc(mem_ctx, struct cmd_getgrent_state);
-	if (composite_nomem(state, result)) return result;
-
-	state->ctx = result;
-	result->private_data = state;
-	state->service = service;
-	state->grent = grent;
-	state->max_groups = max_groups;
-	state->num_groups = 0;
-
-	/* If there are groups left in the libnet_GroupList and we're below the
-	 * maximum number of groups to get per winbind getgrent call, use
-	 * getgrnam to get the winbindd_gr struct */
-	if (grent->page_index < grent->group_list->out.count) {
-		int idx = grent->page_index;
-		char *groupname = talloc_strdup(state,
-			grent->group_list->out.groups[idx].groupname);
-
-		grent->page_index++;
-		ctx = wb_cmd_getgrnam_send(state, service, groupname);
-		if (composite_nomem(ctx, state->ctx)) return result;
-
-		composite_continue(state->ctx, ctx, cmd_getgrent_recv_grnam,
-			state);
-	} else {
-	/* If there is no valid group left, call libnet_GroupList to get a new
-	 * list of group. */
-		composite_error(state->ctx, NT_STATUS_NO_MORE_ENTRIES);
-	}
-	return result;
-}
-
-static void cmd_getgrent_recv_grnam(struct composite_context *ctx)
-{
-	struct cmd_getgrent_state *state =
-		talloc_get_type(ctx->async.private_data,
-				struct cmd_getgrent_state);
-	struct winbindd_gr *gr;
-
-	DEBUG(5, ("cmd_getgrent_recv_grnam called\n"));
-
-	state->ctx->status = wb_cmd_getgrnam_recv(ctx, state, &gr);
-	if (!composite_is_ok(state->ctx)) return;
-
-	/*FIXME: Cheat for now and only get one group per call */
-	state->result = gr;
-
-	composite_done(state->ctx);
-}
-
-NTSTATUS wb_cmd_getgrent_recv(struct composite_context *ctx,
-		TALLOC_CTX *mem_ctx, struct winbindd_gr **gr,
-		uint32_t *num_groups)
-{
-	NTSTATUS status = composite_wait(ctx);
-
-	DEBUG(5, ("wb_cmd_getgrent_recv called\n"));
-
-	if (NT_STATUS_IS_OK(status)) {
-		struct cmd_getgrent_state *state =
-			talloc_get_type(ctx->private_data,
-					struct cmd_getgrent_state);
-		*gr = talloc_steal(mem_ctx, state->result);
-		/*FIXME: Cheat and only get one group */
-		*num_groups = 1;
-	}
-
-	talloc_free(ctx);
-	return status;
-}
diff --git a/source4/winbind/wb_cmd_getgrgid.c b/source4/winbind/wb_cmd_getgrgid.c
deleted file mode 100644
index 8ca93db..0000000
--- a/source4/winbind/wb_cmd_getgrgid.c
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
-   Unix SMB/CIFS implementation.
-
-   Backend for getgrgid
-
-   Copyright (C) Kai Blin 2007
-
-   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 "libcli/composite/composite.h"
-#include "winbind/wb_server.h"
-#include "smbd/service_task.h"
-#include "param/param.h"
-
-struct cmd_getgrgid_state {
-	struct composite_context *ctx;
-	struct wbsrv_service *service;
-	gid_t gid;
-	struct dom_sid *sid;
-	char *workgroup;
-	struct wbsrv_domain *domain;
-
-	struct winbindd_gr *result;
-};
-
-static void cmd_getgrgid_recv_sid(struct composite_context *ctx);
-static void cmd_getgrgid_recv_domain(struct composite_context *ctx);
-static void cmd_getgrgid_recv_group_info(struct composite_context *ctx);
-
-/* Get the SID using the gid */
-
-struct composite_context *wb_cmd_getgrgid_send(TALLOC_CTX *mem_ctx,
-						 struct wbsrv_service *service,
-						 gid_t gid)
-{
-	struct composite_context *ctx, *result;
-	struct cmd_getgrgid_state *state;
-
-	DEBUG(5, ("wb_cmd_getgrgid_send called\n"));
-
-	result = composite_create(mem_ctx, service->task->event_ctx);
-	if (!result) return NULL;
-
-	state = talloc(result, struct cmd_getgrgid_state);
-	if (composite_nomem(state, result)) return result;
-	state->ctx = result;
-	result->private_data = state;
-	state->service = service;


-- 
Samba Shared Repository


More information about the samba-cvs mailing list