[SCM] Samba Shared Repository - branch master updated
Andrew Tridgell
tridge at samba.org
Tue Dec 7 22:13:01 MST 2010
The branch, master has been updated
via b352ecb waf: added -Wmissing-prototypes to build
via be99d84 waf: make all generators depend on their rules
via 16c36a8 s3-waf: fixed version number handling
via 4debe69 s4-heimdal: enable symbol versioning in heimdal
via 3513421 waf: use -Wl,--version-script if available
via d0c93ba waf: added configure test for -Wl,--version-script
via 84ac1f8 s4-dns: dlz_bind9 doesn't need to link to gensec any more
via d5bf525 s4-waf: get the version number right on private libraries
via 18177f1 s4-dns: use ldb hooks for samba extensions in dlz_bind9
via cba7397 s4-ldb: use RTLD_DEEPBIND if available for ldb modules
via 591e18a s4-dns: allow a remote ldap server to be used with dlz_bind9
via be53dcd s4-dsdb: register samba handlers in dsdb module
via 1b016f5 s4-ldb: ensure ldb_register_samba_handlers() is not done twice
via 9013f93 wintest: use --add-ref for RODC replication
via 545932f samba-tools: more reasonable defaults for samba-tool commands
via 249afc8 samba-tools: export doesn't need any credentials
from d7cd2ad s4-provision Always run slaptest to convert the config file
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit b352ecb1cf3bfb92cf8a2479a3ebe4d80ee2de60
Author: Andrew Tridgell <tridge at samba.org>
Date: Wed Dec 8 15:04:33 2010 +1100
waf: added -Wmissing-prototypes to build
This ensures that we always have a prototype for any function we
declare
Autobuild-User: Andrew Tridgell <tridge at samba.org>
Autobuild-Date: Wed Dec 8 06:12:07 CET 2010 on sn-devel-104
commit be99d84972de8fd64c90aea3be4e0f06dd060065
Author: Andrew Tridgell <tridge at samba.org>
Date: Wed Dec 8 15:03:35 2010 +1100
waf: make all generators depend on their rules
this ensures we rebuild when a constructed rule changes
commit 16c36a8cb56f3a74927cdb7c46dfb6158f328beb
Author: Andrew Tridgell <tridge at samba.org>
Date: Wed Dec 8 14:58:12 2010 +1100
s3-waf: fixed version number handling
commit 4debe69b731b69aebd95386c2f1a36bb2a53d047
Author: Andrew Tridgell <tridge at samba.org>
Date: Wed Dec 8 14:57:31 2010 +1100
s4-heimdal: enable symbol versioning in heimdal
Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>
Pair-Programmed-With: Jelmer Vernooij <jelmer at samba.org>
commit 35134214ae819ad26ec388fa44dd37b24d72d3c4
Author: Andrew Tridgell <tridge at samba.org>
Date: Wed Dec 8 14:52:43 2010 +1100
waf: use -Wl,--version-script if available
This enables symbol version on our libraries, if the system supports
it
If the library is a public library, then set the symbol version based
on the major number. If it is a private library then set it based on
the full version number (which will include the git hash if
available).
This ensures that applications using our libraries don't use symbols
from other libraries that they may be linked to. It also ensures we
only use the right version of any private libraries.
Note that the linker ends up generating both a version and unversioned
symbol for all symbols. This means existing users of our public
libraries will continue to work, with symbols resolved to the
unversioned symbol. When applications are re-linked they will bind to
the specific symbol version.
Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>
Pair-Programmed-With: Jelmer Vernooij <jelmer at samba.org>
commit d0c93ba115a942403982011d01c443aa18513fe7
Author: Andrew Tridgell <tridge at samba.org>
Date: Wed Dec 8 11:26:32 2010 +1100
waf: added configure test for -Wl,--version-script
this checks that the linker supports --version-script
Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>
commit 84ac1f8f6a633f363f64a0f49d063ae7750d11b5
Author: Andrew Tridgell <tridge at samba.org>
Date: Wed Dec 8 11:29:34 2010 +1100
s4-dns: dlz_bind9 doesn't need to link to gensec any more
Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>
commit d5bf5255917862f35bb6849a407539c43cde2b04
Author: Andrew Tridgell <tridge at samba.org>
Date: Wed Dec 8 11:25:28 2010 +1100
s4-waf: get the version number right on private libraries
use the first digit of the version number for the library version
Pair-Programmed-With: Jelmer Vernooij <jelmer at samba.org>
commit 18177f1e52e2767e1266f44ea32a8f8d82a17b74
Author: Andrew Tridgell <tridge at samba.org>
Date: Wed Dec 8 09:58:52 2010 +1100
s4-dns: use ldb hooks for samba extensions in dlz_bind9
this avoids linking dlz_bind9 directly to heimdal, which allows a
RTLD_DEEPBIND in ldb module loading to find the right kerberos version
Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>
commit cba73975c2868bb657962229c0c5e77009c0197d
Author: Andrew Tridgell <tridge at samba.org>
Date: Wed Dec 8 09:41:25 2010 +1100
s4-ldb: use RTLD_DEEPBIND if available for ldb modules
this allows us to avoid issues with ldb using heimdal while an
application using ldb using MIT kerberos
Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>
commit 591e18a12c2b6641351f22579c76aee34f2ceb12
Author: Andrew Tridgell <tridge at samba.org>
Date: Wed Dec 8 09:04:49 2010 +1100
s4-dns: allow a remote ldap server to be used with dlz_bind9
this allows for configs like this:
dlz "Samba zone" {
database "dlopen /usr/lib/samba/modules/bind9/dlz_bind9.so
-H ldap://10.0.0.4 -Uadministrator at v2.tridgell.net%penguin -k no";
};
commit be53dcd8bcfab2f8f6b25b375cd412175d5ab74a
Author: Andrew Tridgell <tridge at samba.org>
Date: Wed Dec 8 08:22:21 2010 +1100
s4-dsdb: register samba handlers in dsdb module
commit 1b016f58cee801d12b452a89a4d4ba959da61b93
Author: Andrew Tridgell <tridge at samba.org>
Date: Wed Dec 8 08:22:07 2010 +1100
s4-ldb: ensure ldb_register_samba_handlers() is not done twice
Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>
commit 9013f93df147de8c5f3c8bf821765053c29abbe8
Author: Andrew Tridgell <tridge at samba.org>
Date: Wed Dec 8 08:21:40 2010 +1100
wintest: use --add-ref for RODC replication
this forces the creation of the repsTo attribute, and allows more
complete testing of RODC replication
commit 545932fda590d4c888c0f60fed7a36c1659f0018
Author: Andrew Tridgell <tridge at samba.org>
Date: Wed Dec 8 08:20:54 2010 +1100
samba-tools: more reasonable defaults for samba-tool commands
- fallback to machine account where possible
- default to local hostname where this is reasonable
commit 249afc8906bc33ed1e23f50f5c28a8ba0b8354c9
Author: Andrew Tridgell <tridge at samba.org>
Date: Wed Dec 8 08:19:25 2010 +1100
samba-tools: export doesn't need any credentials
Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>
-----------------------------------------------------------------------
Summary of changes:
buildtools/wafsamba/samba_autoconf.py | 2 +-
buildtools/wafsamba/samba_conftests.py | 10 ++-
buildtools/wafsamba/samba_deps.py | 3 +-
buildtools/wafsamba/samba_install.py | 3 +
buildtools/wafsamba/samba_version.py | 13 +++
buildtools/wafsamba/wafsamba.py | 20 ++++-
buildtools/wafsamba/wscript | 9 ++
source3/wscript | 15 +---
source3/wscript_build | 3 +
source4/dns_server/dlz_bind9.c | 91 ++++++++++++++------
source4/dns_server/wscript_build | 2 +-
source4/dsdb/samdb/ldb_modules/samba_dsdb.c | 6 ++
source4/heimdal_build/wscript_build | 58 ++++++++-----
source4/lib/ldb-samba/ldif_handlers.c | 12 ++-
source4/lib/ldb/common/ldb_modules.c | 14 +++-
source4/scripting/python/samba/getopt.py | 11 ++-
.../{tests/dcerpc/__init__.py => netcmd/common.py} | 17 ++--
.../scripting/python/samba/netcmd/domainlevel.py | 2 +-
source4/scripting/python/samba/netcmd/drs.py | 51 ++++++------
.../scripting/python/samba/netcmd/enableaccount.py | 2 +-
source4/scripting/python/samba/netcmd/export.py | 3 +-
source4/scripting/python/samba/netcmd/fsmo.py | 2 +-
source4/scripting/python/samba/netcmd/gpo.py | 8 +--
source4/scripting/python/samba/netcmd/group.py | 8 +-
source4/scripting/python/samba/netcmd/ldapcmp.py | 2 +-
source4/scripting/python/samba/netcmd/machinepw.py | 2 +-
source4/scripting/python/samba/netcmd/rodc.py | 6 +-
source4/scripting/python/samba/netcmd/time.py | 10 ++-
source4/scripting/python/samba/netcmd/user.py | 4 +-
source4/wscript | 22 +----
source4/wscript_build | 3 +
wintest/test-s4-howto.py | 21 ++++-
32 files changed, 285 insertions(+), 150 deletions(-)
copy source4/scripting/python/samba/{tests/dcerpc/__init__.py => netcmd/common.py} (68%)
Changeset truncated at 500 lines:
diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py
index 03031a7..b6d0b35 100644
--- a/buildtools/wafsamba/samba_autoconf.py
+++ b/buildtools/wafsamba/samba_autoconf.py
@@ -587,7 +587,7 @@ def SAMBA_CONFIG_H(conf, path=None):
if Options.options.developer:
# we add these here to ensure that -Wstrict-prototypes is not set during configure
- conf.ADD_CFLAGS('-Wall -g -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Werror-implicit-function-declaration -Wformat=2 -Wno-format-y2k',
+ conf.ADD_CFLAGS('-Wall -g -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Werror-implicit-function-declaration -Wformat=2 -Wno-format-y2k -Wmissing-prototypes',
testflags=True)
conf.env.DEVELOPER_MODE = True
diff --git a/buildtools/wafsamba/samba_conftests.py b/buildtools/wafsamba/samba_conftests.py
index 4811614..2246ac3 100644
--- a/buildtools/wafsamba/samba_conftests.py
+++ b/buildtools/wafsamba/samba_conftests.py
@@ -133,7 +133,7 @@ int foo(int v) {
# into several parts. I'd quite like to create a set of CHECK_COMPOUND()
# functions that make writing complex compound tests like this much easier
@conf
-def CHECK_LIBRARY_SUPPORT(conf, rpath=False, msg=None):
+def CHECK_LIBRARY_SUPPORT(conf, rpath=False, version_script=False, msg=None):
'''see if the platform supports building libraries'''
if msg is None:
@@ -171,9 +171,17 @@ def CHECK_LIBRARY_SUPPORT(conf, rpath=False, msg=None):
bld.rescan(bld.srcnode)
+ ldflags = []
+ if version_script:
+ ldflags.append("-Wl,--version-script=%s/vscript" % bld.path.abspath())
+ dest = open(os.path.join(dir,'vscript'), 'w')
+ dest.write('TEST_1.0A2 { global: *; };\n')
+ dest.close()
+
bld(features='cc cshlib',
source='libdir/lib1.c',
target='libdir/lib1',
+ ldflags=ldflags,
name='lib1')
o = bld(features='cc cprogram',
diff --git a/buildtools/wafsamba/samba_deps.py b/buildtools/wafsamba/samba_deps.py
index 91737d5..0ea9660 100644
--- a/buildtools/wafsamba/samba_deps.py
+++ b/buildtools/wafsamba/samba_deps.py
@@ -952,7 +952,8 @@ def show_object_duplicates(bld, tgt_list):
######################################################################
# this provides a way to save our dependency calculations between runs
savedeps_version = 3
-savedeps_inputs = ['samba_deps', 'samba_includes', 'local_include', 'local_include_first', 'samba_cflags', 'source', 'grouping_library']
+savedeps_inputs = ['samba_deps', 'samba_includes', 'local_include', 'local_include_first', 'samba_cflags',
+ 'source', 'grouping_library', 'ldflags']
savedeps_outputs = ['uselib', 'uselib_local', 'add_objects', 'includes', 'ccflags', 'ldflags', 'samba_deps_extended']
savedeps_outenv = ['INC_PATHS']
savedeps_envvars = ['NONSHARED_BINARIES', 'GLOBAL_DEPENDENCIES', 'EXTRA_CFLAGS', 'EXTRA_LDFLAGS' ]
diff --git a/buildtools/wafsamba/samba_install.py b/buildtools/wafsamba/samba_install.py
index fcbf4ea..327227f 100644
--- a/buildtools/wafsamba/samba_install.py
+++ b/buildtools/wafsamba/samba_install.py
@@ -128,6 +128,9 @@ def install_library(self):
t.env.append_value('LINKFLAGS', t.env.SONAME_ST % install_link)
t.env.SONAME_ST = ''
+ if install_name == install_link:
+ install_link = None
+
# tell waf to install the library
bld.install_as(os.path.join(install_path, install_name),
os.path.join(self.path.abspath(bld.env), inst_name))
diff --git a/buildtools/wafsamba/samba_version.py b/buildtools/wafsamba/samba_version.py
index 4f99b2c..5804afb 100644
--- a/buildtools/wafsamba/samba_version.py
+++ b/buildtools/wafsamba/samba_version.py
@@ -1,5 +1,6 @@
import os
import Utils
+import samba_utils
def bzr_version_summary(path):
try:
@@ -246,3 +247,15 @@ def samba_version_file(version_file, path, env=None):
raise
return SambaVersion(version_dict, path, env=env)
+
+
+
+def load_version(env=None):
+ '''load samba versions either from ./VERSION or git
+ return a version object for detailed breakdown'''
+ if not env:
+ env = samba_utils.LOAD_ENVIRONMENT()
+
+ version = samba_version_file("./VERSION", "..", env)
+ Utils.g_module.VERSION = version.STRING
+ return version
diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py
index 1d3ced1..3ce4455 100644
--- a/buildtools/wafsamba/wafsamba.py
+++ b/buildtools/wafsamba/wafsamba.py
@@ -103,6 +103,7 @@ def SAMBA_LIBRARY(bld, libname, source,
vnum=None,
soname=None,
cflags='',
+ ldflags='',
external_library=False,
realname=None,
autoproto=None,
@@ -188,11 +189,24 @@ def SAMBA_LIBRARY(bld, libname, source,
else:
bundled_name = PRIVATE_NAME(bld, libname, bundled_extension, private_library)
+ ldflags = TO_LIST(ldflags)
+
if private_library:
if vnum:
Logs.error("vnum is invalid for private libraries")
sys.exit(1)
- vnum = Utils.g_module.VERSION
+ vnum = Utils.g_module.VERSION.split(".")[0]
+ version = "%s_%s" % (Utils.g_module.APPNAME, Utils.g_module.VERSION)
+ else:
+ version = "%s_%s" % (Utils.g_module.APPNAME, Utils.g_module.VERSION.split(".")[0])
+
+ if bld.env.HAVE_LD_VERSION_SCRIPT:
+ vscript = "%s.vscript" % libname
+ bld.SAMBA_GENERATOR(vscript,
+ rule="echo %s \{ global: \*\; \}\; > ${TGT}" % version.replace("-","_").upper(),
+ group='vscripts',
+ target=vscript)
+ ldflags.append("-Wl,--version-script=%s/%s" % (bld.path.abspath(bld.env), vscript))
features = 'cc cshlib symlink_lib install_lib'
if target_type == 'PYTHON':
@@ -213,6 +227,7 @@ def SAMBA_LIBRARY(bld, libname, source,
source = [],
target = bundled_name,
depends_on = depends_on,
+ ldflags = ldflags,
samba_deps = deps,
samba_includes = includes,
local_include = local_include,
@@ -505,6 +520,8 @@ def SAMBA_GENERATOR(bld, name, rule, source='', target='',
on_results=True,
before='cc',
ext_out='.c',
+ samba_type='GENERATOR',
+ vars = [rule],
name=name)
if always:
@@ -525,6 +542,7 @@ def SETUP_BUILD_GROUPS(bld):
bld.env['USING_BUILD_GROUPS'] = True
bld.add_group('setup')
bld.add_group('build_compiler_source')
+ bld.add_group('vscripts')
bld.add_group('base_libraries')
bld.add_group('generators')
bld.add_group('compiler_prototypes')
diff --git a/buildtools/wafsamba/wscript b/buildtools/wafsamba/wscript
index 0d91237..f355125 100644
--- a/buildtools/wafsamba/wscript
+++ b/buildtools/wafsamba/wscript
@@ -269,6 +269,7 @@ def configure(conf):
# check for rpath
if not conf.env.DISABLE_SHARED and conf.CHECK_LIBRARY_SUPPORT(rpath=True):
+ support_rpath = True
conf.env.RPATH_ON_BUILD = not Options.options.disable_rpath_build
conf.env.RPATH_ON_INSTALL = (conf.env.RPATH_ON_BUILD and
not Options.options.disable_rpath_install)
@@ -277,6 +278,7 @@ def configure(conf):
conf.env.RPATH_ON_INSTALL_PRIVATE = (
not Options.options.disable_rpath_private_install)
else:
+ support_rpath = False
conf.env.RPATH_ON_INSTALL = False
conf.env.RPATH_ON_BUILD = False
conf.env.RPATH_ON_INSTALL_PRIVATE = False
@@ -286,6 +288,13 @@ def configure(conf):
# the user can of course always override it.
conf.env.PRIVATELIBDIR = conf.env.LIBDIR
+ if not conf.env.DISABLE_SHARED and conf.CHECK_LIBRARY_SUPPORT(rpath=support_rpath,
+ version_script=True,
+ msg='-Wl,--version-script support'):
+ conf.env.HAVE_LD_VERSION_SCRIPT = True
+ else:
+ conf.env.HAVE_LD_VERSION_SCRIPT = False
+
# we should use the PIC options in waf instead
# Some compilo didn't support -fPIC but just print a warning
if conf.env['COMPILER_CC'] == "suncc":
diff --git a/source3/wscript b/source3/wscript
index da9a9db..2bf6fb8 100644
--- a/source3/wscript
+++ b/source3/wscript
@@ -11,20 +11,9 @@ from optparse import SUPPRESS_HELP
sys.path.insert(0, srcdir+"/buildtools/wafsamba")
import wafsamba, Options
import build.charset
-import samba_utils
+import samba_utils, samba_version
import samba3
-def load_version(env=None):
- '''load samba versions either from ./VERSION or git
- return a version object for detailed breakdown'''
- import samba_utils, Utils
- if not env:
- env = samba_utils.LOAD_ENVIRONMENT()
-
- version = wafsamba.samba_version_file("./VERSION", "..", env=env)
- Utils.g_module.VERSION = version.STRING
- return version
-
def set_options(opt):
opt.BUILTIN_DEFAULT('NONE')
opt.PRIVATE_EXTENSION_DEFAULT('s3')
@@ -68,7 +57,7 @@ def set_options(opt):
def configure(conf):
from samba_utils import TO_LIST
- version = load_version(env=conf.env)
+ version = samba_version.load_version(env=conf.env)
conf.DEFINE('CONFIG_H_IS_FROM_SAMBA', 1)
conf.DEFINE('_SAMBA_BUILD_', version.MAJOR, add_to_cflags=True)
diff --git a/source3/wscript_build b/source3/wscript_build
index 983b670..cf5293b 100644
--- a/source3/wscript_build
+++ b/source3/wscript_build
@@ -1,6 +1,7 @@
#!/usr/bin/env python
from samba_utils import *
+import samba_version
TDB_LIB_SRC = '''lib/util_tdb.c ../lib/util/util_tdb.c
lib/dbwrap.c lib/dbwrap_tdb.c
@@ -735,6 +736,8 @@ t.env.BUILDDIR = bld.path.abspath()
bld.SETUP_BUILD_GROUPS()
+samba_version.load_version(bld.env)
+
bld.SAMBA_MKVERSION('include/version.h')
bld.RECURSE('../lib/replace')
diff --git a/source4/dns_server/dlz_bind9.c b/source4/dns_server/dlz_bind9.c
index 2631272..573a0e8 100644
--- a/source4/dns_server/dlz_bind9.c
+++ b/source4/dns_server/dlz_bind9.c
@@ -22,11 +22,15 @@
#include "includes.h"
#include "talloc.h"
#include "param/param.h"
+#include "lib/events/events.h"
#include "dsdb/samdb/samdb.h"
#include "dsdb/common/util.h"
#include "auth/session.h"
+#include "auth/gensec/gensec.h"
#include "gen_ndr/ndr_dnsp.h"
#include "lib/cmdline/popt_common.h"
+#include "lib/cmdline/popt_credentials.h"
+#include "ldb_module.h"
#include "dlz_bind9.h"
struct dlz_bind9_data {
@@ -217,32 +221,53 @@ static isc_result_t b9_putnamedrr(struct dlz_bind9_data *state,
return result;
}
+struct b9_options {
+ const char *url;
+};
/*
parse options
*/
static isc_result_t parse_options(struct dlz_bind9_data *state,
- unsigned int argc, char *argv[])
+ unsigned int argc, char *argv[],
+ struct b9_options *options)
{
int opt;
poptContext pc;
struct poptOption long_options[] = {
- POPT_COMMON_SAMBA
+ { "url", 'H', POPT_ARG_STRING, &options->url, 0, "database URL", "URL" },
{ NULL }
};
+ struct poptOption **popt_options;
+ int ret;
+
+ popt_options = ldb_module_popt_options(state->samdb);
+ (*popt_options) = long_options;
+
+ ret = ldb_modules_hook(state->samdb, LDB_MODULE_HOOK_CMDLINE_OPTIONS);
+ if (ret != LDB_SUCCESS) {
+ state->log(ISC_LOG_ERROR, "dlz samba: failed cmdline hook");
+ return ISC_R_FAILURE;
+ }
- pc = poptGetContext("dlz_bind9", argc, (const char **)argv, long_options,
+ pc = poptGetContext("dlz_bind9", argc, (const char **)argv, *popt_options,
POPT_CONTEXT_KEEP_FIRST);
while ((opt = poptGetNextOpt(pc)) != -1) {
switch (opt) {
default:
- state->log(ISC_LOG_ERROR, "Invalid option %s: %s",
+ state->log(ISC_LOG_ERROR, "dlz samba: Invalid option %s: %s",
poptBadOption(pc, 0), poptStrerror(opt));
return ISC_R_FAILURE;
}
}
+ ret = ldb_modules_hook(state->samdb, LDB_MODULE_HOOK_CMDLINE_PRECONNECT);
+ if (ret != LDB_SUCCESS) {
+ state->log(ISC_LOG_ERROR, "dlz samba: failed cmdline preconnect");
+ return ISC_R_FAILURE;
+ }
+
return ISC_R_SUCCESS;
}
@@ -258,10 +283,12 @@ _PUBLIC_ isc_result_t dlz_create(const char *dlzname,
const char *helper_name;
va_list ap;
isc_result_t result;
- const char *url;
TALLOC_CTX *tmp_ctx;
int ret;
struct ldb_dn *dn;
+ struct b9_options options;
+
+ ZERO_STRUCT(options);
state = talloc_zero(NULL, struct dlz_bind9_data);
if (state == NULL) {
@@ -277,18 +304,7 @@ _PUBLIC_ isc_result_t dlz_create(const char *dlzname,
}
va_end(ap);
- result = parse_options(state, argc, argv);
- if (result != ISC_R_SUCCESS) {
- goto failed;
- }
-
- state->lp = loadparm_init_global(true);
- if (state->lp == NULL) {
- result = ISC_R_NOMEMORY;
- goto failed;
- }
-
- state->ev_ctx = tevent_context_init(state);
+ state->ev_ctx = s4_event_context_init(state);
if (state->ev_ctx == NULL) {
result = ISC_R_NOMEMORY;
goto failed;
@@ -301,17 +317,38 @@ _PUBLIC_ isc_result_t dlz_create(const char *dlzname,
goto failed;
}
- url = talloc_asprintf(tmp_ctx, "ldapi://%s",
- private_path(tmp_ctx, state->lp, "ldap_priv/ldapi"));
- if (url == NULL) {
+ result = parse_options(state, argc, argv, &options);
+ if (result != ISC_R_SUCCESS) {
+ goto failed;
+ }
+
+ state->lp = loadparm_init_global(true);
+ if (state->lp == NULL) {
result = ISC_R_NOMEMORY;
goto failed;
}
- ret = ldb_connect(state->samdb, url, 0, NULL);
+ if (options.url == NULL) {
+ options.url = talloc_asprintf(tmp_ctx, "ldapi://%s",
+ private_path(tmp_ctx, state->lp, "ldap_priv/ldapi"));
+ if (options.url == NULL) {
+ result = ISC_R_NOMEMORY;
+ goto failed;
+ }
+ }
+
+ ret = ldb_connect(state->samdb, options.url, 0, NULL);
if (ret == -1) {
state->log(ISC_LOG_ERROR, "samba dlz_bind9: Failed to connect to %s - %s",
- url, ldb_errstring(state->samdb));
+ options.url, ldb_errstring(state->samdb));
+ result = ISC_R_FAILURE;
+ goto failed;
+ }
+
+ ret = ldb_modules_hook(state->samdb, LDB_MODULE_HOOK_CMDLINE_POSTCONNECT);
+ if (ret != LDB_SUCCESS) {
+ state->log(ISC_LOG_ERROR, "samba dlz_bind9: Failed postconnect for %s - %s",
+ options.url, ldb_errstring(state->samdb));
result = ISC_R_FAILURE;
goto failed;
}
@@ -319,7 +356,7 @@ _PUBLIC_ isc_result_t dlz_create(const char *dlzname,
dn = ldb_get_default_basedn(state->samdb);
if (dn == NULL) {
state->log(ISC_LOG_ERROR, "samba dlz_bind9: Unable to get basedn for %s - %s",
- url, ldb_errstring(state->samdb));
+ options.url, ldb_errstring(state->samdb));
result = ISC_R_FAILURE;
goto failed;
}
@@ -364,10 +401,10 @@ _PUBLIC_ isc_result_t dlz_findzonedb(void *driverarg, void *dbdata, const char *
/*
lookup one record
*/
-_PUBLIC_ isc_result_t dlz_lookup_types(struct dlz_bind9_data *state,
- const char *zone, const char *name,
- void *driverarg, dns_sdlzlookup_t *lookup,
- const char **types)
+static isc_result_t dlz_lookup_types(struct dlz_bind9_data *state,
+ const char *zone, const char *name,
+ void *driverarg, dns_sdlzlookup_t *lookup,
+ const char **types)
{
struct ldb_dn *dn;
TALLOC_CTX *tmp_ctx = talloc_new(state);
diff --git a/source4/dns_server/wscript_build b/source4/dns_server/wscript_build
index 884d0c1..3500b03 100644
--- a/source4/dns_server/wscript_build
+++ b/source4/dns_server/wscript_build
@@ -14,4 +14,4 @@ bld.SAMBA_LIBRARY('dlz_bind9',
source='dlz_bind9.c',
private_library=True,
link_name='modules/bind9/dlz_bind9.so',
- deps='samba-hostconfig ldbsamba samba-util popt POPT_SAMBA')
+ deps='samba-hostconfig ldbsamba samba-util popt')
diff --git a/source4/dsdb/samdb/ldb_modules/samba_dsdb.c b/source4/dsdb/samdb/ldb_modules/samba_dsdb.c
index f6c8e3c..df2cd98 100644
--- a/source4/dsdb/samdb/ldb_modules/samba_dsdb.c
+++ b/source4/dsdb/samdb/ldb_modules/samba_dsdb.c
@@ -218,6 +218,12 @@ static int samba_dsdb_init(struct ldb_module *module)
return ldb_oom(ldb);
}
+ ret = ldb_register_samba_handlers(ldb);
+ if (ret != LDB_SUCCESS) {
+ talloc_free(tmp_ctx);
+ return ret;
+ }
+
samba_dsdb_dn = ldb_dn_new(tmp_ctx, ldb, "@SAMBA_DSDB");
if (!samba_dsdb_dn) {
talloc_free(tmp_ctx);
diff --git a/source4/heimdal_build/wscript_build b/source4/heimdal_build/wscript_build
index 3e792d3..5607701 100644
--- a/source4/heimdal_build/wscript_build
+++ b/source4/heimdal_build/wscript_build
@@ -1,6 +1,6 @@
#!/usr/bin/env python
-import os
+import os, Utils, Build
from samba_utils import SET_TARGET_TYPE
from samba_autoconf import CURRENT_CFLAGS
@@ -181,6 +181,27 @@ def HEIMDAL_AUTOPROTO_PRIVATE(header, source):
HEIMDAL_AUTOPROTO(header, source, options='-q -P comment -p')
+def HEIMDAL_GENERATOR(name, rule, source='', target='',
+ group='generators'):
+ '''A generic source generator target'''
+
+ if not SET_TARGET_TYPE(bld, name, 'GENERATOR'):
+ return
+
+ bld.set_group(group)
+ return bld(
+ rule=rule,
+ source=source,
+ target=target,
+ shell=isinstance(rule, str),
+ on_results=True,
+ before='cc',
+ ext_out='.c',
+ vars=[rule],
+ samba_type='GENERATOR',
+ name=name)
+
+
def HEIMDAL_LIBRARY(libname, source, deps, vnum,
includes='',
cflags='',
@@ -206,13 +227,27 @@ def HEIMDAL_LIBRARY(libname, source, deps, vnum,
--
Samba Shared Repository
More information about the samba-cvs
mailing list