[SCM] Samba Shared Repository - branch master updated

Andrew Bartlett abartlet at samba.org
Sun May 8 12:04:03 MDT 2011


The branch, master has been updated
       via  5def7a1 s4-selftest Add tests for proxy_samba4_dc
       via  f4d9b40 selftest: Make the ncalrpc dir common between Samba4 and Samba3.
       via  aae9353 ncalrpc: Force ncalrpc dir to be mode 755 in all users
       via  eae0612 selftest: Add plugin_s4_dc environment
       via  f52c6ee s3-auth Add auth_samba4 module
       via  a47c7f6 s3-passdb: added pdb_samba4
       via  25cfa29 s3-passdb Redirect domain GUID and SID queries to the passdb stack
       via  5d2ce40 s4-dsdb Add transactions to dsdb modify helpers
       via  8882dab s4-samr Remove incorrect transaction_cancel() in error path
       via  ac82ac4 s4-param cope with doulbe-parsing of -foo and +foo lists
       via  d1df1cb build: Allow the C code to know if this is a waf build
      from  c596d85 s4-interfaces: keep interfaces in the order they were declared

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


- Log -----------------------------------------------------------------
commit 5def7a1e5ef98d215d1e618b4e8fd9c5839c6e1e
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Sun May 8 15:26:28 2011 +0200

    s4-selftest Add tests for proxy_samba4_dc
    
    Autobuild-User: Andrew Bartlett <abartlet at samba.org>
    Autobuild-Date: Sun May  8 20:03:45 CEST 2011 on sn-devel-104

commit f4d9b40d7ff8f9e79972294c9dce2a52a67df24f
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Sun May 8 10:32:01 2011 +0200

    selftest: Make the ncalrpc dir common between Samba4 and Samba3.
    
    This also avoids creating the directory, as the startup routines will
    create it with the correct permissions.
    
    Andrew Bartlett

commit aae9353ecf56323b63da66aa84d8a0a4f219d94d
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Sun May 8 10:29:27 2011 +0200

    ncalrpc: Force ncalrpc dir to be mode 755 in all users
    
    This allows this directory to be shared between Samba3 and Samba4 in a
    Franky-style setup easily.
    
    Andrew Bartlett

commit eae061293bad97e6e70526b4e755ca69c02d0ae9
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Sun May 8 06:55:33 2011 +0200

    selftest: Add plugin_s4_dc environment
    
    This environment uses pdb_samba4 and auth_samba4 to plug these
    critical subsystems into a mixed Samba3/Samba4 DC, in a similar way to
    the 'Franky' proposal.
    
    Andrew Barltett

commit f52c6eeacc1131fca6656d07eca035668423b008
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Sun May 8 14:48:11 2011 +0200

    s3-auth Add auth_samba4 module
    
    This module makes a direct call into the Samba4 auth stack to
    authenticate Samba4 uses in a Samba3 file server.  The direct call
    avoids the need to obtain schannel credentials.
    
    Andrew Bartlett
    
    Pair-Programmed-With: Andrew Tridgell <tridge at samba.org>

commit a47c7f6b4cfc8ce271cfd5addbf8f901d9ab3c6e
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Sat May 7 00:50:04 2011 +1000

    s3-passdb: added pdb_samba4
    
    This uses direct LDB operations and calls to the dsdb library to allow
    passdb operations (such as pdbedit and smbpasswd) offline, and uses
    transactions internally for database consistency.
    
    Pair-Programmed-With: Andrew Tridgell <tridge at samba.org>

commit 25cfa29e29bdbb6c84bd85ea02ec542228ae585f
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Sun May 8 12:52:06 2011 +0200

    s3-passdb Redirect domain GUID and SID queries to the passdb stack
    
    This is done if the passdb module supports PDB_ADS, and ensures that a
    random SID is never made up locally for these directories.
    
    This is only enabled when in the waf build, due to dependency issues.
    
    Andrew Bartlett

commit 5d2ce400d2324e58861b696a02582d2858d1b25b
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Sun May 8 15:56:58 2011 +0200

    s4-dsdb Add transactions to dsdb modify helpers

