From 9d73becbb24fbde2e319e18e84af35d9efaeefda Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 7 Nov 2007 01:32:25 +0100 Subject: [PATCH] r25887: Build Samba-specific ldb modules as dso's. --- .bzrignore | 1 + source/dsdb/samdb/ldb_modules/config.mk | 25 +++++++++++++++++++++++-- source/lib/ldb/include/ldb_private.h | 2 ++ source/selftest/env/Samba4.pm | 2 ++ source/selftest/samba4_tests.sh | 4 ++-- source/selftest/selftest.pl | 1 + 6 files changed, 31 insertions(+), 4 deletions(-) diff --git a/.bzrignore b/.bzrignore index a4d1abe14eb..c9ad12a6359 100644 --- a/.bzrignore +++ b/.bzrignore @@ -206,3 +206,4 @@ source/lib/ldb/tdbtest.ldb source/lib/ldb/tdbtest.ldb *.po libtdb.so.* +libtalloc.so.* diff --git a/source/dsdb/samdb/ldb_modules/config.mk b/source/dsdb/samdb/ldb_modules/config.mk index 48f2ad38138..808fb580486 100644 --- a/source/dsdb/samdb/ldb_modules/config.mk +++ b/source/dsdb/samdb/ldb_modules/config.mk @@ -2,6 +2,7 @@ # Start MODULE ldb_objectguid [MODULE::ldb_objectguid] SUBSYSTEM = LIBLDB +OUTPUT_TYPE = SHARED_LIBRARY PRIVATE_DEPENDENCIES = LIBTALLOC LIBNDR NDR_MISC INIT_FUNCTION = objectguid_module_init OBJ_FILES = \ @@ -13,6 +14,7 @@ OBJ_FILES = \ # Start MODULE ldb_repl_mata_data [MODULE::ldb_repl_meta_data] SUBSYSTEM = LIBLDB +OUTPUT_TYPE = SHARED_LIBRARY PRIVATE_DEPENDENCIES = SAMDB LIBTALLOC LIBNDR NDR_MISC NDR_DRSUAPI NDR_DRSBLOBS INIT_FUNCTION = repl_meta_data_module_init OBJ_FILES = \ @@ -24,6 +26,7 @@ OBJ_FILES = \ # Start MODULE ldb_dsdb_cache [MODULE::ldb_dsdb_cache] SUBSYSTEM = LIBLDB +OUTPUT_TYPE = SHARED_LIBRARY PRIVATE_DEPENDENCIES = SAMDB LIBTALLOC INIT_FUNCTION = dsdb_cache_module_init OBJ_FILES = \ @@ -35,6 +38,7 @@ OBJ_FILES = \ # Start MODULE ldb_schema_fsmo [MODULE::ldb_schema_fsmo] SUBSYSTEM = LIBLDB +OUTPUT_TYPE = SHARED_LIBRARY PRIVATE_DEPENDENCIES = SAMDB LIBTALLOC INIT_FUNCTION = schema_fsmo_module_init OBJ_FILES = \ @@ -46,6 +50,7 @@ OBJ_FILES = \ # Start MODULE ldb_naming_fsmo [MODULE::ldb_naming_fsmo] SUBSYSTEM = LIBLDB +OUTPUT_TYPE = SHARED_LIBRARY PRIVATE_DEPENDENCIES = SAMDB LIBTALLOC INIT_FUNCTION = naming_fsmo_module_init OBJ_FILES = \ @@ -57,6 +62,7 @@ OBJ_FILES = \ # Start MODULE ldb_pdc_fsmo [MODULE::ldb_pdc_fsmo] SUBSYSTEM = LIBLDB +OUTPUT_TYPE = SHARED_LIBRARY PRIVATE_DEPENDENCIES = SAMDB LIBTALLOC INIT_FUNCTION = pdc_fsmo_module_init OBJ_FILES = \ @@ -68,6 +74,7 @@ OBJ_FILES = \ # Start MODULE ldb_samldb [MODULE::ldb_samldb] SUBSYSTEM = LIBLDB +OUTPUT_TYPE = SHARED_LIBRARY PRIVATE_DEPENDENCIES = LIBTALLOC INIT_FUNCTION = samldb_module_init OBJ_FILES = \ @@ -80,6 +87,7 @@ OBJ_FILES = \ # Start MODULE ldb_samba3sam [MODULE::ldb_samba3sam] SUBSYSTEM = LIBLDB +OUTPUT_TYPE = SHARED_LIBRARY INIT_FUNCTION = ldb_samba3sam_module_init PRIVATE_DEPENDENCIES = LIBTALLOC ldb_map SMBPASSWD NSS_WRAPPER OBJ_FILES = \ @@ -92,8 +100,9 @@ OBJ_FILES = \ # Start MODULE ldb_entryUUID [MODULE::ldb_entryUUID] SUBSYSTEM = LIBLDB +OUTPUT_TYPE = SHARED_LIBRARY INIT_FUNCTION = ldb_entryUUID_module_init -PRIVATE_DEPENDENCIES = LIBTALLOC +PRIVATE_DEPENDENCIES = LIBTALLOC ENABLE = YES OBJ_FILES = \ entryUUID.o @@ -118,6 +127,7 @@ OBJ_FILES = \ [MODULE::ldb_rootdse] SUBSYSTEM = LIBLDB PRIVATE_DEPENDENCIES = LIBTALLOC +OUTPUT_TYPE = SHARED_LIBRARY INIT_FUNCTION = rootdse_module_init OBJ_FILES = \ rootdse.o @@ -129,6 +139,7 @@ OBJ_FILES = \ # Start MODULE ldb_password_hash [MODULE::ldb_password_hash] SUBSYSTEM = LIBLDB +OUTPUT_TYPE = SHARED_LIBRARY INIT_FUNCTION = password_hash_module_init OBJ_FILES = password_hash.o PRIVATE_DEPENDENCIES = HEIMDAL_HDB_KEYS LIBTALLOC HEIMDAL_KRB5 @@ -140,6 +151,7 @@ PRIVATE_DEPENDENCIES = HEIMDAL_HDB_KEYS LIBTALLOC HEIMDAL_KRB5 # Start MODULE ldb_local_password [MODULE::ldb_local_password] PRIVATE_DEPENDENCIES = LIBTALLOC +OUTPUT_TYPE = SHARED_LIBRARY SUBSYSTEM = LIBLDB INIT_FUNCTION = local_password_module_init OBJ_FILES = local_password.o @@ -151,6 +163,7 @@ OBJ_FILES = local_password.o # Start MODULE ldb_kludge_acl [MODULE::ldb_kludge_acl] PRIVATE_DEPENDENCIES = LIBTALLOC LIBSECURITY +OUTPUT_TYPE = SHARED_LIBRARY SUBSYSTEM = LIBLDB INIT_FUNCTION = ldb_kludge_acl_init OBJ_FILES = \ @@ -163,6 +176,7 @@ OBJ_FILES = \ # Start MODULE ldb_extended_dn [MODULE::ldb_extended_dn] SUBSYSTEM = LIBLDB +OUTPUT_TYPE = SHARED_LIBRARY PRIVATE_DEPENDENCIES = LIBTALLOC INIT_FUNCTION = ldb_extended_dn_init OBJ_FILES = \ @@ -175,6 +189,7 @@ OBJ_FILES = \ # Start MODULE ldb_show_deleted [MODULE::ldb_show_deleted] SUBSYSTEM = LIBLDB +OUTPUT_TYPE = SHARED_LIBRARY PRIVATE_DEPENDENCIES = LIBTALLOC INIT_FUNCTION = ldb_show_deleted_init OBJ_FILES = \ @@ -187,6 +202,7 @@ OBJ_FILES = \ # Start MODULE ldb_partition [MODULE::ldb_partition] SUBSYSTEM = LIBLDB +OUTPUT_TYPE = SHARED_LIBRARY PRIVATE_DEPENDENCIES = LIBTALLOC INIT_FUNCTION = ldb_partition_init OBJ_FILES = \ @@ -199,6 +215,7 @@ OBJ_FILES = \ # Start MODULE ldb_schema [MODULE::ldb_schema] SUBSYSTEM = LIBLDB +OUTPUT_TYPE = SHARED_LIBRARY PRIVATE_DEPENDENCIES = LIBTALLOC INIT_FUNCTION = ldb_schema_init OBJ_FILES = \ @@ -209,8 +226,9 @@ OBJ_FILES = \ ################################################ # Start MODULE ldb_update_kt -[MODULE::ldb_update_kt] +[MODULE::ldb_update_keytab] SUBSYSTEM = LIBLDB +OUTPUT_TYPE = SHARED_LIBRARY PRIVATE_DEPENDENCIES = LIBTALLOC CREDENTIALS_KRB5 #Also depends on credentials, but that would loop INIT_FUNCTION = ldb_update_kt_init @@ -224,6 +242,7 @@ OBJ_FILES = \ # Start MODULE ldb_objectclass [MODULE::ldb_objectclass] INIT_FUNCTION = ldb_objectclass_init +OUTPUT_TYPE = SHARED_LIBRARY CFLAGS = -Ilib/ldb/include PRIVATE_DEPENDENCIES = LIBTALLOC SUBSYSTEM = LIBLDB @@ -236,6 +255,7 @@ OBJ_FILES = \ # Start MODULE ldb_subtree_rename [MODULE::ldb_subtree_rename] INIT_FUNCTION = ldb_subtree_rename_init +OUTPUT_TYPE = SHARED_LIBRARY CFLAGS = -Ilib/ldb/include PRIVATE_DEPENDENCIES = LIBTALLOC SUBSYSTEM = LIBLDB @@ -249,6 +269,7 @@ OBJ_FILES = \ [MODULE::ldb_linked_attributes] INIT_FUNCTION = ldb_linked_attributes_init CFLAGS = -Ilib/ldb/include +OUTPUT_TYPE = SHARED_LIBRARY PRIVATE_DEPENDENCIES = LIBTALLOC SAMDB SUBSYSTEM = LIBLDB OBJ_FILES = \ diff --git a/source/lib/ldb/include/ldb_private.h b/source/lib/ldb/include/ldb_private.h index e07083bef75..f88c55664de 100644 --- a/source/lib/ldb/include/ldb_private.h +++ b/source/lib/ldb/include/ldb_private.h @@ -73,6 +73,8 @@ struct ldb_module_ops { typedef int (*ldb_connect_fn) (struct ldb_context *ldb, const char *url, unsigned int flags, const char *options[], struct ldb_module **module); +const char *ldb_default_modules_dir(void); + /* schema related information needed for matching rules */ diff --git a/source/selftest/env/Samba4.pm b/source/selftest/env/Samba4.pm index bf8f35990cd..d0f6d522e98 100644 --- a/source/selftest/env/Samba4.pm +++ b/source/selftest/env/Samba4.pm @@ -499,6 +499,7 @@ sub provision($$$$$$) ncalrpc dir = $ncalrpcdir lock dir = $lockdir setup directory = $self->{setupdir} + modules dir = $self->{bindir}/modules js include = $srcdir/scripting/libjs winbindd socket directory = $winbindd_socket_dir winbind separator = / @@ -646,6 +647,7 @@ nogroup:x:65534:nobody DOMAIN => $domain, USERNAME => $username, REALM => $realm, + LDB_MODULES_PATH => "$self->{bindir}/modules/ldb", PASSWORD => $password, LDAPDIR => $ldapdir, WINBINDD_SOCKET_DIR => $winbindd_socket_dir, diff --git a/source/selftest/samba4_tests.sh b/source/selftest/samba4_tests.sh index 6b6a48769fc..3fde4f3c2f7 100755 --- a/source/selftest/samba4_tests.sh +++ b/source/selftest/samba4_tests.sh @@ -31,7 +31,7 @@ plantest "js.base" dc "$SCRIPTDIR/base.js" $CONFIGURATION plantest "js.samr" dc "$SCRIPTDIR/samr.js" $CONFIGURATION ncalrpc: -U\$USERNAME%\$PASSWORD plantest "js.echo" dc "$SCRIPTDIR/echo.js" $CONFIGURATION ncalrpc: -U\$USERNAME%\$PASSWORD #plantest "ejsnet.js" dc "$SCRIPTDIR/ejsnet.js" $CONFIGURATION -U\$USERNAME%\$PASSWORD \$DOMAIN ejstestuser -plantest "js.ldb" none "$SCRIPTDIR/ldb.js" `pwd` $CONFIGURATION +plantest "js.ldb" none "$SCRIPTDIR/ldb.js" `pwd` $CONFIGURATION -d 10 plantest "js.winreg" dc $samba4srcdir/scripting/bin/winreg $CONFIGURATION ncalrpc: 'HKLM' -U\$USERNAME%\$PASSWORD # Simple tests for LDAP and CLDAP @@ -56,7 +56,7 @@ LDBDIR=$samba4srcdir/lib/ldb export LDBDIR plantest "ldb" none $LDBDIR/tests/test-tdb.sh -plantest "js.ldap" dc $SCRIPTDIR/ldap.js $CONFIGURATION \$SERVER -U\$USERNAME%\$PASSWORD +plantest "js.ldap" dc $SCRIPTDIR/ldap.js $CONFIGURATION -d 10 \$SERVER -U\$USERNAME%\$PASSWORD # Tests for RPC diff --git a/source/selftest/selftest.pl b/source/selftest/selftest.pl index ae97d502ee1..c84f1510435 100755 --- a/source/selftest/selftest.pl +++ b/source/selftest/selftest.pl @@ -546,6 +546,7 @@ sub write_clientconf($$) torture:basedir = $prefix_abs/client #We don't want to pass our self-tests if the PAC code is wrong gensec:require_pac = true + modules dir = $prefix_abs/../bin/modules "; close(CF); }