Commit b424b387 authored by Mathieu Parent's avatar Mathieu Parent

New upstream version 1.2.2

parent eef09d75
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
pyldb_Dn_FromDn: PyObject *(struct ldb_dn *)
pyldb_Object_AsDn: bool (TALLOC_CTX *, PyObject *, struct ldb_context *, struct ldb_dn **)
pyldb_Dn_FromDn: PyObject *(struct ldb_dn *)
pyldb_Object_AsDn: bool (TALLOC_CTX *, PyObject *, struct ldb_context *, struct ldb_dn **)
pyldb_Dn_FromDn: PyObject *(struct ldb_dn *)
pyldb_Object_AsDn: bool (TALLOC_CTX *, PyObject *, struct ldb_context *, struct ldb_dn **)
pyldb_Dn_FromDn: PyObject *(struct ldb_dn *)
pyldb_Object_AsDn: bool (TALLOC_CTX *, PyObject *, struct ldb_context *, struct ldb_dn **)
pyldb_Dn_FromDn: PyObject *(struct ldb_dn *)
pyldb_Object_AsDn: bool (TALLOC_CTX *, PyObject *, struct ldb_context *, struct ldb_dn **)
pyldb_Dn_FromDn: PyObject *(struct ldb_dn *)
pyldb_Object_AsDn: bool (TALLOC_CTX *, PyObject *, struct ldb_context *, struct ldb_dn **)
pyldb_Dn_FromDn: PyObject *(struct ldb_dn *)
pyldb_Object_AsDn: bool (TALLOC_CTX *, PyObject *, struct ldb_context *, struct ldb_dn **)
pyldb_Dn_FromDn: PyObject *(struct ldb_dn *)
pyldb_Object_AsDn: bool (TALLOC_CTX *, PyObject *, struct ldb_context *, struct ldb_dn **)
pyldb_Dn_FromDn: PyObject *(struct ldb_dn *)
pyldb_Object_AsDn: bool (TALLOC_CTX *, PyObject *, struct ldb_context *, struct ldb_dn **)
pyldb_Dn_FromDn: PyObject *(struct ldb_dn *)
pyldb_Object_AsDn: bool (TALLOC_CTX *, PyObject *, struct ldb_context *, struct ldb_dn **)
......@@ -38,16 +38,20 @@ def subst_at_vars(task):
return 0
def PKG_CONFIG_FILES(bld, pc_files, vnum=None):
def PKG_CONFIG_FILES(bld, pc_files, vnum=None, extra_name=None):
'''install some pkg_config pc files'''
dest = '${PKGCONFIGDIR}'
dest = bld.EXPAND_VARIABLES(dest)
for f in TO_LIST(pc_files):
base=os.path.basename(f)
if extra_name:
target = f.split('.pc')[0] + extra_name + ".pc"
else:
target = f
base=os.path.basename(target)
t = bld.SAMBA_GENERATOR('PKGCONFIG_%s' % base,
rule=subst_at_vars,
source=f+'.in',
target=f)
target=target)
bld.add_manual_dependency(bld.path.find_or_declare(f), bld.env['PREFIX'])
t.vars = []
if t.env.RPATH_ON_INSTALL:
......@@ -58,7 +62,7 @@ def PKG_CONFIG_FILES(bld, pc_files, vnum=None):
t.env.PACKAGE_VERSION = vnum
for v in [ 'PREFIX', 'EXEC_PREFIX', 'LIB_RPATH' ]:
t.vars.append(t.env[v])
bld.INSTALL_FILES(dest, f, flat=True, destname=base)
bld.INSTALL_FILES(dest, target, flat=True, destname=base)
Build.BuildContext.PKG_CONFIG_FILES = PKG_CONFIG_FILES
......@@ -2,37 +2,10 @@
# and for SAMBA_ macros for building libraries, binaries etc
import Options, Build, os
from optparse import SUPPRESS_HELP
from samba_utils import os_path_relpath, TO_LIST
from samba_utils import os_path_relpath, TO_LIST, samba_add_onoff_option
from samba_autoconf import library_flags
def SAMBA3_ADD_OPTION(opt, option, help=(), dest=None, default=True,
with_name="with", without_name="without"):
if default is None:
default_str = "auto"
elif default is True:
default_str = "yes"
elif default is False:
default_str = "no"
else:
default_str = str(default)
if help == ():
help = ("Build with %s support (default=%s)" % (option, default_str))
if dest is None:
dest = "with_%s" % option.replace('-', '_')
with_val = "--%s-%s" % (with_name, option)
without_val = "--%s-%s" % (without_name, option)
#FIXME: This is broken and will always default to "default" no matter if
# --with or --without is chosen.
opt.add_option(with_val, help=help, action="store_true", dest=dest,
default=default)
opt.add_option(without_val, help=SUPPRESS_HELP, action="store_false",
dest=dest)
Options.Handler.SAMBA3_ADD_OPTION = SAMBA3_ADD_OPTION
Options.Handler.SAMBA3_ADD_OPTION = samba_add_onoff_option
def SAMBA3_IS_STATIC_MODULE(bld, module):
'''Check whether module is in static list'''
......
......@@ -110,6 +110,7 @@ def LIB_MUST_BE_PRIVATE(conf, libname):
@conf
def CHECK_BUNDLED_SYSTEM_PKG(conf, libname, minversion='0.0.0',
maxversion=None, version_blacklist=[],
onlyif=None, implied_deps=None, pkg=None):
'''check if a library is available as a system library.
......@@ -117,12 +118,15 @@ def CHECK_BUNDLED_SYSTEM_PKG(conf, libname, minversion='0.0.0',
'''
return conf.CHECK_BUNDLED_SYSTEM(libname,
minversion=minversion,
maxversion=maxversion,
version_blacklist=version_blacklist,
onlyif=onlyif,
implied_deps=implied_deps,
pkg=pkg)
@conf
def CHECK_BUNDLED_SYSTEM(conf, libname, minversion='0.0.0',
maxversion=None, version_blacklist=[],
checkfunctions=None, headers=None, checkcode=None,
onlyif=None, implied_deps=None,
require_headers=True, pkg=None, set_target=True):
......@@ -181,16 +185,29 @@ def CHECK_BUNDLED_SYSTEM(conf, libname, minversion='0.0.0',
minversion = minimum_library_version(conf, libname, minversion)
msg = 'Checking for system %s' % libname
msg_ver = []
if minversion != '0.0.0':
msg += ' >= %s' % minversion
msg_ver.append('>=%s' % minversion)
if maxversion is not None:
msg_ver.append('<=%s' % maxversion)
for v in version_blacklist:
msg_ver.append('!=%s' % v)
if msg_ver != []:
msg += " (%s)" % (" ".join(msg_ver))
uselib_store=libname.upper()
if pkg is None:
pkg = libname
version_checks = '%s >= %s' % (pkg, minversion)
if maxversion is not None:
version_checks += ' %s <= %s' % (pkg, maxversion)
for v in version_blacklist:
version_checks += ' %s != %s' % (pkg, v)
# try pkgconfig first
if (conf.CHECK_CFG(package=pkg,
args='"%s >= %s" --cflags --libs' % (pkg, minversion),
args='"%s" --cflags --libs' % (version_checks),
msg=msg, uselib_store=uselib_store) and
check_functions_headers_code()):
if set_target:
......
......@@ -24,7 +24,7 @@ def check(self, *k, **kw):
if not 'env' in kw:
kw['env'] = self.env.copy()
# match the configuration test with speficic options, for example:
# match the configuration test with specific options, for example:
# --with-libiconv -> Options.options.iconv_open -> "Checking for library iconv"
additional_dirs = []
if 'msg' in kw:
......@@ -286,7 +286,9 @@ def CHECK_LIBRARY_SUPPORT(conf, rpath=False, version_script=False, msg=None):
os.makedirs(subdir)
Utils.writef(os.path.join(subdir, 'lib1.c'), 'int lib_func(void) { return 42; }\n')
Utils.writef(os.path.join(dir, 'main.c'), 'int main(void) {return !(lib_func() == 42);}\n')
Utils.writef(os.path.join(dir, 'main.c'),
'int lib_func(void);\n'
'int main(void) {return !(lib_func() == 42);}\n')
bld = Build.BuildContext()
bld.log = conf.log
......@@ -436,6 +438,7 @@ def CHECK_UNAME(conf):
ret = True
for v in "sysname machine release version".split():
if not conf.CHECK_CODE('''
int printf(const char *format, ...);
struct utsname n;
if (uname(&n) == -1) return -1;
printf("%%s", n.%s);
......
......@@ -229,6 +229,7 @@ def add_init_functions(self):
if modules == []:
sname = sname.replace('-','_')
sname = sname.replace('.','_')
sname = sname.replace('/','_')
cflags.append('-DSTATIC_%s_MODULES=%s' % (sname, sentinel))
if sentinel == 'NULL':
......
......@@ -115,7 +115,7 @@ def dist(appname='', version=''):
blacklisted = True
if blacklisted:
continue
if os.path.isdir(abspath):
if os.path.isdir(abspath) and not os.path.islink(abspath):
continue
if dstsubdir != '.':
f = dstsubdir + '/' + f
......@@ -182,7 +182,7 @@ def dist(appname='', version=''):
absfile = os.path.join(srcdir, file)
if os.path.isdir(absfile):
if os.path.isdir(absfile) and not os.path.islink(absfile):
destdir = destfile
dir = file
files = list_directory_files(dir)
......
......@@ -14,7 +14,7 @@ def write_version_header(task):
return 0
def SAMBA_MKVERSION(bld, target):
def SAMBA_MKVERSION(bld, target, source='VERSION'):
'''generate the version.h header for Samba'''
# We only force waf to re-generate this file if we are installing,
......@@ -22,7 +22,7 @@ def SAMBA_MKVERSION(bld, target):
# git revision) included in the version.
t = bld.SAMBA_GENERATOR('VERSION',
rule=write_version_header,
source= 'VERSION',
source=source,
target=target,
always=bld.is_install)
Build.BuildContext.SAMBA_MKVERSION = SAMBA_MKVERSION
......@@ -51,7 +51,6 @@ def write_build_options_header(fp):
fp.write("*/\n")
fp.write("\n")
fp.write("#include \"includes.h\"\n")
fp.write("#include \"build_env.h\"\n")
fp.write("#include \"dynconfig/dynconfig.h\"\n")
fp.write("#include \"lib/cluster_support.h\"\n")
......@@ -92,19 +91,6 @@ def write_build_options_header(fp):
fp.write(" return;\n")
fp.write(" }\n")
fp.write("\n")
fp.write("#ifdef _BUILD_ENV_H\n")
fp.write(" /* Output information about the build environment */\n")
fp.write(" output(screen,\"Build environment:\\n\");\n")
fp.write(" output(screen,\" Built by: %s@%s\\n\",BUILD_ENV_USER,BUILD_ENV_HOST);\n")
fp.write(" output(screen,\" Built on: %s\\n\",BUILD_ENV_DATE);\n")
fp.write("\n")
fp.write(" output(screen,\" Built using: %s\\n\",BUILD_ENV_COMPILER);\n")
fp.write(" output(screen,\" Build host: %s\\n\",BUILD_ENV_UNAME);\n")
fp.write(" output(screen,\" SRCDIR: %s\\n\",BUILD_ENV_SRCDIR);\n")
fp.write(" output(screen,\" BUILDDIR: %s\\n\",BUILD_ENV_BUILDDIR);\n")
fp.write("\n")
fp.write("\n")
fp.write("#endif\n")
fp.write("\n")
fp.write(" /* Output various paths to files and directories */\n")
fp.write(" output(screen,\"\\nPaths:\\n\");\n")
......@@ -122,6 +108,7 @@ def write_build_options_header(fp):
fp.write(" output(screen,\" PIDDIR: %s\\n\", get_dyn_PIDDIR());\n")
fp.write(" output(screen,\" SMB_PASSWD_FILE: %s\\n\",get_dyn_SMB_PASSWD_FILE());\n")
fp.write(" output(screen,\" PRIVATE_DIR: %s\\n\",get_dyn_PRIVATE_DIR());\n")
fp.write(" output(screen,\" BINDDNS_DIR: %s\\n\",get_dyn_BINDDNS_DIR());\n")
fp.write("\n")
def write_build_options_footer(fp):
......@@ -178,6 +165,9 @@ def write_build_options(task):
keys_header_other.append(key)
else:
keys_option_have.append(key)
elif key.startswith("static_init_"):
l = key.split("(")
keys_misc.append(l[0])
else:
keys_misc.append(key)
......
......@@ -40,6 +40,18 @@ def SAMBA_CHECK_PYTHON(conf, mandatory=True, version=(2,4,2)):
@conf
def SAMBA_CHECK_PYTHON_HEADERS(conf, mandatory=True):
if conf.env.disable_python:
if mandatory:
raise Utils.WafError("Cannot check for python headers when "
"--disable-python specified")
conf.msg("python headers", "Check disabled due to --disable-python")
# we don't want PYTHONDIR in config.h, as otherwise changing
# --prefix causes a complete rebuild
del(conf.env.defines['PYTHONDIR'])
del(conf.env.defines['PYTHONARCHDIR'])
return
if conf.env["python_headers_checked"] == []:
if conf.env['EXTRA_PYTHON']:
conf.setenv('extrapython')
......@@ -75,6 +87,20 @@ def _check_python_headers(conf, mandatory):
conf.env['PYTHON_SO_ABI_FLAG'] = abi_pattern % ''
else:
conf.env['PYTHON_SO_ABI_FLAG'] = ''
conf.env['PYTHON_LIBNAME_SO_ABI_FLAG'] = (
conf.env['PYTHON_SO_ABI_FLAG'].replace('_', '-'))
for lib in conf.env['LINKFLAGS_PYEMBED']:
if lib.startswith('-L'):
conf.env.append_unique('LIBPATH_PYEMBED', lib[2:]) # strip '-L'
conf.env['LINKFLAGS_PYEMBED'].remove(lib)
return
def PYTHON_BUILD_IS_ENABLED(self):
return self.CONFIG_SET('HAVE_PYTHON_H')
Build.BuildContext.PYTHON_BUILD_IS_ENABLED = PYTHON_BUILD_IS_ENABLED
def SAMBA_PYTHON(bld, name,
......@@ -91,6 +117,11 @@ def SAMBA_PYTHON(bld, name,
enabled=True):
'''build a python extension for Samba'''
# force-disable when we can't build python modules, so
# every single call doesn't need to pass this in.
if not bld.PYTHON_BUILD_IS_ENABLED():
enabled = False
if bld.env['IS_EXTRA_PYTHON']:
name = 'extra-' + name
......@@ -138,7 +169,10 @@ Build.BuildContext.SAMBA_PYTHON = SAMBA_PYTHON
def pyembed_libname(bld, name, extrapython=False):
return name + bld.env['PYTHON_SO_ABI_FLAG']
if bld.env['PYTHON_SO_ABI_FLAG']:
return name + bld.env['PYTHON_SO_ABI_FLAG']
else:
return name
Build.BuildContext.pyembed_libname = pyembed_libname
......
......@@ -33,3 +33,9 @@ def CHECK_POPT(conf):
return conf.CHECK_BUNDLED_SYSTEM('popt', checkfunctions='poptGetContext', headers='popt.h')
Build.BuildContext.CHECK_POPT = CHECK_POPT
@conf
def CHECK_CMOCKA(conf):
return conf.CHECK_BUNDLED_SYSTEM_PKG('cmocka', minversion='1.1.1')
Build.BuildContext.CHECK_CMOCKA = CHECK_CMOCKA
......@@ -2,6 +2,7 @@
# and for SAMBA_ macros for building libraries, binaries etc
import os, sys, re, fnmatch, shlex
from optparse import SUPPRESS_HELP
import Build, Options, Utils, Task, Logs, Configure
from TaskGen import feature, before, after
from Configure import conf, ConfigurationContext
......@@ -669,3 +670,27 @@ def samba_before_apply_obj_vars(self):
if is_standard_libpath(v, i):
v['LIBPATH'].remove(i)
def samba_add_onoff_option(opt, option, help=(), dest=None, default=True,
with_name="with", without_name="without"):
if default is None:
default_str = "auto"
elif default is True:
default_str = "yes"
elif default is False:
default_str = "no"
else:
default_str = str(default)
if help == ():
help = ("Build with %s support (default=%s)" % (option, default_str))
if dest is None:
dest = "with_%s" % option.replace('-', '_')
with_val = "--%s-%s" % (with_name, option)
without_val = "--%s-%s" % (without_name, option)
opt.add_option(with_val, help=help, action="store_true", dest=dest,
default=default)
opt.add_option(without_val, help=SUPPRESS_HELP, action="store_false",
dest=dest)
Options.Handler.samba_add_onoff_option = samba_add_onoff_option
......@@ -144,7 +144,7 @@ def SAMBA_LIBRARY(bld, libname, source,
'''define a Samba library'''
if pyembed and bld.env['IS_EXTRA_PYTHON']:
public_headers = pc_files = None
public_headers = None
if private_library and public_headers:
raise Utils.WafError("private library '%s' must not have public header files" %
......@@ -225,7 +225,7 @@ def SAMBA_LIBRARY(bld, libname, source,
if vnum is None and soname is None:
raise Utils.WafError("public library '%s' must have a vnum" %
libname)
if pc_files is None and not bld.env['IS_EXTRA_PYTHON']:
if pc_files is None:
raise Utils.WafError("public library '%s' must have pkg-config file" %
libname)
if public_headers is None and not bld.env['IS_EXTRA_PYTHON']:
......@@ -328,7 +328,10 @@ def SAMBA_LIBRARY(bld, libname, source,
t.link_name = link_name
if pc_files is not None and not private_library:
bld.PKG_CONFIG_FILES(pc_files, vnum=vnum)
if pyembed and bld.env['IS_EXTRA_PYTHON']:
bld.PKG_CONFIG_FILES(pc_files, vnum=vnum, extra_name=bld.env['PYTHON_SO_ABI_FLAG'])
else:
bld.PKG_CONFIG_FILES(pc_files, vnum=vnum)
if (manpages is not None and 'XSLTPROC_MANPAGES' in bld.env and
bld.env['XSLTPROC_MANPAGES']):
......@@ -462,7 +465,8 @@ def SAMBA_MODULE(bld, modname, source,
pyembed=False,
manpages=None,
allow_undefined_symbols=False,
allow_warnings=False
allow_warnings=False,
install=True
):
'''define a Samba module.'''
......@@ -532,7 +536,8 @@ def SAMBA_MODULE(bld, modname, source,
pyembed=pyembed,
manpages=manpages,
allow_undefined_symbols=allow_undefined_symbols,
allow_warnings=allow_warnings
allow_warnings=allow_warnings,
install=install
)
......@@ -880,13 +885,31 @@ def INSTALL_WILDCARD(bld, destdir, pattern, chmod=MODE_644, flat=False,
python_fixup=python_fixup, base_name=trim_path)
Build.BuildContext.INSTALL_WILDCARD = INSTALL_WILDCARD
def INSTALL_DIR(bld, path, chmod=0o755):
"""Install a directory if it doesn't exist, always set permissions."""
if not path:
return []
if bld.is_install > 0:
path = bld.EXPAND_VARIABLES(path)
if not os.path.isdir(path):
try:
os.makedirs(path)
os.chmod(path, chmod)
except OSError, e:
if not os.path.isdir(path):
raise Utils.WafError("Cannot create the folder '%s' (error: %s)" % (path, e))
else:
os.chmod(path, chmod)
Build.BuildContext.INSTALL_DIR = INSTALL_DIR
def INSTALL_DIRS(bld, destdir, dirs):
def INSTALL_DIRS(bld, destdir, dirs, chmod=0o755):
'''install a set of directories'''
destdir = bld.EXPAND_VARIABLES(destdir)
dirs = bld.EXPAND_VARIABLES(dirs)
for d in TO_LIST(dirs):
bld.install_dir(os.path.join(destdir, d))
INSTALL_DIR(bld, os.path.join(destdir, d), chmod)
Build.BuildContext.INSTALL_DIRS = INSTALL_DIRS
......
......@@ -196,6 +196,10 @@ def set_options(opt):
help='tag release in git at the same time',
type='string', action='store', dest='TAG_RELEASE')
opt.add_option('--disable-python',
help='do not generate python modules',
action='store_true', dest='disable_python', default=False)
opt.add_option('--extra-python', type=str,
help=("build selected libraries for the specified "
"additional version of Python "
......@@ -208,6 +212,8 @@ def configure(conf):
conf.env.hlist = []
conf.env.srcdir = conf.srcdir
conf.define('SRCDIR', conf.env['srcdir'])
if Options.options.timestamp_dependencies:
conf.ENABLE_TIMESTAMP_DEPENDENCIES()
......@@ -279,8 +285,14 @@ def configure(conf):
conf.env.AUTOCONF_HOST = Options.options.AUTOCONF_HOST
conf.env.AUTOCONF_PROGRAM_PREFIX = Options.options.AUTOCONF_PROGRAM_PREFIX
conf.env.disable_python = Options.options.disable_python
conf.env.EXTRA_PYTHON = Options.options.EXTRA_PYTHON
if (conf.env.disable_python and conf.env.EXTRA_PYTHON):
Logs.error('ERROR: cannot specify both --disable-python and --extra-python.')
sys.exit(1)
if (conf.env.AUTOCONF_HOST and
conf.env.AUTOCONF_BUILD and
conf.env.AUTOCONF_BUILD != conf.env.AUTOCONF_HOST):
......@@ -490,12 +502,12 @@ struct foo bar = { .y = 'X', .x = 1 };
if not conf.CHECK_LARGEFILE():
raise Utils.WafError('Samba requires large file support support, but not available on this platform: sizeof(off_t) < 8')
if 'HAVE_STDDEF_H' in conf.env and 'HAVE_STDLIB_H' in conf.env:
if conf.env.HAVE_STDDEF_H and conf.env.HAVE_STDLIB_H:
conf.DEFINE('STDC_HEADERS', 1)
conf.CHECK_HEADERS('sys/time.h time.h', together=True)
if 'HAVE_SYS_TIME_H' in conf.env and 'HAVE_TIME_H' in conf.env:
if conf.env.HAVE_SYS_TIME_H and conf.env.HAVE_TIME_H:
conf.DEFINE('TIME_WITH_SYS_TIME', 1)
# cope with different extensions for libraries
......
This diff is collapsed.
......@@ -383,3 +383,15 @@ void ldb_schema_attribute_set_override_handler(struct ldb_context *ldb,
ldb->schema.attribute_handler_override_private = private_data;
ldb->schema.attribute_handler_override = override;
}
/*
set that the attribute handler override function - used to delegate
schema handling to external code, is handling setting
LDB_ATTR_FLAG_INDEXED
*/
void ldb_schema_set_override_indexlist(struct ldb_context *ldb,
bool one_level_indexes)
{
ldb->schema.index_handler_override = true;
ldb->schema.one_level_indexes = one_level_indexes;
}
......@@ -1080,3 +1080,24 @@ char *ldb_ldif_message_string(struct ldb_context *ldb, TALLOC_CTX *mem_ctx,
return ldb_ldif_write_string(ldb, mem_ctx, &ldif);
}
/*
* convenient function to turn a ldb_message into a string. Useful for
* debugging but also safer if some of the LDIF could be sensitive.
*
* The secret attributes are specified in a 'const char * const *' within
* the LDB_SECRET_ATTRIBUTE_LIST opaque set on the ldb
*
*/
char *ldb_ldif_message_redacted_string(struct ldb_context *ldb,
TALLOC_CTX *mem_ctx,
enum ldb_changetype changetype,
const struct ldb_message *msg)
{
struct ldb_ldif ldif;
ldif.changetype = changetype;
ldif.msg = discard_const_p(struct ldb_message, msg);
return ldb_ldif_write_redacted_trace_string(ldb, mem_ctx, &ldif);
}
......@@ -280,7 +280,17 @@ int ldb_register_module(const struct ldb_module_ops *ops)
if (ldb_find_module_ops(ops->name) != NULL)
return LDB_ERR_ENTRY_ALREADY_EXISTS;
entry = talloc(talloc_autofree_context(), struct ops_list_entry);
/*
* ldb modules are not (yet) unloaded and
* are only loaded once (the above check
* makes sure of this). Allocate off the NULL
* context. We never want this to be freed
* until process shutdown. If eventually we
* want to unload ldb modules we can add a
* deregister function that walks and
* frees the list.
*/
entry = talloc(NULL, struct ops_list_entry);
if (entry == NULL) {
return LDB_ERR_OPERATIONS_ERROR;
}
......@@ -641,6 +651,52 @@ int ldb_next_end_trans(struct ldb_module *module)
return ret;
}
int ldb_next_read_lock(struct ldb_module *module)
{
int ret;
FIND_OP(module, read_lock);
ret = module->ops->read_lock(module);
if (ret == LDB_SUCCESS) {
return ret;
}
if (!ldb_errstring(module->ldb)) {
/* Set a default error string, to place the blame somewhere */
ldb_asprintf_errstring(module->ldb,
"read_lock error in module %s: %s (%d)",
module->ops->name, ldb_strerror(ret),
ret);
}
if ((module && module->ldb->flags & LDB_FLG_ENABLE_TRACING)) {
ldb_debug(module->ldb, LDB_DEBUG_TRACE,
"ldb_next_read_lock error: %s",
ldb_errstring(module->ldb));
}
return ret;
}
int ldb_next_read_unlock(struct ldb_module *module)
{
int ret;
FIND_OP(module, read_unlock);
ret = module->ops->read_unlock(module);
if (ret == LDB_SUCCESS) {
return ret;
}
if (!ldb_errstring(module->ldb)) {
/* Set a default error string, to place the blame somewhere */
ldb_asprintf_errstring(module->ldb,
"read_unlock error in module %s: %s (%d)",
module->ops->name, ldb_strerror(ret),
ret);
}
if ((module && module->ldb->flags & LDB_FLG_ENABLE_TRACING)) {
ldb_debug(module->ldb, LDB_DEBUG_TRACE,
"ldb_next_read_unlock error: %s",
ldb_errstring(module->ldb));
}
return ret;
}
int ldb_next_prepare_commit(struct ldb_module *module)
{
int ret;
......@@ -684,26 +740,6 @@ int ldb_next_del_trans(struct ldb_module *module)
return ret;
}
struct ldb_handle *ldb_handle_new(TALLOC_CTX *mem_ctx, struct ldb_context *ldb)
{
struct ldb_handle *h;
h = talloc_zero(mem_ctx, struct ldb_handle);
if (h == NULL) {
ldb_set_errstring(ldb, "Out of Memory");
return NULL;
}
h->status = LDB_SUCCESS;
h->state = LDB_ASYNC_INIT;
h->ldb = ldb;
h->flags = 0;
h->location = NULL;
h->parent = NULL;
return h;
}