commit 8882dab93e65bb20618ed1dbbd2279f1e3bdc9cb
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Sun May 8 15:24:57 2011 +0200

    s4-samr Remove incorrect transaction_cancel() in error path
    
    The transactions are now handled entirely within dsdb_add_user()
    
    Andrew Bartlett

commit ac82ac4b83d3910734943bbc4caba5ef1efefe06
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Sun May 8 06:58:19 2011 +0200

    s4-param cope with doulbe-parsing of -foo and +foo lists
    
    For some reason these lists are parsed twice, and so any -foo was
    failing as it was already removed the first time.
    
    Andrew Bartlett

commit d1df1cb714289b90dc173a72e488773960952402
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Sun May 8 17:35:05 2011 +0200

    build: Allow the C code to know if this is a waf build
    
    This allows addition of functionality that can't be handled (for
    example, due to dependencies) in the autoconf build.
    
    Andrew Bartlett

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

Summary of changes:
 selftest/target/Samba3.pm                |   60 +-
 selftest/target/Samba4.pm                |   57 +-
 source3/auth/auth_samba4.c               |  132 ++
 source3/auth/wscript_build               |    9 +
 source3/passdb/machine_account_secrets.c |   58 +
 source3/passdb/pdb_samba4.c              | 2113 ++++++++++++++++++++++++++++++
 source3/passdb/wscript_build             |   10 +
 source3/rpc_server/rpc_server.c          |    4 +-
 source3/wscript                          |    4 +
 source4/dsdb/common/util_samr.c          |   18 +
 source4/param/loadparm.c                 |   12 +-
 source4/rpc_server/samr/dcesrv_samr.c    |    1 -
 source4/selftest/tests.py                |    1 +
 source4/smbd/service_named_pipe.c        |    7 +
 wscript                                  |    1 +
 15 files changed, 2476 insertions(+), 11 deletions(-)
 create mode 100644 source3/auth/auth_samba4.c
 create mode 100644 source3/passdb/pdb_samba4.c


Changeset truncated at 500 lines:

diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm
index a563653..e99498b 100644
--- a/selftest/target/Samba3.pm
+++ b/selftest/target/Samba3.pm
@@ -269,6 +269,56 @@ sub setup_admember($$$$)
 	return $ret;
 }
 
