[SCM] Samba Shared Repository - branch v4-0-test updated - release-4-0-0alpha2-315-ge940b10

Stefan Metzmacher metze at samba.org
Tue Jan 8 13:13:25 GMT 2008


The branch, v4-0-test has been updated
       via  e940b1020a3c2e7ee43198dc40c47cbdbef0d950 (commit)
       via  9fc5f098e01145db5b01efb0bf22cdddf0213d20 (commit)
       via  fdd2ba336b4cf742f6e59253beab5dd226a87a85 (commit)
       via  5f6cc640758448df9c8ad4eba1ffa12ce0c3f732 (commit)
       via  b06896d2378e536f5044dbe500a5232a89d6d0b5 (commit)
       via  846876ad32dc86fe7c367db084e76c670c61b389 (commit)
       via  f08192750eecdd8b0ffbed84a53abcae51afd2df (commit)
       via  51cd93344dfeb3556fada523e38bbcd7e51fbbe1 (commit)
       via  d6b863453dcda85e02e53c44d68272bf2ef95d19 (commit)
       via  0016231edd514e8db620bafc44ce877fcac19ed9 (commit)
       via  341929c615e5573887889cf22950a25b536c6fc1 (commit)
       via  df17c4a9e84f4a4087c4a4a8ad44a82d4acb522e (commit)
       via  16edbe1d607390227652ee97a000da98c696c735 (commit)
       via  2f228bcbf63af98ff2d0f498f48d49d0f2926343 (commit)
       via  b4a95a89853a0ebd75b39f01bbdbf82e05e97bd7 (commit)
       via  62017f049bc0b0f311ba49d03084044faa5e6dcd (commit)
       via  5c3c131d174ba0f162c210d3e6ca30f2ed2a3ec0 (commit)
       via  b97de4a655b989a481d5d001ce9a5d3969d2909c (commit)
       via  a175ee6594046c44572e3314ab7c3b61dcd7422f (commit)
       via  2df0f7016e27705c3799b2f6bb20fcc17b103c36 (commit)
       via  93b80f1ceb1efffd16a489bebd63ec10dd947989 (commit)
       via  18cd08623eaad7d2cd63b82ea5275d4dfd21cf00 (commit)
       via  33c5982ed9b9fada9355dde5dc274abb99ec0615 (commit)
       via  13cc6ca1d3c2b5899bdd02c4c7306a92baa260f5 (commit)
       via  50c46160d997e0448f51ae09e0f3c79e8519fa41 (commit)
       via  aa438a2febc6562aa6f71505936d0872a6dcd17d (commit)
       via  7db3222dace7071e3d74fc34b86d571a0f3badea (commit)
       via  aa2adf33275dc637022d9feee1531aa79aa08e25 (commit)
       via  bcd8f50f7952d1e502326f11ddfa8cfe8a982b1b (commit)
       via  bdf30f80fbef8ea70c3073dc43bc1b0bc02a9951 (commit)
      from  f24e5e8a2b16f2f1640cb573bdcb346cb3748f33 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v4-0-test


- Log -----------------------------------------------------------------
commit e940b1020a3c2e7ee43198dc40c47cbdbef0d950
Author: Rafal Szczesniak <mimir at samba.org>
Date:   Tue Jan 8 10:20:44 2008 -0600

    r26693: Add (untested) libnet_rpc_groupdel function.
    
    rafal

commit 9fc5f098e01145db5b01efb0bf22cdddf0213d20
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Mon Jan 7 23:41:55 2008 -0600

    r26692: registry: Treat key and value names case-insensitively.

commit fdd2ba336b4cf742f6e59253beab5dd226a87a85
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Mon Jan 7 22:34:53 2008 -0600

    r26691: registry: Add subkeys required for Server Manager Alerts and Peplication. See bugs 4934 and 4935.

commit 5f6cc640758448df9c8ad4eba1ffa12ce0c3f732
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Mon Jan 7 22:34:46 2008 -0600

    r26690: torture: Move torture_context_init() to the ui.c, where all functions related to it are.

commit b06896d2378e536f5044dbe500a5232a89d6d0b5
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Mon Jan 7 14:11:29 2008 -0600

    r26689: registry: Return max_subkeynamelen, max_valnamelen and max_valbufsize in getkeyinfo().

commit 846876ad32dc86fe7c367db084e76c670c61b389
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Mon Jan 7 14:11:25 2008 -0600

    r26688: Fix listing remote predefined keys and subkeys. This fixes bug 3431.

commit f08192750eecdd8b0ffbed84a53abcae51afd2df
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Mon Jan 7 14:11:19 2008 -0600

    r26687: python: Update status after feedback from abartlett.