+sub setup_plugin_s4_dc($$$$)
+{
+	my ($self, $prefix, $dcvars, $iface) = @_;
+
+	print "PROVISIONING S4 PLUGIN AD DC$iface...";
+
+	my $plugin_s4_dc_options = "
+        workgroup = $dcvars->{DOMAIN}
+        realm = $dcvars->{REALM}
+        security=ads
+        passdb backend = samba4
+        auth methods = guest samba4
+        domain logons = yes
+        rpc_server:lsarpc = external
+        rpc_server:netlogon = external
+        rpc_server:samr = external
+	server signing = on
+";
+
+	my $ret = $self->provision($prefix,
+				   "plugindc",
+				   $iface,
+				   "pluGin${iface}Pass",
+				   $plugin_s4_dc_options, 1);
+
+	$ret or return undef;
+
+	close(USERMAP);
+	$ret->{DOMAIN} = $dcvars->{DOMAIN};
+	$ret->{REALM} = $dcvars->{REALM};
+	$ret->{KRB5_CONFIG} = $dcvars->{KRB5_CONFIG};
+	$ret->{DC_USERNAME} = $dcvars->{USERNAME};
+	$ret->{DC_PASSWORD} = $dcvars->{PASSWORD};
+
+	# We need world access to this share, as otherwise the domain
+	# administrator from the AD domain provided by Samba4 can't
+	# access the share for tests.
+	chmod 0777, "$prefix/share";
+
+	$self->check_or_start($ret,
+			      "no", "yes", "yes");
+
+	$self->wait_for_start($ret);
+
+	# Special case, this is called from Samba4.pm but needs to use the Samba3 check_env and get_log_env
+	$ret->{target} = $self;
+
+	return $ret;
+}
+
 sub setup_secshare($$)
 {
 	my ($self, $path) = @_;
@@ -584,9 +634,9 @@ sub check_or_start($$$$) {
 	return 0;
 }
 
-sub provision($$$$$$)
+sub provision($$$$$$$)
 {
-	my ($self, $prefix, $server, $swiface, $password, $extra_options) = @_;
+	my ($self, $prefix, $server, $swiface, $password, $extra_options, $no_delete_prefix) = @_;
 
 	##
 	## setup the various environment variables we need
@@ -664,7 +714,9 @@ sub provision($$$$$$)
 
 	mkdir($prefix_abs, 0777);
 	print "CREATE TEST ENVIRONMENT IN '$prefix'...";
-	system("rm -rf $prefix_abs/*");
+	if (not defined($no_delete_prefix) or not $no_delete_prefix) {
+	    system("rm -rf $prefix_abs/*");
+	}
 	mkdir($_, 0777) foreach(@dirs);
 
 	##
@@ -811,7 +863,7 @@ sub provision($$$$$$)
 	queue resume command = $bindir_abs/vlp tdbfile=$lockdir/vlp.tdb queueresume %p
 	lpq cache time = 0
 
-	ncalrpc dir = $lockdir/ncalrpc
+	ncalrpc dir = $prefix_abs/ncalrpc
 	rpc_server:epmapper = embedded
 
         resolv:host file = $dns_host_file
diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm
index 84ef576..bbe64a9 100644
--- a/selftest/target/Samba4.pm
+++ b/selftest/target/Samba4.pm
@@ -522,7 +522,6 @@ sub provision_raw_prepare($$$$$$$$$$)
 	push(@{$ctx->{directories}}, $ctx->{privatedir});
 	push(@{$ctx->{directories}}, $ctx->{etcdir});
 	push(@{$ctx->{directories}}, $ctx->{piddir});
-	push(@{$ctx->{directories}}, $ctx->{ncalrpcdir});
 	push(@{$ctx->{directories}}, $ctx->{lockdir});
 
 	$ctx->{smb_conf_extra_options} = "";
@@ -1157,6 +1156,40 @@ sub provision_rodc($$$)
 	return $ret;
 }
 
+sub provision_plugin_s4_dc($$)
+{
+	my ($self, $prefix) = @_;
+
+	my $extra_smbconf_options = "
+server services = -winbind, -smb
+";
+
+	print "PROVISIONING PLUGIN S4 DC...";
+	my $ret = $self->provision($prefix,
+				   "domain controller",
+				   "plugindc",
+				   "PLUGINDOMAIN",
+				   "plugin.samba.example.com",
+				   "2008",
+				   30,
+				   "locDCpass1",
+				   undef, $extra_smbconf_options);
+
+	return undef unless(defined $ret);
+	unless($self->add_wins_config("$prefix/private")) {
+		warn("Unable to add wins configuration");
+		return undef;
+	}
+
+	$ret->{DC_SERVER} = $ret->{SERVER};
+	$ret->{DC_SERVER_IP} = $ret->{SERVER_IP};
+	$ret->{DC_NETBIOSNAME} = $ret->{NETBIOSNAME};
+	$ret->{DC_USERNAME} = $ret->{USERNAME};
+	$ret->{DC_PASSWORD} = $ret->{PASSWORD};
+
+	return $ret;
+}
+
 sub teardown_env($$)
 {
 	my ($self, $envvars) = @_;
@@ -1261,6 +1294,8 @@ sub setup_env($$$)
 			$self->setup_dc("$path/dc");
 		}
 		return $target3->setup_admember("$path/s3member", $self->{vars}->{dc}, 29);
+	} elsif ($envname eq "plugin_s4_dc") {
+		return $self->setup_plugin_s4_dc("$path/plugin_s4_dc");
 	} elsif ($envname eq "all") {
 		if (not defined($self->{vars}->{dc})) {
 			$ENV{ENVNAME} = "dc";
@@ -1491,4 +1526,24 @@ sub setup_rodc($$$)
 	return $env;
 }
 
+sub setup_plugin_s4_dc($$)
+{
+	my ($self, $path) = @_;
+
+	my $env = $self->provision_plugin_s4_dc($path);
+	if (defined $env) {
+		$self->check_or_start($env);
+
+		$self->wait_for_start($env);
+
+		my $s3_part_env = $self->{target3}->setup_plugin_s4_dc($path, $env, 30);
+		if (not defined($s3_part_env)) {
+		    return undef;
+		}
+
+		$self->{vars}->{plugin_s4_dc} = $s3_part_env;
+	}
+	return $env;
+}
+
 1;
diff --git a/source3/auth/auth_samba4.c b/source3/auth/auth_samba4.c
new file mode 100644
index 0000000..57c07dd
--- /dev/null
+++ b/source3/auth/auth_samba4.c
@@ -0,0 +1,132 @@
+/*
+   Unix SMB/CIFS implementation.
+   Authenticate against Samba4's auth subsystem
+   Copyright (C) Volker Lendecke 2008
+   Copyright (C) Andrew Bartlett 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 "source3/include/auth.h"
+#include "source4/auth/auth.h"
+#include "auth/auth_sam_reply.h"
+#include "param/param.h"
+#include "source4/lib/events/events.h"
+
+#undef DBGC_CLASS
+#define DBGC_CLASS DBGC_AUTH
+
+static NTSTATUS check_samba4_security(const struct auth_context *auth_context,
+				      void *my_private_data,
+				      TALLOC_CTX *mem_ctx,
+				      const struct auth_usersupplied_info *user_info,
+				      struct auth_serversupplied_info **server_info)
+{
+	TALLOC_CTX *frame = talloc_stackframe();
+	struct netr_SamInfo3 *info3 = NULL;
+	NTSTATUS nt_status;
+	struct auth_user_info_dc *user_info_dc;
+	struct auth4_context *auth4_context;
+	struct loadparm_context *lp_ctx;
+	const char *config_file;
+
+	lp_ctx = loadparm_init(frame);
+	if (lp_ctx == NULL) {
+		DEBUG(10, ("loadparm_init failed\n"));
+		talloc_free(frame);
+		return NT_STATUS_INVALID_SERVER_STATE;
+	}
+
+	if (lp_loaded()) {
+		config_file = lp_configfile();
+	}
+	if (!config_file || !config_file[0]) {
+		config_file = get_dyn_CONFIGFILE();
+	}
+
+	if (!lpcfg_load(lp_ctx, config_file)) {
+		DEBUG(1, ("s4 lpcfg_load() of s3 config file %s failed", config_file));
+		talloc_free(frame);
+		return NT_STATUS_INVALID_SERVER_STATE;
+	}
+
+	/* We create a private tevent context here to avoid nested loops in
+	 * the s3 one, as that may not be expected */
+	nt_status = auth_context_create(mem_ctx,
+					s4_event_context_init(frame), NULL, 
+					lp_ctx,
+					&auth4_context);
+	NT_STATUS_NOT_OK_RETURN(nt_status);
+		
+	nt_status = auth_context_set_challenge(auth4_context, auth_context->challenge.data, "auth_samba4");
+	NT_STATUS_NOT_OK_RETURN_AND_FREE(nt_status, auth4_context);
+
+	nt_status = auth_check_password(auth4_context, auth4_context, user_info, &user_info_dc);
+	NT_STATUS_NOT_OK_RETURN_AND_FREE(nt_status, auth4_context);
+	
+	nt_status = auth_convert_user_info_dc_saminfo3(mem_ctx,
+						       user_info_dc,
+						       &info3);
+	if (NT_STATUS_IS_OK(nt_status)) {
+		/* We need the strings from the server_info to be valid as long as the info3 is around */
+		talloc_steal(info3, user_info_dc);
+	}
+	talloc_free(auth4_context);
+
+	if (!NT_STATUS_IS_OK(nt_status)) {
+		goto done;
+	}
+
+	nt_status = make_server_info_info3(mem_ctx, user_info->client.account_name,
+					   user_info->mapped.domain_name, server_info,
+					info3);
+	if (!NT_STATUS_IS_OK(nt_status)) {
+		DEBUG(10, ("make_server_info_info3 failed: %s\n",
+			   nt_errstr(nt_status)));
+		TALLOC_FREE(frame);
+		return nt_status;
+	}
+
+	nt_status = NT_STATUS_OK;
+
+ done:
+	TALLOC_FREE(frame);
+	return nt_status;
+}
+
+/* module initialisation */
+static NTSTATUS auth_init_samba4(struct auth_context *auth_context,
+				    const char *param,
+				    auth_methods **auth_method)
+{
+	struct auth_methods *result;
+
+	result = TALLOC_ZERO_P(auth_context, struct auth_methods);
+	if (result == NULL) {
+		return NT_STATUS_NO_MEMORY;
+	}
+	result->name = "samba4";
+	result->auth = check_samba4_security;
+
+        *auth_method = result;
+	return NT_STATUS_OK;
+}
+
+NTSTATUS auth_samba4_init(void)
+{
+	smb_register_auth(AUTH_INTERFACE_VERSION, "samba4",
+			  auth_init_samba4);
+	return NT_STATUS_OK;
+}
diff --git a/source3/auth/wscript_build b/source3/auth/wscript_build
index 8bf2051..dc59c87 100644
--- a/source3/auth/wscript_build
+++ b/source3/auth/wscript_build
@@ -96,3 +96,12 @@ bld.SAMBA3_MODULE('auth_script',
                  init_function='',
                  internal_module=bld.SAMBA3_IS_STATIC_MODULE('auth_script'),
                  enabled=bld.SAMBA3_IS_ENABLED_MODULE('auth_script'))