commit 51cd93344dfeb3556fada523e38bbcd7e51fbbe1
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Mon Jan 7 05:50:04 2008 -0600

    r26686: Fix bug 5143 by Jason Tarbet. This prevented an easy cut-and-paste of
    
    the provision options used.
    
    Andrew Bartlett

commit d6b863453dcda85e02e53c44d68272bf2ef95d19
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Mon Jan 7 05:41:16 2008 -0600

    r26685: Fix bug 5137 by Mark Ridley. The RPC-ATSVC test is not tested, so was
    
    broken by 'ref' changes long ago.
    
    We need a working script to aim against windows.
    
    Andrew Bartlett

commit 0016231edd514e8db620bafc44ce877fcac19ed9
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Mon Jan 7 05:22:14 2008 -0600

    r26684: Trivial cleanup from Matthias Dieter Wallnöfer, from bug 5090
    
    Andrew Bartlett

commit 341929c615e5573887889cf22950a25b536c6fc1
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Mon Jan 7 04:46:13 2008 -0600

    r26683: Add another testcase. I still don't know what's wrong here.
    
    Andrew Bartlett

commit df17c4a9e84f4a4087c4a4a8ad44a82d4acb522e
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Mon Jan 7 03:15:39 2008 -0600

    r26682: Move CLDAP to the modern torture system, and add value checking.
    
    Andrew Bartlett

commit 16edbe1d607390227652ee97a000da98c696c735
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Mon Jan 7 03:14:51 2008 -0600

    r26681: Use fewer magic numbers.
    
    Andrew Bartlett

commit 2f228bcbf63af98ff2d0f498f48d49d0f2926343
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Mon Jan 7 00:47:01 2008 -0600

    r26680: Don't always advertise GC functionality.
    
    Andrew Bartlett

commit b4a95a89853a0ebd75b39f01bbdbf82e05e97bd7
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Mon Jan 7 00:46:39 2008 -0600

    r26679: It is very bad to free the ldb handle when you didn't create it...
    
    (My bad when copying this code into samdb_is_gc()).
    
    Andrew Bartlett

commit 62017f049bc0b0f311ba49d03084044faa5e6dcd
Author: Tim Potter <tpot at samba.org>
Date:   Sun Jan 6 23:42:46 2008 -0600

    r26678: Check in auto-generated swig files.

commit 5c3c131d174ba0f162c210d3e6ca30f2ed2a3ec0
Author: Tim Potter <tpot at samba.org>
Date:   Sun Jan 6 23:17:55 2008 -0600

    r26677: Implement and test iter{keys,values,items} for tdb bindings.
    
    Use tempfile.mkstemp() instead of os.tmpnam() in tests.

commit b97de4a655b989a481d5d001ce9a5d3969d2909c
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Jan 6 22:01:31 2008 -0600

    r26676: libcli: Fill in lp_workgroup() again, should fix my breakage of cifsdd tests. Thanks to Andrew for catching this.
    
    Also fixes a typo in sessetup.c.

commit a175ee6594046c44572e3314ab7c3b61dcd7422f
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sat Jan 5 21:29:25 2008 -0600

    r26675: mkproto: Add --all argument, fix some perl warnings.

commit 2df0f7016e27705c3799b2f6bb20fcc17b103c36
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sat Jan 5 19:33:11 2008 -0600

    r26674: smb_composite: Avoid use of global_loadparm.
    
    Hopefully this fixes OpenChange's mapiadmin.

commit 93b80f1ceb1efffd16a489bebd63ec10dd947989
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sat Jan 5 19:33:05 2008 -0600

    r26673: selftest: Document the purpose and output format of samba4_tests.sh.

commit 18cd08623eaad7d2cd63b82ea5275d4dfd21cf00
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sat Jan 5 19:03:43 2008 -0600

    r26672: Janitorial: Remove uses of global_loadparm.

commit 33c5982ed9b9fada9355dde5dc274abb99ec0615
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sat Jan 5 19:03:36 2008 -0600

    r26671: rap: Convert the RAP tests to the new torture API and run them by default.
    
    We don't have a server-side implementation of netservergetinfo yet, so it is
    marked as known failing.

commit 13cc6ca1d3c2b5899bdd02c4c7306a92baa260f5
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sat Jan 5 15:36:37 2008 -0600

    r26670: Janitorial: Remove global_loadparm uses.

commit 50c46160d997e0448f51ae09e0f3c79e8519fa41
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sat Jan 5 15:36:33 2008 -0600

    r26669: Janitorial: Remove uses of global_loadparm.

commit aa438a2febc6562aa6f71505936d0872a6dcd17d
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sat Jan 5 15:36:26 2008 -0600

    r26668: tdb/python: Fix default value of open_flags for tdb.

commit 7db3222dace7071e3d74fc34b86d571a0f3badea
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sat Jan 5 14:00:12 2008 -0600

    r26667: pidl/python: Don't generate casts anymore; this will generate warnings with older Pythons, but will be a lot cleaner with newer versions.

commit aa2adf33275dc637022d9feee1531aa79aa08e25
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sat Jan 5 14:00:07 2008 -0600

    r26666: python: Prefer newer Python versions as they use const properly.

commit bcd8f50f7952d1e502326f11ddfa8cfe8a982b1b
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sat Jan 5 13:59:53 2008 -0600

    r26665: registry: Fix tests on bigendian machines.

commit bdf30f80fbef8ea70c3073dc43bc1b0bc02a9951
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Fri Jan 4 15:41:29 2008 -0600

    r26664: buildsystem: Hopefully fix the shared library build on AIX.

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

Summary of changes:
 source/build/smb_build/output.pm            |    3 +-
 source/cldap_server/cldap_server.c          |    2 +-
 source/cldap_server/netlogon.c              |    9 +-
 source/dsdb/common/util.c                   |    2 +-
 source/dsdb/repl/drepl_service.c            |    2 +-
 source/kdc/kdc.c                            |   10 +-
 source/ldap_server/ldap_server.c            |   19 ++-
 source/ldap_server/ldap_server.h            |    1 +
 source/lib/events/events.c                  |    3 -
 source/lib/ldb/ldb_tdb/ldb_index.c          |    2 +-
 source/lib/registry/dir.c                   |   32 ++++-
 source/lib/registry/hive.c                  |    9 +-
 source/lib/registry/hive.h                  |   10 +-
 source/lib/registry/interface.c             |    9 +-
 source/lib/registry/ldb.c                   |   62 ++++++++-
 source/lib/registry/local.c                 |   12 +-
 source/lib/registry/patchfile.c             |   11 +-
 source/lib/registry/regf.c                  |   11 ++-
 source/lib/registry/registry.h              |   11 +-
 source/lib/registry/rpc.c                   |  104 ++++++++++-----
 source/lib/registry/tests/hive.c            |   12 +-
 source/lib/registry/tests/registry.c        |    4 +-
 source/lib/registry/tools/common.c          |    6 +-
 source/lib/registry/tools/regshell.c        |   32 ++++-
 source/lib/tdb/python/tests/simple.py       |   23 +++-
 source/lib/tdb/tdb.i                        |   14 ++-
 source/lib/tdb/tdb.py                       |   12 ++-
 source/lib/tdb/tdb_wrap.c                   |   75 +++++------
 source/libcli/raw/clisocket.c               |    2 +-
 source/libcli/raw/clitree.c                 |    1 +
 source/libcli/raw/rawacl.c                  |    5 +-
 source/libcli/raw/rawnegotiate.c            |    4 +-
 source/libcli/smb_composite/connect.c       |    5 +-
 source/libcli/smb_composite/fsinfo.c        |    4 +-
 source/libcli/smb_composite/sesssetup.c     |    2 +-
 source/libnet/groupman.c                    |  193 +++++++++++++++++++++++++--
 source/libnet/groupman.h                    |   11 ++
 source/libnet/libnet_become_dc.c            |    6 +-
 source/libnet/libnet_vampire.c              |    2 +-
 source/nbt_server/nbt_server.c              |    3 +-
 source/nbt_server/wins/winswack.c           |    2 +-
 source/ntptr/simple_ldb/ntptr_simple_ldb.c  |    4 +-
 source/ntvfs/common/opendb_tdb.c            |    4 +-
 source/ntvfs/ipc/ipc_rap.c                  |   26 +++--
 source/ntvfs/ipc/rap_server.c               |    4 +-
 source/ntvfs/ipc/vfs_ipc.c                  |    2 +-
 source/ntvfs/sysdep/sys_notify.c            |    6 -
 source/pidl/lib/Parse/Pidl/Samba4/Python.pm |   18 ++--
 source/rpc_server/service_rpc.c             |   12 +-
 source/rpc_server/winreg/rpc_winreg.c       |    6 +-
 source/samba4-knownfail                     |    1 +
 source/script/mkproto.pl                    |   19 ++--
 source/scripting/python/STATUS              |    3 +
 source/scripting/python/config.m4           |    7 +-
 source/selftest/samba4_tests.sh             |   24 ++++
 source/setup/provision                      |    2 +-
 source/setup/provision.reg                  |    9 ++
 source/smb_server/smb2/fileio.c             |    2 +-
 source/smb_server/smb_server.c              |    6 +-
 source/smbd/process_model.h                 |   13 ++-
 source/smbd/process_single.c                |   12 +-
 source/smbd/process_standard.c              |   11 +-
 source/smbd/process_thread.c                |   24 +++-
 source/smbd/service_stream.c                |   12 ++-
 source/smbd/service_task.c                  |    6 +-
 source/torture/ldap/cldap.c                 |   63 +++++++--
 source/torture/rap/rap.c                    |   98 ++++----------
 source/torture/rpc/atsvc.c                  |    5 +
 source/torture/torture.c                    |   18 +---
 source/torture/ui.c                         |   17 +++
 source/torture/util_smb.c                   |    2 +-
 source/web_server/web_server.c              |   10 +-
 source/winbind/wb_server.c                  |    7 +-
 source/wrepl_server/wrepl_in_connection.c   |   11 +-
 source/wrepl_server/wrepl_server.c          |    3 +-
 75 files changed, 850 insertions(+), 359 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/build/smb_build/output.pm b/source/build/smb_build/output.pm