+
+bld.SAMBA3_MODULE('auth_samba4',
+                  subsystem='auth',
+                  source='auth_samba4.c',
+                  init_function='',
+                  deps='auth4',
+                  allow_undefined_symbols=False,
+                  internal_module=bld.SAMBA3_IS_STATIC_MODULE('auth_samba4'),
+                  enabled=bld.SAMBA3_IS_ENABLED_MODULE('auth_samba4'))
diff --git a/source3/passdb/machine_account_secrets.c b/source3/passdb/machine_account_secrets.c
index 61894d4..665e2f8 100644
--- a/source3/passdb/machine_account_secrets.c
+++ b/source3/passdb/machine_account_secrets.c
@@ -57,6 +57,17 @@ bool secrets_store_domain_sid(const char *domain, const struct dom_sid  *sid)
 {
 	bool ret;
 
+#ifdef _SAMBA_WAF_BUILD_
+	if (strequal(domain, get_global_sam_name()) &&
+	    (pdb_capabilities() & PDB_CAP_ADS)) {
+		/* If we have a ADS-capable passdb backend, we
+		 * must never make up our own SID, it will
+		 * already be in the directory */
+		DEBUG(0, ("Refusing to store a Domain SID, this should be read from the directory not stored here\n"));
+		return false;
+	}
+#endif
+
 	ret = secrets_store(domain_sid_keystr(domain), sid, sizeof(struct dom_sid ));
 
 	/* Force a re-query, in case we modified our domain */
@@ -70,6 +81,24 @@ bool secrets_fetch_domain_sid(const char *domain, struct dom_sid  *sid)
 	struct dom_sid  *dyn_sid;
 	size_t size = 0;
 
+#ifdef _SAMBA_WAF_BUILD_
+	if (strequal(domain, get_global_sam_name()) &&
+	    (pdb_capabilities() & PDB_CAP_ADS)) {
+		struct pdb_domain_info *domain_info;
+		domain_info = pdb_get_domain_info(talloc_tos());
+		if (!domain_info) {
+			/* If we have a ADS-capable passdb backend, we
+			 * must never make up our own SID, it will
+			 * already be in the directory */
+			DEBUG(0, ("Unable to fetch a Domain SID from the directory!\n"));
+			return false;
+		}
+
+		*sid = domain_info->sid;
+		return true;
+	}
+#endif
+
 	dyn_sid = (struct dom_sid  *)secrets_fetch(domain_sid_keystr(domain), &size);
 
 	if (dyn_sid == NULL)
@@ -89,6 +118,17 @@ bool secrets_store_domain_guid(const char *domain, struct GUID *guid)
 {
 	fstring key;
 
+#ifdef _SAMBA_WAF_BUILD_
+	if (strequal(domain, get_global_sam_name()) &&
+	    (pdb_capabilities() & PDB_CAP_ADS)) {
+		/* If we have a ADS-capable passdb backend, we
+		 * must never make up our own GUID, it will
+		 * already be in the directory */
+		DEBUG(0, ("Refusing to store a Domain GUID, this should be read from the directory not stored here\n"));
+		return false;
+	}
+#endif
+
 	slprintf(key, sizeof(key)-1, "%s/%s", SECRETS_DOMAIN_GUID, domain);
 	strupper_m(key);
 	return secrets_store(key, guid, sizeof(struct GUID));
@@ -101,6 +141,24 @@ bool secrets_fetch_domain_guid(const char *domain, struct GUID *guid)
 	size_t size = 0;
 	struct GUID new_guid;
 
+#ifdef _SAMBA_WAF_BUILD_
+	if (strequal(domain, get_global_sam_name()) &&
+	    (pdb_capabilities() & PDB_CAP_ADS)) {
+		struct pdb_domain_info *domain_info;
+		domain_info = pdb_get_domain_info(talloc_tos());
+		if (!domain_info) {
+			/* If we have a ADS-capable passdb backend, we
+			 * must never make up our own SID, it will
+			 * already be in the directory */
+			DEBUG(0, ("Unable to fetch a Domain GUID from the directory!\n"));
+			return false;
+		}
+
+		*guid = domain_info->guid;
+		return true;
+	}
+#endif
+
 	slprintf(key, sizeof(key)-1, "%s/%s", SECRETS_DOMAIN_GUID, domain);
 	strupper_m(key);
 	dyn_guid = (struct GUID *)secrets_fetch(key, &size);
diff --git a/source3/passdb/pdb_samba4.c b/source3/passdb/pdb_samba4.c
new file mode 100644
index 0000000..558f8d0
--- /dev/null
+++ b/source3/passdb/pdb_samba4.c
@@ -0,0 +1,2113 @@
+/*
+   Unix SMB/CIFS implementation.
+   pdb glue module for samba4
+   Copyright (C) Volker Lendecke 2009-2011
+   Copyright (C) Andrew Bartlett 2010
+   Copyright (C) Matthias Dieter Wallnöfer                 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/>.
+*/
+
+/* This module, is a port of Volker's pdb_ads to ldb and DSDB APIs */
+
+#include "includes.h"
+#include "source3/include/passdb.h"
+#include "source4/dsdb/samdb/samdb.h"
+#include "ldb_errors.h"
+#include "libcli/security/dom_sid.h"
+#include "source4/winbind/idmap.h"
+#include "librpc/gen_ndr/ndr_security.h"
+#include "libds/common/flag_mapping.h"
+#include "source4/lib/events/events.h"
+#include "source4/auth/session.h"
+#include "source4/auth/system_session_proto.h"
+#include "source4/param/param.h"
+
+struct pdb_samba4_state {
+	struct tevent_context *ev;
+	struct ldb_context *ldb;
+	struct idmap_context *idmap_ctx;
+	struct loadparm_context *lp_ctx;
+};
+
+static NTSTATUS pdb_samba4_getsampwsid(struct pdb_methods *m,
+				    struct samu *sam_acct,
+				    const struct dom_sid *sid);
+static NTSTATUS pdb_samba4_getsamupriv(struct pdb_samba4_state *state,
+				    const char *filter,
+				    TALLOC_CTX *mem_ctx,
+				    struct ldb_message **pmsg);
+static bool pdb_samba4_sid_to_id(struct pdb_methods *m, const struct dom_sid *sid,
+				 union unid_t *id, enum lsa_SidType *type);
+
+static bool pdb_samba4_pull_time(struct ldb_message *msg, const char *attr,
+			      time_t *ptime)
+{
+	uint64_t tmp;
+	if (! ldb_msg_find_element(msg, attr)) {
+		return false;
+	}
+	tmp = ldb_msg_find_attr_as_uint64(msg, attr, 0);
+	*ptime = uint64s_nt_time_to_unix_abs(&tmp);
+	return true;
+}
+
+static struct pdb_domain_info *pdb_samba4_get_domain_info(
+	struct pdb_methods *m, TALLOC_CTX *mem_ctx)
+{
+	struct pdb_samba4_state *state = talloc_get_type_abort(


-- 
Samba Shared Repository


More information about the samba-cvs mailing list