index d9c0553..fbf14f7 100644
--- a/source/build/smb_build/output.pm
+++ b/source/build/smb_build/output.pm
@@ -7,6 +7,7 @@
 
 package output;
 use strict;
+use smb_build::config;
 
 sub add_dir_str($$)
 {
@@ -79,7 +80,7 @@ sub generate_shared_library($)
 
 	$lib->{LIBRARY_DEBUGNAME} = $lib->{LIBRARY_REALNAME};
 
-	if (defined($lib->{VERSION})) {
+	if (defined($lib->{VERSION}) and $config::config{SONAMEFLAG} ne "#") {
 		$lib->{LIBRARY_SONAME} = "$lib->{LIBRARY_REALNAME}.$lib->{SO_VERSION}";
 		$lib->{LIBRARY_REALNAME} = "$lib->{LIBRARY_REALNAME}.$lib->{VERSION}";
 	} 
diff --git a/source/cldap_server/cldap_server.c b/source/cldap_server/cldap_server.c
index 47597ff..d686371 100644
--- a/source/cldap_server/cldap_server.c
+++ b/source/cldap_server/cldap_server.c
@@ -209,7 +209,7 @@ static void cldapd_task_init(struct task_server *task)
  */
 static NTSTATUS cldapd_init(struct event_context *event_ctx, struct loadparm_context *lp_ctx, const struct model_ops *model_ops)
 {
-	return task_server_startup(event_ctx, model_ops, cldapd_task_init);
+	return task_server_startup(event_ctx, lp_ctx, model_ops, cldapd_task_init);
 }
 
 
diff --git a/source/cldap_server/netlogon.c b/source/cldap_server/netlogon.c
index f77909e..32a71e4 100644
--- a/source/cldap_server/netlogon.c
+++ b/source/cldap_server/netlogon.c
@@ -162,7 +162,6 @@ static NTSTATUS cldapd_netlogon_fill(struct cldapd_server *cldapd,
 	}
 
 	server_type      = 
-		NBT_SERVER_GC | 
 		NBT_SERVER_DS | NBT_SERVER_TIMESERV |
 		NBT_SERVER_CLOSEST | NBT_SERVER_WRITABLE | 
 		NBT_SERVER_GOOD_TIMESERV;
@@ -171,6 +170,10 @@ static NTSTATUS cldapd_netlogon_fill(struct cldapd_server *cldapd,
 		server_type |= NBT_SERVER_PDC;
 	}
 
+	if (samdb_is_gc(cldapd->samctx)) {
+		server_type |= NBT_SERVER_GC;
+	}
+
 	if (str_list_check(services, "ldap")) {
 		server_type |= NBT_SERVER_LDAP;
 	}
@@ -227,7 +230,7 @@ static NTSTATUS cldapd_netlogon_fill(struct cldapd_server *cldapd,
 	case 5:
 	case 6:
 	case 7:
-		netlogon->logon5.type         = (user?23+2:23);
+		netlogon->logon5.type         = (user?NETLOGON_RESPONSE_FROM_PDC_USER:NETLOGON_RESPONSE_FROM_PDC2);
 		netlogon->logon5.server_type  = server_type;
 		netlogon->logon5.domain_uuid  = domain_uuid;
 		netlogon->logon5.forest       = realm;
@@ -242,7 +245,7 @@ static NTSTATUS cldapd_netlogon_fill(struct cldapd_server *cldapd,
 		netlogon->logon5.lm20_token   = 0xFFFF;
 		break;
 	default:
-		netlogon->logon13.type         = (user?23+2:23);
+		netlogon->logon13.type         = (user?NETLOGON_RESPONSE_FROM_PDC_USER:NETLOGON_RESPONSE_FROM_PDC2);
 		netlogon->logon13.server_type  = server_type;
 		netlogon->logon13.domain_uuid  = domain_uuid;
 		netlogon->logon13.forest       = realm;
diff --git a/source/dsdb/common/util.c b/source/dsdb/common/util.c
index 17a2019..bee1eac 100644
--- a/source/dsdb/common/util.c
+++ b/source/dsdb/common/util.c
@@ -1395,7 +1395,7 @@ bool samdb_is_gc(struct ldb_context *ldb)
 
 	options = ldb_msg_find_attr_as_int(res->msgs[0], "options", 0);
 	talloc_free(res);
-	talloc_free(ldb);
+	talloc_free(tmp_ctx);
 
 	/* if options attribute has the 0x00000001 flag set, then enable the global catlog */
 	if (options & 0x000000001) {
diff --git a/source/dsdb/repl/drepl_service.c b/source/dsdb/repl/drepl_service.c
index c3238a2..e212407 100644
--- a/source/dsdb/repl/drepl_service.c
+++ b/source/dsdb/repl/drepl_service.c
@@ -185,7 +185,7 @@ static void dreplsrv_task_init(struct task_server *task)
  */
 static NTSTATUS dreplsrv_init(struct event_context *event_ctx, struct loadparm_context *lp_ctx, const struct model_ops *model_ops)
 {
-	return task_server_startup(event_ctx, model_ops, dreplsrv_task_init);
+	return task_server_startup(event_ctx, lp_ctx, model_ops, dreplsrv_task_init);
 }
 
 /*
diff --git a/source/kdc/kdc.c b/source/kdc/kdc.c
index 5c8b2af..04e7ddd 100644
--- a/source/kdc/kdc.c
+++ b/source/kdc/kdc.c
@@ -489,7 +489,9 @@ static NTSTATUS kdc_add_socket(struct kdc_server *kdc, const char *address,
 		return NT_STATUS_INTERNAL_ERROR;
 	}
 
-	status = stream_setup_socket(kdc->task->event_ctx, model_ops, 
+	status = stream_setup_socket(kdc->task->event_ctx, 
+				     kdc->task->lp_ctx,
+				     model_ops, 
 				     &kdc_tcp_stream_ops, 
 				     "ip", address, &kdc_port, 
 				     lp_socket_options(kdc->task->lp_ctx), 
@@ -501,7 +503,9 @@ static NTSTATUS kdc_add_socket(struct kdc_server *kdc, const char *address,
 		return status;
 	}
 
-	status = stream_setup_socket(kdc->task->event_ctx, model_ops, 
+	status = stream_setup_socket(kdc->task->event_ctx, 
+				     kdc->task->lp_ctx,
+				     model_ops, 
 				     &kpasswdd_tcp_stream_ops, 
 				     "ip", address, &kpasswd_port, 
 				     lp_socket_options(kdc->task->lp_ctx), 
@@ -663,7 +667,7 @@ static NTSTATUS kdc_init(struct event_context *event_ctx,
 			 struct loadparm_context *lp_ctx,
 			 const struct model_ops *model_ops)
 {	
-	return task_server_startup(event_ctx, model_ops, kdc_task_init);
+	return task_server_startup(event_ctx, lp_ctx, model_ops, kdc_task_init);
 }
 
 /* called at smbd startup - register ourselves as a server service */
diff --git a/source/ldap_server/ldap_server.c b/source/ldap_server/ldap_server.c
index 9bb1279..fcc9435 100644
--- a/source/ldap_server/ldap_server.c
+++ b/source/ldap_server/ldap_server.c
@@ -345,7 +345,7 @@ static void ldapsrv_accept(struct stream_connection *c)
 	conn->connection  = c;
 	conn->service     = ldapsrv_service;
 	conn->sockets.raw = c->socket;
-	conn->lp_ctx      = global_loadparm;
+	conn->lp_ctx      = ldapsrv_service->task->lp_ctx;
 
 	c->private        = conn;
 
@@ -449,7 +449,8 @@ static NTSTATUS add_socket(struct event_context *event_context,
 	NTSTATUS status;
 	struct ldb_context *ldb;
 
-	status = stream_setup_socket(event_context, model_ops, &ldap_stream_ops, 
+	status = stream_setup_socket(event_context, lp_ctx,
+				     model_ops, &ldap_stream_ops, 
 				     "ipv4", address, &port, 
 				     lp_socket_options(lp_ctx), 
 				     ldap_service);
@@ -461,7 +462,8 @@ static NTSTATUS add_socket(struct event_context *event_context,
 	if (tls_support(ldap_service->tls_params)) {
 		/* add ldaps server */
 		port = 636;
-		status = stream_setup_socket(event_context, model_ops, &ldap_stream_ops, 
+		status = stream_setup_socket(event_context, lp_ctx, 
+					     model_ops, &ldap_stream_ops, 
 					     "ipv4", address, &port, 
 					     lp_socket_options(lp_ctx), 
 					     ldap_service);
@@ -479,7 +481,8 @@ static NTSTATUS add_socket(struct event_context *event_context,
 	
 	if (samdb_is_gc(ldb)) {
 		port = 3268;
-		status = stream_setup_socket(event_context, model_ops, &ldap_stream_ops, 
+		status = stream_setup_socket(event_context, lp_ctx,
+					     model_ops, &ldap_stream_ops, 
 					     "ipv4", address, &port, 
 				     	     lp_socket_options(lp_ctx), 
 					     ldap_service);
@@ -523,6 +526,8 @@ static void ldapsrv_task_init(struct task_server *task)
 	ldap_service = talloc_zero(task, struct ldapsrv_service);
 	if (ldap_service == NULL) goto failed;
 
+	ldap_service->task = task;
+
 	ldap_service->tls_params = tls_initialise(ldap_service, task->lp_ctx);
 	if (ldap_service->tls_params == NULL) goto failed;
 
@@ -554,7 +559,8 @@ static void ldapsrv_task_init(struct task_server *task)
 		goto failed;
 	}
 
-	status = stream_setup_socket(task->event_ctx, model_ops, &ldap_stream_ops, 
+	status = stream_setup_socket(task->event_ctx, task->lp_ctx,
+				     model_ops, &ldap_stream_ops, 
 				     "unix", ldapi_path, NULL, 
 				     lp_socket_options(task->lp_ctx), 
 				     ldap_service);
@@ -578,7 +584,8 @@ static NTSTATUS ldapsrv_init(struct event_context *event_context,
 			     struct loadparm_context *lp_ctx,
 			     const struct model_ops *model_ops)
 {	
-	return task_server_startup(event_context, model_ops, ldapsrv_task_init);
+	return task_server_startup(event_context, lp_ctx, model_ops, 
+				   ldapsrv_task_init);
 }
 
 
diff --git a/source/ldap_server/ldap_server.h b/source/ldap_server/ldap_server.h
index 88af0fb..4f7a5b9 100644
--- a/source/ldap_server/ldap_server.h
+++ b/source/ldap_server/ldap_server.h
@@ -65,6 +65,7 @@ struct ldapsrv_call {
 
 struct ldapsrv_service {
 	struct tls_params *tls_params;
+	struct task_server *task;
 };
 
 #include "ldap_server/proto.h"
diff --git a/source/lib/events/events.c b/source/lib/events/events.c
index 245be14..555a509 100644
--- a/source/lib/events/events.c
+++ b/source/lib/events/events.c
@@ -103,11 +103,8 @@ static void event_backend_init(void)
 {
 #if _SAMBA_BUILD_
 	init_module_fn static_init[] = { STATIC_LIBEVENTS_MODULES };
-	init_module_fn *shared_init;
 	if (event_backends) return;
-	shared_init = load_samba_modules(NULL, global_loadparm, "events");
 	run_init_functions(static_init);
-	run_init_functions(shared_init);
 #else
 	bool events_standard_init(void);
 	bool events_select_init(void);
diff --git a/source/lib/ldb/ldb_tdb/ldb_index.c b/source/lib/ldb/ldb_tdb/ldb_index.c
index cf9380f..d8776f4 100644
--- a/source/lib/ldb/ldb_tdb/ldb_index.c
+++ b/source/lib/ldb/ldb_tdb/ldb_index.c
@@ -886,7 +886,7 @@ static int ltdb_index_add1_add(struct ldb_context *ldb,
 	msg->elements[idx].values[msg->elements[idx].num_values].data = discard_const_p(uint8_t, dn);
 	msg->elements[idx].num_values++;
 
-	return 0;
+	return LDB_SUCCESS;
 }
 
 /*
diff --git a/source/lib/registry/dir.c b/source/lib/registry/dir.c
index 2f00d2f..a13e375 100644
--- a/source/lib/registry/dir.c
+++ b/source/lib/registry/dir.c
@@ -184,7 +184,10 @@ static WERROR reg_dir_get_info(TALLOC_CTX *ctx, const struct hive_key *key,
 			       const char **classname,
 			       uint32_t *num_subkeys,
 			       uint32_t *num_values,
-			       NTTIME *lastmod)
+			       NTTIME *lastmod,
+			       uint32_t *max_subkeynamelen,
+			       uint32_t *max_valnamelen,
+			       uint32_t *max_valbufsize)
 {
 	DIR *d;
 	const struct dir_key *dk = talloc_get_type(key, struct dir_key);
@@ -206,6 +209,15 @@ static WERROR reg_dir_get_info(TALLOC_CTX *ctx, const struct hive_key *key,
 	if (num_values != NULL)
 		*num_values = 0;
 
+	if (max_subkeynamelen != NULL)
+		*max_subkeynamelen = 0;
+
+	if (max_valnamelen != NULL)
+		*max_valnamelen = 0;
+
+	if (max_valbufsize != NULL)
+		*max_valbufsize = 0;
+
 	while((e = readdir(d))) {
 		if(!ISDOT(e->d_name) && !ISDOTDOT(e->d_name)) {
 			char *path = talloc_asprintf(ctx, "%s/%s",
@@ -217,11 +229,21 @@ static WERROR reg_dir_get_info(TALLOC_CTX *ctx, const struct hive_key *key,
 				continue;
 			}
 
-			if (S_ISDIR(st.st_mode) && num_subkeys != NULL)
-				(*num_subkeys)++;
+			if (S_ISDIR(st.st_mode)) {
+				if (num_subkeys != NULL)
+					(*num_subkeys)++;
+				if (max_subkeynamelen != NULL)
+					*max_subkeynamelen = MAX(*max_subkeynamelen, strlen(e->d_name));
+			}
 
-			if (!S_ISDIR(st.st_mode) && num_values != NULL)
-				(*num_values)++;
+			if (!S_ISDIR(st.st_mode)) {
+				if (num_values != NULL)
+					(*num_values)++;
+				if (max_valnamelen != NULL)
+					*max_valnamelen = MAX(*max_valnamelen, strlen(e->d_name));
+				if (max_valbufsize != NULL)
+					*max_valbufsize = MAX(*max_valbufsize, st.st_size);
+			}
 
 			talloc_free(path);
 		}
diff --git a/source/lib/registry/hive.c b/source/lib/registry/hive.c
index d7d1207..bbe5107 100644
--- a/source/lib/registry/hive.c
+++ b/source/lib/registry/hive.c
@@ -66,10 +66,15 @@ _PUBLIC_ WERROR hive_key_get_info(TALLOC_CTX *mem_ctx,
 				  const struct hive_key *key,
 				  const char **classname, uint32_t *num_subkeys,
 				  uint32_t *num_values,
-				  NTTIME *last_change_time)
+				  NTTIME *last_change_time,
+				  uint32_t *max_subkeynamelen,
+				  uint32_t *max_valnamelen,
+				  uint32_t *max_valbufsize)
 {
 	return key->ops->get_key_info(mem_ctx, key, classname, num_subkeys,
-				      num_values, last_change_time);
+				      num_values, last_change_time,
+				      max_subkeynamelen,
+				      max_valnamelen, max_valbufsize);
 }
 
 _PUBLIC_ WERROR hive_key_add_name(TALLOC_CTX *ctx,
diff --git a/source/lib/registry/hive.h b/source/lib/registry/hive.h
index 1e05f6b..6d9a69c 100644
--- a/source/lib/registry/hive.h
+++ b/source/lib/registry/hive.h
@@ -135,7 +135,10 @@ struct hive_operations {
 				const char **classname,
 				uint32_t *num_subkeys,
 				uint32_t *num_values,
-				NTTIME *last_change_time);
+				NTTIME *last_change_time,
+				uint32_t *max_subkeynamelen,
+				uint32_t *max_valnamelen,
+				uint32_t *max_valbufsize);
 };
 
 struct cli_credentials;
@@ -148,8 +151,9 @@ WERROR reg_open_hive(TALLOC_CTX *parent_ctx, const char *location,
 		     struct hive_key **root);
 WERROR hive_key_get_info(TALLOC_CTX *mem_ctx, const struct hive_key *key,
 			 const char **classname, uint32_t *num_subkeys,
-			 uint32_t *num_values,
-			 NTTIME *last_change_time);
+			 uint32_t *num_values, NTTIME *last_change_time,
+			 uint32_t *max_subkeynamelen,
+			 uint32_t *max_valnamelen, uint32_t *max_valbufsize);
 WERROR hive_key_add_name(TALLOC_CTX *ctx, const struct hive_key *parent_key,
 			 const char *name, const char *classname,
 			 struct security_descriptor *desc,
diff --git a/source/lib/registry/interface.c b/source/lib/registry/interface.c
index b914fba..a18fd2c 100644
--- a/source/lib/registry/interface.c
+++ b/source/lib/registry/interface.c
@@ -128,7 +128,10 @@ _PUBLIC_ WERROR reg_key_get_info(TALLOC_CTX *mem_ctx,
 				 const char **classname,
 				 uint32_t *num_subkeys,
 				 uint32_t *num_values,
-				 NTTIME *last_change_time)
+				 NTTIME *last_change_time,
+				 uint32_t *max_subkeynamelen,
+				 uint32_t *max_valnamelen,
+				 uint32_t *max_valbufsize)
 {
 	if (key == NULL)
 		return WERR_INVALID_PARAM;
@@ -138,7 +141,9 @@ _PUBLIC_ WERROR reg_key_get_info(TALLOC_CTX *mem_ctx,
 
 	return key->context->ops->get_key_info(mem_ctx,
 					       key, classname, num_subkeys,
-					       num_values, last_change_time);
+					       num_values, last_change_time,
+					       max_subkeynamelen,
+					       max_valnamelen, max_valbufsize);
 }
 
 /**
diff --git a/source/lib/registry/ldb.c b/source/lib/registry/ldb.c
index c9697dd..259315c 100644
--- a/source/lib/registry/ldb.c
+++ b/source/lib/registry/ldb.c
@@ -41,16 +41,19 @@ static void reg_ldb_unpack_value(TALLOC_CTX *mem_ctx, struct ldb_message *msg,
 				 DATA_BLOB *data)
 {
 	const struct ldb_val *val;
+	uint32_t value_type;
+
 	if (name != NULL)
 		*name = talloc_strdup(mem_ctx,
 				      ldb_msg_find_attr_as_string(msg, "value",
 				      NULL));
 
+	value_type = ldb_msg_find_attr_as_uint(msg, "type", 0);
 	if (type != NULL)
-		*type = ldb_msg_find_attr_as_uint(msg, "type", 0);
+		*type = value_type; 
 	val = ldb_msg_find_ldb_val(msg, "data");
 
-	switch (*type)
+	switch (value_type)
 	{
 	case REG_SZ:
 	case REG_EXPAND_SZ:
@@ -342,6 +345,7 @@ WERROR reg_open_ldb_file(TALLOC_CTX *parent_ctx, const char *location,
 {
 	struct ldb_key_data *kd;
 	struct ldb_context *wrap;
+	struct ldb_message *attrs_msg;
 
 	if (location == NULL)
 		return WERR_INVALID_PARAM;
@@ -354,6 +358,15 @@ WERROR reg_open_ldb_file(TALLOC_CTX *parent_ctx, const char *location,
 		return WERR_FOOBAR;
 	}
 
+	attrs_msg = ldb_msg_new(wrap);
+	W_ERROR_HAVE_NO_MEMORY(attrs_msg);
+	attrs_msg->dn = ldb_dn_new(attrs_msg, wrap, "@ATTRIBUTES");
+	W_ERROR_HAVE_NO_MEMORY(attrs_msg->dn);
+	ldb_msg_add_string(attrs_msg, "key", "CASE_INSENSITIVE");
+	ldb_msg_add_string(attrs_msg, "value", "CASE_INSENSITIVE");
+
+	ldb_add(wrap, attrs_msg);
+
 	ldb_set_debug_stderr(wrap);
 
 	kd = talloc_zero(parent_ctx, struct ldb_key_data);
@@ -483,7 +496,10 @@ static WERROR ldb_get_key_info(TALLOC_CTX *mem_ctx,
 			       const char **classname,
 			       uint32_t *num_subkeys,
 			       uint32_t *num_values,
-			       NTTIME *last_change_time)
+			       NTTIME *last_change_time,
+			       uint32_t *max_subkeynamelen,
+			       uint32_t *max_valnamelen,
+			       uint32_t *max_valbufsize)
 {
 	struct ldb_key_data *kd = talloc_get_type(key, struct ldb_key_data);
 
@@ -504,6 +520,46 @@ static WERROR ldb_get_key_info(TALLOC_CTX *mem_ctx,
 	if (last_change_time != NULL)
 		*last_change_time = 0;
 
+	if (max_subkeynamelen != NULL) {
+		int i;
+		struct ldb_message_element *el;
+		W_ERROR_NOT_OK_RETURN(cache_subkeys(kd));
+
+		*max_subkeynamelen = 0;
+
+		for (i = 0; i < kd->subkey_count; i++) {
+			el = ldb_msg_find_element(kd->subkeys[i], "key");
+			*max_subkeynamelen = MAX(*max_subkeynamelen, el->values[0].length);
+		}
+	}
+
+	if (max_valnamelen != NULL || max_valbufsize != NULL) {
+		int i;
+		struct ldb_message_element *el;
+		W_ERROR_NOT_OK_RETURN(cache_values(kd));
+
+		if (max_valbufsize != NULL)
+			*max_valbufsize = 0;
+
+		if (max_valnamelen != NULL)
+			*max_valnamelen = 0;
+
+		for (i = 0; i < kd->value_count; i++) {
+			if (max_valnamelen != NULL) {
+				el = ldb_msg_find_element(kd->values[i], "value");
+				*max_valnamelen = MAX(*max_valnamelen, el->values[0].length);
+			}
+
+			if (max_valbufsize != NULL) {
+				DATA_BLOB data;
+				reg_ldb_unpack_value(mem_ctx, kd->values[i], NULL, 
+						     NULL, &data);
+				*max_valbufsize = MAX(*max_valbufsize, data.length);
+				talloc_free(data.data);
+			}
+		}
+	}
+
 	return WERR_OK;
 }
 
diff --git a/source/lib/registry/local.c b/source/lib/registry/local.c
index 14b4279..fa59f25 100644
--- a/source/lib/registry/local.c
+++ b/source/lib/registry/local.c
@@ -30,7 +30,7 @@ struct reg_key_path {
 };
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list