Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package tdb for openSUSE:Factory checked in at 2024-10-11 17:00:56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/tdb (Old) and /work/SRC/openSUSE:Factory/.tdb.new.19354 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "tdb" Fri Oct 11 17:00:56 2024 rev:45 rq:1206309 version:1.4.12 Changes: -------- --- /work/SRC/openSUSE:Factory/tdb/tdb.changes 2024-05-24 19:50:43.816610863 +0200 +++ /work/SRC/openSUSE:Factory/.tdb.new.19354/tdb.changes 2024-10-11 17:00:57.595278365 +0200 @@ -1,0 +2,15 @@ +Tue Sep 10 09:22:42 UTC 2024 - Noel Power <[email protected]> + +- Update to 1.4.12 + * Regression fix for ABI problem + TDB_1_4_11 vs. TDB_1.4.11 + +- Update to 1.4.11 + * Add tdbdump -x option to output all data as hex values + * Add missing overflow check for num_values in pytdb.c + * Remove Py2 related tests + * Update times in tdb_transaction_commit per fd, not per name + * Fix compilation with TDB_TRACE=1 + * Allow tracing of internal tdb + +------------------------------------------------------------------- Old: ---- tdb-1.4.10.tar.asc tdb-1.4.10.tar.gz New: ---- tdb-1.4.12.tar.asc tdb-1.4.12.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ tdb.spec ++++++ --- /var/tmp/diff_new_pack.uqbtLE/_old 2024-10-11 17:00:58.459314304 +0200 +++ /var/tmp/diff_new_pack.uqbtLE/_new 2024-10-11 17:00:58.463314470 +0200 @@ -19,7 +19,7 @@ %{!?python_sitearch: %global python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} %{!?py3_soflags: %global py3_soflags cpython-%{python3_version_nodots}m} Name: tdb -Version: 1.4.10 +Version: 1.4.12 Release: 0 Summary: Samba Trivial Database License: LGPL-3.0-or-later ++++++ tdb-1.4.10.tar.gz -> tdb-1.4.12.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tdb-1.4.10/ABI/tdb-1.4.11.sigs new/tdb-1.4.12/ABI/tdb-1.4.11.sigs --- old/tdb-1.4.10/ABI/tdb-1.4.11.sigs 1970-01-01 01:00:00.000000000 +0100 +++ new/tdb-1.4.12/ABI/tdb-1.4.11.sigs 2024-07-29 13:47:57.103416400 +0200 @@ -0,0 +1,73 @@ +tdb_add_flags: void (struct tdb_context *, unsigned int) +tdb_append: int (struct tdb_context *, TDB_DATA, TDB_DATA) +tdb_chainlock: int (struct tdb_context *, TDB_DATA) +tdb_chainlock_mark: int (struct tdb_context *, TDB_DATA) +tdb_chainlock_nonblock: int (struct tdb_context *, TDB_DATA) +tdb_chainlock_read: int (struct tdb_context *, TDB_DATA) +tdb_chainlock_read_nonblock: int (struct tdb_context *, TDB_DATA) +tdb_chainlock_unmark: int (struct tdb_context *, TDB_DATA) +tdb_chainunlock: int (struct tdb_context *, TDB_DATA) +tdb_chainunlock_read: int (struct tdb_context *, TDB_DATA) +tdb_check: int (struct tdb_context *, int (*)(TDB_DATA, TDB_DATA, void *), void *) +tdb_close: int (struct tdb_context *) +tdb_delete: int (struct tdb_context *, TDB_DATA) +tdb_dump_all: void (struct tdb_context *) +tdb_enable_seqnum: void (struct tdb_context *) +tdb_error: enum TDB_ERROR (struct tdb_context *) +tdb_errorstr: const char *(struct tdb_context *) +tdb_exists: int (struct tdb_context *, TDB_DATA) +tdb_fd: int (struct tdb_context *) +tdb_fetch: TDB_DATA (struct tdb_context *, TDB_DATA) +tdb_firstkey: TDB_DATA (struct tdb_context *) +tdb_freelist_size: int (struct tdb_context *) +tdb_get_flags: int (struct tdb_context *) +tdb_get_logging_private: void *(struct tdb_context *) +tdb_get_seqnum: int (struct tdb_context *) +tdb_hash_size: int (struct tdb_context *) +tdb_increment_seqnum_nonblock: void (struct tdb_context *) +tdb_jenkins_hash: unsigned int (TDB_DATA *) +tdb_lock_nonblock: int (struct tdb_context *, int, int) +tdb_lockall: int (struct tdb_context *) +tdb_lockall_mark: int (struct tdb_context *) +tdb_lockall_nonblock: int (struct tdb_context *) +tdb_lockall_read: int (struct tdb_context *) +tdb_lockall_read_nonblock: int (struct tdb_context *) +tdb_lockall_unmark: int (struct tdb_context *) +tdb_log_fn: tdb_log_func (struct tdb_context *) +tdb_map_size: size_t (struct tdb_context *) +tdb_name: const char *(struct tdb_context *) +tdb_nextkey: TDB_DATA (struct tdb_context *, TDB_DATA) +tdb_null: dptr = 0xXXXX, dsize = 0 +tdb_open: struct tdb_context *(const char *, int, int, int, mode_t) +tdb_open_ex: struct tdb_context *(const char *, int, int, int, mode_t, const struct tdb_logging_context *, tdb_hash_func) +tdb_parse_record: int (struct tdb_context *, TDB_DATA, int (*)(TDB_DATA, TDB_DATA, void *), void *) +tdb_printfreelist: int (struct tdb_context *) +tdb_remove_flags: void (struct tdb_context *, unsigned int) +tdb_reopen: int (struct tdb_context *) +tdb_reopen_all: int (int) +tdb_repack: int (struct tdb_context *) +tdb_rescue: int (struct tdb_context *, void (*)(TDB_DATA, TDB_DATA, void *), void *) +tdb_runtime_check_for_robust_mutexes: bool (void) +tdb_set_logging_function: void (struct tdb_context *, const struct tdb_logging_context *) +tdb_set_max_dead: void (struct tdb_context *, int) +tdb_setalarm_sigptr: void (struct tdb_context *, volatile sig_atomic_t *) +tdb_store: int (struct tdb_context *, TDB_DATA, TDB_DATA, int) +tdb_storev: int (struct tdb_context *, TDB_DATA, const TDB_DATA *, int, int) +tdb_summary: char *(struct tdb_context *) +tdb_transaction_active: bool (struct tdb_context *) +tdb_transaction_cancel: int (struct tdb_context *) +tdb_transaction_commit: int (struct tdb_context *) +tdb_transaction_prepare_commit: int (struct tdb_context *) +tdb_transaction_start: int (struct tdb_context *) +tdb_transaction_start_nonblock: int (struct tdb_context *) +tdb_transaction_write_lock_mark: int (struct tdb_context *) +tdb_transaction_write_lock_unmark: int (struct tdb_context *) +tdb_traverse: int (struct tdb_context *, tdb_traverse_func, void *) +tdb_traverse_chain: int (struct tdb_context *, unsigned int, tdb_traverse_func, void *) +tdb_traverse_key_chain: int (struct tdb_context *, TDB_DATA, tdb_traverse_func, void *) +tdb_traverse_read: int (struct tdb_context *, tdb_traverse_func, void *) +tdb_unlock: int (struct tdb_context *, int, int) +tdb_unlockall: int (struct tdb_context *) +tdb_unlockall_read: int (struct tdb_context *) +tdb_validate_freelist: int (struct tdb_context *, int *) +tdb_wipe_all: int (struct tdb_context *) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tdb-1.4.10/ABI/tdb-1.4.12.sigs new/tdb-1.4.12/ABI/tdb-1.4.12.sigs --- old/tdb-1.4.10/ABI/tdb-1.4.12.sigs 1970-01-01 01:00:00.000000000 +0100 +++ new/tdb-1.4.12/ABI/tdb-1.4.12.sigs 2024-08-06 15:20:59.079778700 +0200 @@ -0,0 +1,73 @@ +tdb_add_flags: void (struct tdb_context *, unsigned int) +tdb_append: int (struct tdb_context *, TDB_DATA, TDB_DATA) +tdb_chainlock: int (struct tdb_context *, TDB_DATA) +tdb_chainlock_mark: int (struct tdb_context *, TDB_DATA) +tdb_chainlock_nonblock: int (struct tdb_context *, TDB_DATA) +tdb_chainlock_read: int (struct tdb_context *, TDB_DATA) +tdb_chainlock_read_nonblock: int (struct tdb_context *, TDB_DATA) +tdb_chainlock_unmark: int (struct tdb_context *, TDB_DATA) +tdb_chainunlock: int (struct tdb_context *, TDB_DATA) +tdb_chainunlock_read: int (struct tdb_context *, TDB_DATA) +tdb_check: int (struct tdb_context *, int (*)(TDB_DATA, TDB_DATA, void *), void *) +tdb_close: int (struct tdb_context *) +tdb_delete: int (struct tdb_context *, TDB_DATA) +tdb_dump_all: void (struct tdb_context *) +tdb_enable_seqnum: void (struct tdb_context *) +tdb_error: enum TDB_ERROR (struct tdb_context *) +tdb_errorstr: const char *(struct tdb_context *) +tdb_exists: int (struct tdb_context *, TDB_DATA) +tdb_fd: int (struct tdb_context *) +tdb_fetch: TDB_DATA (struct tdb_context *, TDB_DATA) +tdb_firstkey: TDB_DATA (struct tdb_context *) +tdb_freelist_size: int (struct tdb_context *) +tdb_get_flags: int (struct tdb_context *) +tdb_get_logging_private: void *(struct tdb_context *) +tdb_get_seqnum: int (struct tdb_context *) +tdb_hash_size: int (struct tdb_context *) +tdb_increment_seqnum_nonblock: void (struct tdb_context *) +tdb_jenkins_hash: unsigned int (TDB_DATA *) +tdb_lock_nonblock: int (struct tdb_context *, int, int) +tdb_lockall: int (struct tdb_context *) +tdb_lockall_mark: int (struct tdb_context *) +tdb_lockall_nonblock: int (struct tdb_context *) +tdb_lockall_read: int (struct tdb_context *) +tdb_lockall_read_nonblock: int (struct tdb_context *) +tdb_lockall_unmark: int (struct tdb_context *) +tdb_log_fn: tdb_log_func (struct tdb_context *) +tdb_map_size: size_t (struct tdb_context *) +tdb_name: const char *(struct tdb_context *) +tdb_nextkey: TDB_DATA (struct tdb_context *, TDB_DATA) +tdb_null: dptr = 0xXXXX, dsize = 0 +tdb_open: struct tdb_context *(const char *, int, int, int, mode_t) +tdb_open_ex: struct tdb_context *(const char *, int, int, int, mode_t, const struct tdb_logging_context *, tdb_hash_func) +tdb_parse_record: int (struct tdb_context *, TDB_DATA, int (*)(TDB_DATA, TDB_DATA, void *), void *) +tdb_printfreelist: int (struct tdb_context *) +tdb_remove_flags: void (struct tdb_context *, unsigned int) +tdb_reopen: int (struct tdb_context *) +tdb_reopen_all: int (int) +tdb_repack: int (struct tdb_context *) +tdb_rescue: int (struct tdb_context *, void (*)(TDB_DATA, TDB_DATA, void *), void *) +tdb_runtime_check_for_robust_mutexes: bool (void) +tdb_set_logging_function: void (struct tdb_context *, const struct tdb_logging_context *) +tdb_set_max_dead: void (struct tdb_context *, int) +tdb_setalarm_sigptr: void (struct tdb_context *, volatile sig_atomic_t *) +tdb_store: int (struct tdb_context *, TDB_DATA, TDB_DATA, int) +tdb_storev: int (struct tdb_context *, TDB_DATA, const TDB_DATA *, int, int) +tdb_summary: char *(struct tdb_context *) +tdb_transaction_active: bool (struct tdb_context *) +tdb_transaction_cancel: int (struct tdb_context *) +tdb_transaction_commit: int (struct tdb_context *) +tdb_transaction_prepare_commit: int (struct tdb_context *) +tdb_transaction_start: int (struct tdb_context *) +tdb_transaction_start_nonblock: int (struct tdb_context *) +tdb_transaction_write_lock_mark: int (struct tdb_context *) +tdb_transaction_write_lock_unmark: int (struct tdb_context *) +tdb_traverse: int (struct tdb_context *, tdb_traverse_func, void *) +tdb_traverse_chain: int (struct tdb_context *, unsigned int, tdb_traverse_func, void *) +tdb_traverse_key_chain: int (struct tdb_context *, TDB_DATA, tdb_traverse_func, void *) +tdb_traverse_read: int (struct tdb_context *, tdb_traverse_func, void *) +tdb_unlock: int (struct tdb_context *, int, int) +tdb_unlockall: int (struct tdb_context *) +tdb_unlockall_read: int (struct tdb_context *) +tdb_validate_freelist: int (struct tdb_context *, int *) +tdb_wipe_all: int (struct tdb_context *) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tdb-1.4.10/_tdb_text.py new/tdb-1.4.12/_tdb_text.py --- old/tdb-1.4.10/_tdb_text.py 2022-03-02 12:26:09.148422700 +0100 +++ new/tdb-1.4.12/_tdb_text.py 2024-06-06 16:04:09.171647800 +0200 @@ -74,11 +74,7 @@ key = key.encode('utf-8') del self._tdb[key] - if sys.version_info > (3, 0): - keys = __iter__ - else: - iterkeys = __iter__ - has_key = __contains__ + keys = __iter__ ## Add wrappers for functions and getters that don't deal with text diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tdb-1.4.10/buildtools/bin/waf new/tdb-1.4.12/buildtools/bin/waf --- old/tdb-1.4.10/buildtools/bin/waf 2024-01-22 09:56:34.366532600 +0100 +++ new/tdb-1.4.12/buildtools/bin/waf 2024-06-06 16:04:09.163647700 +0200 @@ -45,13 +45,9 @@ if sys.hexversion<0x206000f: raise ImportError('Python >= 2.6 is required to create the waf file') -WAF='waf' +WAF='waf3' def b(x): - return x -if sys.hexversion>0x300000f: - WAF='waf3' - def b(x): - return x.encode() + return x.encode() def err(m): print(('\033[91mError: %s\033[0m' % m)) @@ -107,11 +103,6 @@ for x in ('Tools', 'extras'): os.chmod(join('waflib',x), 493) - if sys.hexversion<0x300000f: - sys.path = [join(dir, 'waflib')] + sys.path - import fixpy2 - fixpy2.fixdir(dir) - os.remove(tmp) os.chdir(cwd) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tdb-1.4.10/buildtools/devel_env.sh new/tdb-1.4.12/buildtools/devel_env.sh --- old/tdb-1.4.10/buildtools/devel_env.sh 2022-04-25 09:21:25.953240600 +0200 +++ new/tdb-1.4.12/buildtools/devel_env.sh 2024-04-22 16:58:42.249157700 +0200 @@ -3,5 +3,7 @@ # source buildtools/devel_env.sh # Setup python path for lsp server -PYTHONPATH="$(pwd)/third_party/waf:$(pwd)/python:$(pwd)/bin/python:$(pwd)/selftest:${PYTHONPATH}" +echo "Old PYTHONPATH: ${PYTHONPATH}" +PYTHONPATH="$(pwd)/third_party/waf:$(pwd)/bin/python:$(pwd)/python:$(pwd)/selftest:${PYTHONPATH}" export PYTHONPATH +echo "New PYTHONPATH: ${PYTHONPATH}" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tdb-1.4.10/buildtools/wafsamba/samba3.py new/tdb-1.4.12/buildtools/wafsamba/samba3.py --- old/tdb-1.4.10/buildtools/wafsamba/samba3.py 2022-03-02 14:24:35.089488300 +0100 +++ new/tdb-1.4.12/buildtools/wafsamba/samba3.py 2024-05-19 19:16:53.050789800 +0200 @@ -45,25 +45,25 @@ '../bin/default/third_party/heimdal/lib/asn1' ] if bld.CONFIG_SET('USING_SYSTEM_TDB'): - (tdb_includes, tdb_ldflags, tdb_cpppath) = library_flags(bld, 'tdb') + (tdb_includes, tdb_ldflags, tdb_cpppath, tdb_libs) = library_flags(bld, 'tdb') extra_includes += tdb_cpppath else: extra_includes += [ '../lib/tdb/include' ] if bld.CONFIG_SET('USING_SYSTEM_TEVENT'): - (tevent_includes, tevent_ldflags, tevent_cpppath) = library_flags(bld, 'tevent') + (tevent_includes, tevent_ldflags, tevent_cpppath, tevent_libs) = library_flags(bld, 'tevent') extra_includes += tevent_cpppath else: extra_includes += [ '../lib/tevent' ] if bld.CONFIG_SET('USING_SYSTEM_TALLOC'): - (talloc_includes, talloc_ldflags, talloc_cpppath) = library_flags(bld, 'talloc') + (talloc_includes, talloc_ldflags, talloc_cpppath, talloc_libs) = library_flags(bld, 'talloc') extra_includes += talloc_cpppath else: extra_includes += [ '../lib/talloc' ] if bld.CONFIG_SET('USING_SYSTEM_POPT'): - (popt_includes, popt_ldflags, popt_cpppath) = library_flags(bld, 'popt') + (popt_includes, popt_ldflags, popt_cpppath, popt_libs) = library_flags(bld, 'popt') extra_includes += popt_cpppath else: extra_includes += [ '../lib/popt' ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tdb-1.4.10/buildtools/wafsamba/samba_abi.py new/tdb-1.4.12/buildtools/wafsamba/samba_abi.py --- old/tdb-1.4.10/buildtools/wafsamba/samba_abi.py 2023-10-25 09:25:01.405660000 +0200 +++ new/tdb-1.4.12/buildtools/wafsamba/samba_abi.py 2024-08-06 23:49:05.365123700 +0200 @@ -286,7 +286,7 @@ f.close() def VSCRIPT_MAP_PRIVATE(bld, libname, orig_vscript, version, private_vscript): - version = version.replace("-", "_").replace("+","_").upper() + version = re.sub(r'[^.\w]', '_', version).upper() t = bld.SAMBA_GENERATOR(private_vscript, rule=abi_build_vscript, source=orig_vscript, @@ -314,8 +314,8 @@ libname = os.path.basename(libname) version = os.path.basename(version) - libname = libname.replace("-", "_").replace("+","_").upper() - version = version.replace("-", "_").replace("+","_").upper() + libname = re.sub(r'[^.\w]', '_', libname).upper() + version = re.sub(r'[^.\w]', '_', version).upper() t = bld.SAMBA_GENERATOR(vscript, rule=abi_build_vscript, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tdb-1.4.10/buildtools/wafsamba/samba_autoconf.py new/tdb-1.4.12/buildtools/wafsamba/samba_autoconf.py --- old/tdb-1.4.10/buildtools/wafsamba/samba_autoconf.py 2024-01-22 09:56:34.366532600 +0100 +++ new/tdb-1.4.12/buildtools/wafsamba/samba_autoconf.py 2024-05-19 19:16:53.050789800 +0200 @@ -91,7 +91,7 @@ conf.env.hlist.append(h) return True - (ccflags, ldflags, cpppath) = library_flags(conf, lib) + (ccflags, ldflags, cpppath, libs) = library_flags(conf, lib) hdrs = hlist_to_string(conf, headers=h) if lib is None: @@ -435,7 +435,7 @@ uselib = TO_LIST(lib) - (ccflags, ldflags, cpppath) = library_flags(conf, uselib) + (ccflags, ldflags, cpppath, libs) = library_flags(conf, uselib) includes = TO_LIST(includes) includes.extend(cpppath) @@ -569,21 +569,24 @@ Build.BuildContext.CONFIG_GET = CONFIG_GET -def library_flags(self, libs): +def library_flags(self, library): '''work out flags from pkg_config''' ccflags = [] ldflags = [] cpppath = [] - for lib in TO_LIST(libs): + libs = [] + for lib in TO_LIST(library): # note that we do not add the -I and -L in here, as that is added by the waf # core. Adding it here would just change the order that it is put on the link line # which can cause system paths to be added before internal libraries extra_ccflags = TO_LIST(getattr(self.env, 'CFLAGS_%s' % lib.upper(), [])) extra_ldflags = TO_LIST(getattr(self.env, 'LDFLAGS_%s' % lib.upper(), [])) extra_cpppath = TO_LIST(getattr(self.env, 'CPPPATH_%s' % lib.upper(), [])) + extra_libs = TO_LIST(getattr(self.env, 'LIB_%s' % lib.upper(), [])) ccflags.extend(extra_ccflags) ldflags.extend(extra_ldflags) cpppath.extend(extra_cpppath) + libs.extend(extra_libs) extra_cpppath = TO_LIST(getattr(self.env, 'INCLUDES_%s' % lib.upper(), [])) cpppath.extend(extra_cpppath) @@ -593,11 +596,12 @@ ccflags = unique_list(ccflags) ldflags = unique_list(ldflags) cpppath = unique_list(cpppath) - return (ccflags, ldflags, cpppath) + libs = unique_list(libs) + return (ccflags, ldflags, cpppath, libs) @conf -def CHECK_LIB(conf, libs, mandatory=False, empty_decl=True, set_target=True, shlib=False): +def CHECK_LIB(conf, library, mandatory=False, empty_decl=True, set_target=True, shlib=False): '''check if a set of libraries exist as system libraries returns the sublist of libs that do exist as a syslib or [] @@ -611,15 +615,20 @@ } ''' ret = [] - liblist = TO_LIST(libs) - for lib in liblist[:]: + liblist = TO_LIST(library) + for lib in liblist: if GET_TARGET_TYPE(conf, lib) == 'SYSLIB': ret.append(lib) continue - (ccflags, ldflags, cpppath) = library_flags(conf, lib) + (ccflags, ldflags, cpppath, libs) = library_flags(conf, lib) if shlib: - res = conf.check(features='c cshlib', fragment=fragment, lib=lib, uselib_store=lib, cflags=ccflags, ldflags=ldflags, uselib=lib.upper(), mandatory=False) + # Avoid repeating the library if it is already named by + # pkg-config --libs. + kw = {} + if lib not in libs: + kw['lib'] = lib + res = conf.check(features='c cshlib', fragment=fragment, uselib_store=lib, cflags=ccflags, ldflags=ldflags, uselib=lib.upper(), mandatory=False, **kw) else: res = conf.check(lib=lib, uselib_store=lib, cflags=ccflags, ldflags=ldflags, uselib=lib.upper(), mandatory=False) @@ -633,7 +642,10 @@ SET_TARGET_TYPE(conf, lib, 'EMPTY') else: conf.define('HAVE_LIB%s' % lib.upper().replace('-','_').replace('.','_'), 1) - conf.env['LIB_' + lib.upper()] = lib + # To avoid losing information from pkg-config, append the library + # only it is not already present. + if lib not in libs: + conf.env.append_value('LIB_' + lib.upper(), lib) if set_target: conf.SET_TARGET_TYPE(lib, 'SYSLIB') ret.append(lib) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tdb-1.4.10/buildtools/wafsamba/samba_bundled.py new/tdb-1.4.12/buildtools/wafsamba/samba_bundled.py --- old/tdb-1.4.10/buildtools/wafsamba/samba_bundled.py 2024-01-22 09:56:34.374532500 +0100 +++ new/tdb-1.4.12/buildtools/wafsamba/samba_bundled.py 2024-04-22 16:58:42.249157700 +0200 @@ -88,7 +88,14 @@ return False return True -def __LIB_MUST_BE(liblist, libname): +def __LIB_MUST_BE(liblist_in, defaults, libname): + liblist = [] + for lib in liblist_in: + if lib == "DEFAULT": + liblist += defaults + else: + liblist += [lib] + if libname in liblist: return True if '!%s' % libname in liblist: @@ -99,11 +106,11 @@ @conf def LIB_MUST_BE_BUNDLED(conf, libname): - return __LIB_MUST_BE(conf.env.BUNDLED_LIBS, libname) + return __LIB_MUST_BE(conf.env.BUNDLED_LIBS, [], libname) @conf def LIB_MUST_BE_PRIVATE(conf, libname): - return __LIB_MUST_BE(conf.env.PRIVATE_LIBS, libname) + return __LIB_MUST_BE(conf.env.PRIVATE_LIBS, conf.env.DEFAULT_PRIVATE_LIBS, libname) @conf def CHECK_BUNDLED_SYSTEM_PKG(conf, libname, minversion='0.0.0', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tdb-1.4.10/buildtools/wafsamba/samba_deps.py new/tdb-1.4.12/buildtools/wafsamba/samba_deps.py --- old/tdb-1.4.10/buildtools/wafsamba/samba_deps.py 2023-09-28 11:28:07.481609000 +0200 +++ new/tdb-1.4.12/buildtools/wafsamba/samba_deps.py 2024-05-19 19:16:53.050789800 +0200 @@ -83,9 +83,8 @@ self.add_objects = list(self.final_objects) # extra link flags from pkg_config - libs = self.final_syslibs.copy() - - (cflags, ldflags, cpppath) = library_flags(self, list(libs)) + (cflags, ldflags, cpppath, libs) = library_flags( + self, list(self.final_syslibs.copy())) new_ldflags = getattr(self, 'samba_ldflags', [])[:] new_ldflags.extend(ldflags) self.ldflags = new_ldflags diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tdb-1.4.10/buildtools/wafsamba/samba_patterns.py new/tdb-1.4.12/buildtools/wafsamba/samba_patterns.py --- old/tdb-1.4.10/buildtools/wafsamba/samba_patterns.py 2024-01-22 09:56:34.374532500 +0100 +++ new/tdb-1.4.12/buildtools/wafsamba/samba_patterns.py 2024-06-06 16:04:09.163647700 +0200 @@ -187,11 +187,7 @@ keys_header_sys = [] keys_header_other = [] keys_misc = [] - if sys.hexversion>0x300000f: - trans_table = bytes.maketrans(b'.-()', b'____') - else: - import string - trans_table = string.maketrans('.-()', '____') + trans_table = bytes.maketrans(b'.-()', b'____') for key in tbl: if key.startswith("HAVE_UT_UT_") or key.find("UTMP") >= 0: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tdb-1.4.10/buildtools/wafsamba/samba_pidl.py new/tdb-1.4.12/buildtools/wafsamba/samba_pidl.py --- old/tdb-1.4.10/buildtools/wafsamba/samba_pidl.py 2024-01-22 09:56:34.374532500 +0100 +++ new/tdb-1.4.12/buildtools/wafsamba/samba_pidl.py 2024-07-11 18:48:18.700359600 +0200 @@ -81,7 +81,9 @@ else: cc = 'CC="%s"' % bld.CONFIG_GET("CC") - t = bld(rule='cd ${PIDL_LAUNCH_DIR} && %s%s %s ${PERL} ${PIDL} --quiet ${OPTIONS} --outputdir ${OUTPUTDIR} -- "${IDLSRC}"' % (pidl_dev, cpp, cc), + t = bld(rule=('cd ${PIDL_LAUNCH_DIR} && PERL_HASH_SEED=0 %s%s %s ${PERL} ' + '${PIDL} --quiet ${OPTIONS} --outputdir ${OUTPUTDIR} -- "${IDLSRC}"' % + (pidl_dev, cpp, cc)), ext_out = '.c', before = 'c', update_outputs = True, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tdb-1.4.10/buildtools/wafsamba/samba_python.py new/tdb-1.4.12/buildtools/wafsamba/samba_python.py --- old/tdb-1.4.10/buildtools/wafsamba/samba_python.py 2022-03-02 13:27:53.322182200 +0100 +++ new/tdb-1.4.12/buildtools/wafsamba/samba_python.py 2024-08-06 14:47:01.919085700 +0200 @@ -114,7 +114,7 @@ # including Python.h. If the macro is defined, length is a Py_ssize_t # rather than an int. - # Because <Python.h> if often included before includes.h/config.h + # Because <Python.h> is often included before includes.h/config.h # This must be in the -D compiler options cflags += ' -DPY_SSIZE_T_CLEAN=1' @@ -153,5 +153,3 @@ return name Build.BuildContext.pyembed_libname = pyembed_libname - - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tdb-1.4.10/buildtools/wafsamba/samba_third_party.py new/tdb-1.4.12/buildtools/wafsamba/samba_third_party.py --- old/tdb-1.4.10/buildtools/wafsamba/samba_third_party.py 2023-07-14 16:41:08.806475200 +0200 +++ new/tdb-1.4.12/buildtools/wafsamba/samba_third_party.py 2024-07-23 14:42:39.323582200 +0200 @@ -24,12 +24,12 @@ @conf def CHECK_SOCKET_WRAPPER(conf): - return conf.CHECK_BUNDLED_SYSTEM_PKG('socket_wrapper', minversion='1.4.2') + return conf.CHECK_BUNDLED_SYSTEM_PKG('socket_wrapper', minversion='1.4.3') Build.BuildContext.CHECK_SOCKET_WRAPPER = CHECK_SOCKET_WRAPPER @conf def CHECK_NSS_WRAPPER(conf): - return conf.CHECK_BUNDLED_SYSTEM_PKG('nss_wrapper', minversion='1.1.15') + return conf.CHECK_BUNDLED_SYSTEM_PKG('nss_wrapper', minversion='1.1.16') Build.BuildContext.CHECK_NSS_WRAPPER = CHECK_NSS_WRAPPER @conf @@ -39,10 +39,10 @@ @conf def CHECK_UID_WRAPPER(conf): - return conf.CHECK_BUNDLED_SYSTEM_PKG('uid_wrapper', minversion='1.3.0') + return conf.CHECK_BUNDLED_SYSTEM_PKG('uid_wrapper', minversion='1.3.1') Build.BuildContext.CHECK_UID_WRAPPER = CHECK_UID_WRAPPER @conf def CHECK_PAM_WRAPPER(conf): - return conf.CHECK_BUNDLED_SYSTEM_PKG('pam_wrapper', minversion='1.1.4') + return conf.CHECK_BUNDLED_SYSTEM_PKG('pam_wrapper', minversion='1.1.7') Build.BuildContext.CHECK_PAM_WRAPPER = CHECK_PAM_WRAPPER diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tdb-1.4.10/buildtools/wafsamba/samba_utils.py new/tdb-1.4.12/buildtools/wafsamba/samba_utils.py --- old/tdb-1.4.10/buildtools/wafsamba/samba_utils.py 2023-10-25 09:25:01.405660000 +0200 +++ new/tdb-1.4.12/buildtools/wafsamba/samba_utils.py 2024-06-06 16:04:09.163647700 +0200 @@ -15,38 +15,16 @@ # TODO: make this a --option LIB_PATH="shared" - -PY3 = sys.version_info[0] == 3 - -if PY3: - - # helper function to get a string from a variable that maybe 'str' or - # 'bytes' if 'bytes' then it is decoded using 'utf8'. If 'str' is passed - # it is returned unchanged - # Using this function is PY2/PY3 code should ensure in most cases - # the PY2 code runs unchanged in PY2 whereas the code in PY3 possibly - # decodes the variable (see PY2 implementation of this function below) - def get_string(bytesorstring): - tmp = bytesorstring - if isinstance(bytesorstring, bytes): - tmp = bytesorstring.decode('utf8') - elif not isinstance(bytesorstring, str): - raise ValueError('Expected byte of string for %s:%s' % (type(bytesorstring), bytesorstring)) - return tmp - -else: - - # Helper function to return string. - # if 'str' or 'unicode' passed in they are returned unchanged - # otherwise an exception is generated - # Using this function is PY2/PY3 code should ensure in most cases - # the PY2 code runs unchanged in PY2 whereas the code in PY3 possibly - # decodes the variable (see PY3 implementation of this function above) - def get_string(bytesorstring): - tmp = bytesorstring - if not(isinstance(bytesorstring, str) or isinstance(bytesorstring, unicode)): - raise ValueError('Expected str or unicode for %s:%s' % (type(bytesorstring), bytesorstring)) - return tmp +# Py3 transition helper function to get a string from a variable that +# may be 'str' or 'bytes'. If 'bytes' then it is decoded using 'utf8'. +# If 'str' is passed it is returned unchanged. +def get_string(bytesorstring): + tmp = bytesorstring + if isinstance(bytesorstring, bytes): + tmp = bytesorstring.decode('utf8') + elif not isinstance(bytesorstring, str): + raise ValueError('Expected byte of string for %s:%s' % (type(bytesorstring), bytesorstring)) + return tmp # sigh, python octal constants are a mess MODE_644 = int('644', 8) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tdb-1.4.10/buildtools/wafsamba/samba_version.py new/tdb-1.4.12/buildtools/wafsamba/samba_version.py --- old/tdb-1.4.10/buildtools/wafsamba/samba_version.py 2024-01-22 09:56:34.374532500 +0100 +++ new/tdb-1.4.12/buildtools/wafsamba/samba_version.py 2024-08-06 14:47:01.919085700 +0200 @@ -200,11 +200,9 @@ string+="#define SAMBA_VERSION_%s " % name value = self.vcs_fields[name] string_types = str - if sys.version_info[0] < 3: - string_types = basestring if isinstance(value, string_types): string += "\"%s\"" % value - elif type(value) is int: + elif isinstance(value, int): string += "%d" % value else: raise Exception("Unknown type for %s: %r" % (name, value)) @@ -253,6 +251,11 @@ print("Failed to parse line %s from %s" % (line, version_file)) raise + if "SAMBA_VERSION_VENDOR_SUFFIX" in env: + version_dict["SAMBA_VERSION_VENDOR_SUFFIX"] = env.SAMBA_VERSION_VENDOR_SUFFIX + if "SAMBA_VERSION_VENDOR_PATCH" in env: + version_dict["SAMBA_VERSION_VENDOR_PATCH"] = str(env.SAMBA_VERSION_VENDOR_PATCH) + return SambaVersion(version_dict, path, env=env, is_install=is_install) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tdb-1.4.10/buildtools/wafsamba/wafsamba.py new/tdb-1.4.12/buildtools/wafsamba/wafsamba.py --- old/tdb-1.4.10/buildtools/wafsamba/wafsamba.py 2024-01-22 09:56:34.378532400 +0100 +++ new/tdb-1.4.12/buildtools/wafsamba/wafsamba.py 2024-04-22 16:58:42.249157700 +0200 @@ -33,6 +33,7 @@ import pkgconfig import configure_file import samba_waf18 +import samba_bundled LIB_PATH="shared" @@ -182,6 +183,7 @@ if LIB_MUST_BE_PRIVATE(bld, libname) and target_type not in ['PLUGIN']: private_library = True + public_headers_install = False if force_unversioned: private_library = False @@ -571,8 +573,7 @@ manpages=None, allow_undefined_symbols=False, allow_warnings=False, - install=True - ): + install=True): '''define a Samba module.''' bld.ASSERT(subsystem, "You must specify a subsystem for SAMBA_MODULE(%s)" % modname) @@ -623,6 +624,11 @@ build_link_name = "modules/%s/%s" % (subsystem, realname) + if f'{subsystem}_modules_install_dir' in bld.env: + install_path = bld.env[f'{subsystem}_modules_install_dir'] + else: + install_path = "${MODULESDIR}/%s" % subsystem + if init_function: cflags += " -D%s=%s" % (init_function, module_init_name) @@ -639,7 +645,7 @@ vars=vars, bundled_name=build_name, link_name=build_link_name, - install_path="${MODULESDIR}/%s" % subsystem, + install_path=install_path, pyembed=pyembed, manpages=manpages, allow_undefined_symbols=allow_undefined_symbols, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tdb-1.4.10/buildtools/wafsamba/wscript new/tdb-1.4.12/buildtools/wafsamba/wscript --- old/tdb-1.4.10/buildtools/wafsamba/wscript 2023-09-28 11:28:07.481609000 +0200 +++ new/tdb-1.4.12/buildtools/wafsamba/wscript 2024-04-22 16:58:42.249157700 +0200 @@ -63,9 +63,12 @@ not use these libraries and they are placed in a private filesystem prefix. +Likewise, it allows the value of DEFAULT (currently {','.join(Context.g_module.DEFAULT_PRIVATE_LIBS) if getattr(Context.g_module, 'DEFAULT_PRIVATE_LIBS', False) else "''"}) +to be overridden, allowing a private-by-default library to be exposed. + May include !LIBNAME to disable making a library private in order to -limit the effect of 'ALL' '''), - action="store", dest='PRIVATE_LIBS', default='') +limit the effect of 'ALL' and 'DEFAULT'.'''), + action="store", dest='PRIVATE_LIBS', default='DEFAULT') extension_default = default_value('PRIVATE_EXTENSION_DEFAULT') gr.add_option('--private-library-extension', @@ -325,6 +328,10 @@ conf.env.PRIVATELIBDIR = Options.options.PRIVATELIBDIR conf.env.BUNDLED_LIBS = Options.options.BUNDLED_LIBS.split(',') conf.env.SYSTEM_LIBS = () + + if getattr(Context.g_module, 'DEFAULT_PRIVATE_LIBS', False): + conf.env.DEFAULT_PRIVATE_LIBS = Context.g_module.DEFAULT_PRIVATE_LIBS + conf.env.PRIVATE_LIBS = Options.options.PRIVATE_LIBS.split(',') conf.env.BUILTIN_LIBRARIES = Options.options.BUILTIN_LIBRARIES.split(',') conf.env.NONSHARED_BINARIES = Options.options.NONSHARED_BINARIES.split(',') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tdb-1.4.10/common/freelist.c new/tdb-1.4.12/common/freelist.c --- old/tdb-1.4.10/common/freelist.c 2022-03-02 12:26:09.148422700 +0100 +++ new/tdb-1.4.12/common/freelist.c 2024-07-03 10:54:59.075887200 +0200 @@ -34,7 +34,7 @@ return -1; if (rec->magic == TDB_MAGIC) { - /* this happens when a app is showdown while deleting a record - we should + /* this happens when a app is shutdown while deleting a record - we should not completely fail when this happens */ TDB_LOG((tdb, TDB_DEBUG_WARNING, "tdb_rec_free_read non-free magic 0x%x at offset=%u - fixing\n", rec->magic, off)); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tdb-1.4.10/common/open.c new/tdb-1.4.12/common/open.c --- old/tdb-1.4.10/common/open.c 2023-10-25 09:25:01.409659900 +0200 +++ new/tdb-1.4.12/common/open.c 2024-07-29 09:33:32.170025800 +0200 @@ -721,12 +721,21 @@ goto fail; } + internal: + /* Internal (memory-only) databases skip all the code above to + * do with disk files, and resume here by releasing their + * open lock and hooking into the active list. */ + #ifdef TDB_TRACE { - char tracefile[strlen(name) + 32]; - - snprintf(tracefile, sizeof(tracefile), - "%s.trace.%li", name, (long)getpid()); + char tracefile[64]; + if (tdb->flags & TDB_INTERNAL) { + snprintf(tracefile, sizeof(tracefile), + "tdb_%p.trace.%li", tdb, (long)getpid()); + } else { + snprintf(tracefile, sizeof(tracefile), + "%s.trace.%li", name, (long)getpid()); + } tdb->tracefd = open(tracefile, O_WRONLY|O_CREAT|O_EXCL, 0600); if (tdb->tracefd >= 0) { tdb_enable_seqnum(tdb); @@ -737,10 +746,6 @@ } #endif - internal: - /* Internal (memory-only) databases skip all the code above to - * do with disk files, and resume here by releasing their - * open lock and hooking into the active list. */ if (tdb_nest_unlock(tdb, OPEN_LOCK, F_WRLCK, false) == -1) { goto fail; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tdb-1.4.10/common/tdb.c new/tdb-1.4.12/common/tdb.c --- old/tdb-1.4.10/common/tdb.c 2022-03-02 13:27:53.362182400 +0100 +++ new/tdb-1.4.12/common/tdb.c 2024-07-29 09:33:32.170025800 +0200 @@ -1208,7 +1208,7 @@ static void tdb_trace_record(struct tdb_context *tdb, TDB_DATA rec) { - char msg[20 + rec.dsize*2], *p; + char msg[21 + rec.dsize*2], *p; unsigned int i; /* We differentiate zero-length records from non-existent ones. */ @@ -1220,8 +1220,11 @@ /* snprintf here is purely cargo-cult programming. */ p = msg; p += snprintf(p, sizeof(msg), " %zu:", rec.dsize); - for (i = 0; i < rec.dsize; i++) - p += snprintf(p, 2, "%02x", rec.dptr[i]); + + for (i = 0; i < rec.dsize; i++) { + snprintf(p, 3, "%02x", rec.dptr[i]); + p += 2; + } tdb_trace_write(tdb, msg); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tdb-1.4.10/common/transaction.c new/tdb-1.4.12/common/transaction.c --- old/tdb-1.4.10/common/transaction.c 2023-04-17 13:25:37.114359000 +0200 +++ new/tdb-1.4.12/common/transaction.c 2024-07-03 10:54:59.075887200 +0200 @@ -1206,9 +1206,7 @@ not be backed up (as tdb rounding to block sizes means that file size changes are quite rare too). The following forces mtime changes when a transaction completes */ -#ifdef HAVE_UTIME - utime(tdb->name, NULL); -#endif + futimens(tdb->fd, NULL); /* use a transaction cancel to free memory and remove the transaction locks */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tdb-1.4.10/lib/replace/replace.h new/tdb-1.4.12/lib/replace/replace.h --- old/tdb-1.4.10/lib/replace/replace.h 2023-09-28 11:28:07.501609300 +0200 +++ new/tdb-1.4.12/lib/replace/replace.h 2024-04-22 16:58:42.293157800 +0200 @@ -1079,7 +1079,7 @@ static inline bool _hexcharval(char c, uint8_t *val) { if ((c >= '0') && (c <= '9')) { *val = c - '0'; return true; } - if ((c >= 'a') && (c <= 'f')) { *val = c - 'a' + 10; return true; } + c &= 0xDF; /* map lower to upper case -- thanks libnfs :-) */ if ((c >= 'A') && (c <= 'F')) { *val = c - 'A' + 10; return true; } return false; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tdb-1.4.10/lib/replace/system/kerberos.h new/tdb-1.4.12/lib/replace/system/kerberos.h --- old/tdb-1.4.10/lib/replace/system/kerberos.h 2022-03-02 12:26:09.136422600 +0100 +++ new/tdb-1.4.12/lib/replace/system/kerberos.h 2024-05-19 19:16:53.058790000 +0200 @@ -37,5 +37,8 @@ #include <com_err.h> #endif +#define krb5_cc_default __ERROR__XX__NEVER_USE_krb5_cc_default__; +#define krb5_cc_default_name __ERROR__XX__NEVER_USE_krb5_cc_default_name__; + #endif #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tdb-1.4.10/man/tdbdump.8.xml new/tdb-1.4.12/man/tdbdump.8.xml --- old/tdb-1.4.10/man/tdbdump.8.xml 2022-03-02 12:26:09.152422700 +0100 +++ new/tdb-1.4.12/man/tdbdump.8.xml 2024-04-22 16:58:42.293157800 +0200 @@ -23,6 +23,7 @@ <arg choice="opt">-k <replaceable>keyname</replaceable></arg> <arg choice="opt">-e</arg> <arg choice="opt">-h</arg> + <arg choice="opt">-x</arg> <arg choice="req">filename</arg> </cmdsynopsis> </refsynopsisdiv> @@ -69,6 +70,13 @@ </para></listitem> </varlistentry> + <varlistentry> + <term>-x</term> + <listitem><para> + The <command>-x</command> changes the output data to a hex dump, from the default mix of ASCII and hex dump. + </para></listitem> + </varlistentry> + </variablelist> </refsect1> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tdb-1.4.10/pytdb.c new/tdb-1.4.12/pytdb.c --- old/tdb-1.4.10/pytdb.c 2024-01-22 09:56:34.410532200 +0100 +++ new/tdb-1.4.12/pytdb.c 2024-05-19 19:16:53.058790000 +0200 @@ -1,4 +1,4 @@ -/* +/* Unix SMB/CIFS implementation. Python interface to tdb. @@ -44,7 +44,7 @@ static void PyErr_SetTDBError(TDB_CONTEXT *tdb) { - PyErr_SetObject(PyExc_RuntimeError, + PyErr_SetObject(PyExc_RuntimeError, Py_BuildValue("(i,s)", tdb_error(tdb), tdb_errorstr(tdb))); } @@ -294,7 +294,7 @@ key = PyBytes_AsTDB_DATA(py_key); if (!key.dptr) return NULL; - + return PyBytes_FromTDB_DATA(tdb_nextkey(self->ctx, key)); } @@ -383,6 +383,10 @@ PyErr_SetFromErrno(PyExc_OverflowError); return NULL; } + if (num_values > INT_MAX) { + PyErr_SetFromErrno(PyExc_OverflowError); + return NULL; + } values = malloc(sizeof(TDB_DATA) * num_values); if (values == NULL) { PyErr_NoMemory(); @@ -398,7 +402,7 @@ values[i] = value; } - ret = tdb_storev(self->ctx, key, values, num_values, flag); + ret = tdb_storev(self->ctx, key, values, (int)num_values, flag); free(values); PyErr_TDB_ERROR_IS_ERR_RAISE(ret, self->ctx); Py_RETURN_NONE; @@ -466,7 +470,7 @@ static PyObject *tdb_object_iter(PyTdbObject *self, PyObject *Py_UNUSED(ignored)) { - PyTdbIteratorObject *ret; + PyTdbIteratorObject *ret; PyErr_TDB_RAISE_IF_CLOSED(self); @@ -514,7 +518,7 @@ } static PyMethodDef tdb_object_methods[] = { - { "transaction_cancel", (PyCFunction)obj_transaction_cancel, METH_NOARGS, + { "transaction_cancel", (PyCFunction)obj_transaction_cancel, METH_NOARGS, "S.transaction_cancel() -> None\n" "Cancel the currently active transaction." }, { "transaction_commit", (PyCFunction)obj_transaction_commit, METH_NOARGS, @@ -713,9 +717,9 @@ tkey = PyBytes_AsTDB_DATA(key); - if (value == NULL) { + if (value == NULL) { ret = tdb_delete(self->ctx, tkey); - } else { + } else { if (!PyBytes_Check(value)) { PyErr_SetString(PyExc_TypeError, "Expected string as value"); return -1; @@ -729,7 +733,7 @@ if (ret != 0) { PyErr_SetTDBError(self->ctx); return -1; - } + } return ret; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tdb-1.4.10/python/tests/simple.py new/tdb-1.4.12/python/tests/simple.py --- old/tdb-1.4.10/python/tests/simple.py 2022-03-02 12:26:09.152422700 +0100 +++ new/tdb-1.4.12/python/tests/simple.py 2024-06-06 16:04:09.171647800 +0200 @@ -131,9 +131,6 @@ self.tdb[b"bla"] = b"bloe" self.assertTrue(b"bla" in self.tdb) self.assertFalse(b"qwertyuiop" in self.tdb) - if sys.version_info < (3, 0): - self.assertTrue(self.tdb.has_key(b"bla")) - self.assertFalse(self.tdb.has_key(b"qwertyuiop")) def test_keyerror(self): self.assertRaises(KeyError, lambda: self.tdb[b"bla"]) @@ -170,10 +167,7 @@ def test_iterkeys(self): self.tdb[b"bloe"] = b"2" self.tdb[b"bla"] = b"25" - if sys.version_info >= (3, 0): - i = self.tdb.keys() - else: - i = self.tdb.iterkeys() + i = self.tdb.keys() self.assertEqual(set([b"bloe", b"bla"]), set([next(i), next(i)])) def test_clear(self): @@ -231,9 +225,6 @@ self.tdb.text["bla"] = "bloe" self.assertTrue("bla" in self.tdb.text) self.assertFalse("qwertyuiop" in self.tdb.text) - if sys.version_info < (3, 0): - self.assertTrue(self.tdb.text.has_key("bla")) - self.assertFalse(self.tdb.text.has_key("qwertyuiop")) def test_keyerror(self): self.assertRaises(KeyError, lambda: self.tdb.text["bla"]) @@ -270,10 +261,7 @@ def test_iterkeys(self): self.tdb.text["bloe"] = "2" self.tdb.text["bla"] = "25" - if sys.version_info >= (3, 0): - i = self.tdb.text.keys() - else: - i = self.tdb.text.iterkeys() + i = self.tdb.text.keys() self.assertEqual(set(["bloe", "bla"]), set([next(i), next(i)])) def test_clear(self): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tdb-1.4.10/test/sample_tdb.txt new/tdb-1.4.12/test/sample_tdb.txt --- old/tdb-1.4.10/test/sample_tdb.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/tdb-1.4.12/test/sample_tdb.txt 2024-04-22 16:58:42.297157800 +0200 @@ -0,0 +1,12 @@ +{ +key(11) = "nbt_server\00" +data(35) = "972.2147483648/1085706313786795392\00" +} +{ +key(15) = "winbind_server\00" +data(25) = "977/12826542715097898407\00" +} +{ +key(14) = "notify-daemon\00" +data(24) = "992/6389638235474936598\00" +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tdb-1.4.10/test/sample_tdb_x.txt new/tdb-1.4.12/test/sample_tdb_x.txt --- old/tdb-1.4.10/test/sample_tdb_x.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/tdb-1.4.12/test/sample_tdb_x.txt 2024-04-22 16:58:42.297157800 +0200 @@ -0,0 +1,12 @@ +{ +key(11) = "6E62745F73657276657200" +data(35) = "3937322E323134373438333634382F3130383537303633313337383637393533393200" +} +{ +key(15) = "77696E62696E645F73657276657200" +data(25) = "3937372F313238323635343237313530393738393834303700" +} +{ +key(14) = "6E6F746966792D6461656D6F6E00" +data(24) = "3939322F3633383936333832333534373439333635393800" +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tdb-1.4.10/test/test_tdbbackup.sh new/tdb-1.4.12/test/test_tdbbackup.sh --- old/tdb-1.4.10/test/test_tdbbackup.sh 2022-03-02 14:24:35.101488400 +0100 +++ new/tdb-1.4.12/test/test_tdbbackup.sh 2024-04-22 16:58:42.297157800 +0200 @@ -8,6 +8,7 @@ fi LDBFILE=$1 +failed=0 timestamp() { @@ -42,16 +43,22 @@ $BINDIR/tdbdump $LDBFILE | sort >orig_dump -testit "normal tdbbackup on tdb file" $BINDIR/tdbbackup $LDBFILE -s .bak +testit "normal tdbbackup on tdb file" $BINDIR/tdbbackup $LDBFILE -s .bak \ + || failed=$((failed + 1)) $BINDIR/tdbdump $LDBFILE.bak | sort >bak_dump -testit "cmp between tdbdumps of original and backup" cmp orig_dump bak_dump +testit "cmp between tdbdumps of original and backup" cmp orig_dump bak_dump \ + || failed=$((failed + 1)) rm $LDBFILE.bak rm bak_dump -testit "readonly tdbbackup on tdb file" $BINDIR/tdbbackup $LDBFILE -s .bak -r +testit "readonly tdbbackup on tdb file" $BINDIR/tdbbackup $LDBFILE -s .bak -r \ + || failed=$((failed + 1)) $BINDIR/tdbdump $LDBFILE.bak | sort >bak_dump -testit "cmp between tdbdumps of original and back dbs" cmp orig_dump bak_dump +testit "cmp between tdbdumps of original and back dbs" cmp orig_dump bak_dump \ + || failed=$((failed + 1)) rm $LDBFILE.bak rm bak_dump rm orig_dump + +exit $failed diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tdb-1.4.10/test/test_tdbdump.sh new/tdb-1.4.12/test/test_tdbdump.sh --- old/tdb-1.4.10/test/test_tdbdump.sh 1970-01-01 01:00:00.000000000 +0100 +++ new/tdb-1.4.12/test/test_tdbdump.sh 2024-04-22 16:58:42.297157800 +0200 @@ -0,0 +1,58 @@ +#!/bin/sh +# Test dumping of tdb database +# Copyright (C) 2024 Christof Schmitt <[email protected]> + +if [ $# -lt 3 ]; then + echo "Usage: $0 TDB_FILE EXPECTED_DUMP EXPECTED_DUMP_X" + exit 1 +fi + +TDB_FILE=$1 +EXPECTED_DUMP=$2 +EXPECTED_DUMP_X=$3 +TEMP_DUMP=tempdump.txt + +failed=0 + +timestamp() +{ + date -u +'time: %Y-%m-%d %H:%M:%S.%6NZ' | sed 's/\..*NZ$/.000000Z/' +} + +subunit_fail_test() +{ + timestamp + printf 'failure: %s [\n' "$1" + cat - + echo "]" +} + +testit() +{ + name="$1" + shift + cmdline="$@" + timestamp + printf 'test: %s\n' "$1" + output=$($cmdline 2>&1) + status=$? + if [ x$status = x0 ]; then + timestamp + printf 'success: %s\n' "$name" + else + echo "$output" | subunit_fail_test "$name" + fi + return $status +} + +$BINDIR/tdbdump $TDB_FILE > $TEMP_DUMP +testit "Verifying tdbdump" cmp $TEMP_DUMP $EXPECTED_DUMP \ + || failed=$(expr $failed + 1) + +$BINDIR/tdbdump -x $TDB_FILE > $TEMP_DUMP +testit "Verifying tdbdump -x" cmp $TEMP_DUMP $EXPECTED_DUMP_X \ + || failed=$(expr $failed + 1) + +rm $TEMP_DUMP + +exit $failed diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tdb-1.4.10/tools/tdbdump.c new/tdb-1.4.12/tools/tdbdump.c --- old/tdb-1.4.10/tools/tdbdump.c 2022-03-02 12:26:09.156422900 +0100 +++ new/tdb-1.4.12/tools/tdbdump.c 2024-04-22 16:58:42.297157800 +0200 @@ -24,12 +24,19 @@ #include "system/wait.h" #include "tdb.h" -static void print_data(TDB_DATA d) +struct traverse_state { + bool hex_output; + const char *keyname; +}; + +static void print_data(TDB_DATA d, bool hex_output) { unsigned char *p = (unsigned char *)d.dptr; int len = d.dsize; while (len--) { - if (isprint(*p) && !strchr("\"\\", *p)) { + if (hex_output) { + printf("%02X", *p); + } else if(isprint(*p) && !strchr("\"\\", *p)) { fputc(*p, stdout); } else { printf("\\%02X", *p); @@ -40,12 +47,14 @@ static int traverse_fn(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA dbuf, void *state) { + struct traverse_state *traverse = state; + printf("{\n"); printf("key(%zu) = \"", key.dsize); - print_data(key); + print_data(key, traverse->hex_output); printf("\"\n"); printf("data(%zu) = \"", dbuf.dsize); - print_data(dbuf); + print_data(dbuf, traverse->hex_output); printf("\"\n"); printf("}\n"); return 0; @@ -86,18 +95,21 @@ va_end(ap); } -static void emergency_walk(TDB_DATA key, TDB_DATA dbuf, void *keyname) +static void emergency_walk(TDB_DATA key, TDB_DATA dbuf, void *state) { - if (keyname) { - if (key.dsize != strlen(keyname)) + struct traverse_state *traverse = state; + + if (traverse->keyname) { + if (key.dsize != strlen(traverse->keyname)) return; - if (memcmp(key.dptr, keyname, key.dsize) != 0) + if (memcmp(key.dptr, traverse->keyname, key.dsize) != 0) return; } - traverse_fn(NULL, key, dbuf, NULL); + traverse_fn(NULL, key, dbuf, traverse); } -static int dump_tdb(const char *fname, const char *keyname, bool emergency) +static int dump_tdb(const char *fname, const char *keyname, + bool emergency, bool hex_output) { TDB_CONTEXT *tdb; TDB_DATA key, value; @@ -120,10 +132,14 @@ } if (emergency) { - return tdb_rescue(tdb, emergency_walk, discard_const(keyname)) == 0; + struct traverse_state traverse = + { .hex_output = hex_output, + .keyname = keyname }; + return tdb_rescue(tdb, emergency_walk, &traverse) == 0; } if (!keyname) { - return tdb_traverse(tdb, traverse_fn, NULL) == -1 ? 1 : 0; + struct traverse_state traverse = { .hex_output = hex_output }; + return tdb_traverse(tdb, traverse_fn, &traverse) == -1 ? 1 : 0; } else { key.dptr = discard_const_p(uint8_t, keyname); key.dsize = strlen(keyname); @@ -131,7 +147,7 @@ if (!value.dptr) { return 1; } else { - print_data(value); + print_data(value, hex_output); free(value.dptr); } } @@ -150,7 +166,7 @@ int main(int argc, char *argv[]) { char *fname, *keyname=NULL; - bool emergency = false; + bool emergency = false, hex_output = false; int c; if (argc < 2) { @@ -158,7 +174,7 @@ exit(1); } - while ((c = getopt( argc, argv, "hk:e")) != -1) { + while ((c = getopt( argc, argv, "hk:ex")) != -1) { switch (c) { case 'h': usage(); @@ -169,6 +185,9 @@ case 'e': emergency = true; break; + case 'x': + hex_output = true; + break; default: usage(); exit( 1); @@ -177,5 +196,5 @@ fname = argv[optind]; - return dump_tdb(fname, keyname, emergency); + return dump_tdb(fname, keyname, emergency, hex_output); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tdb-1.4.10/wscript new/tdb-1.4.12/wscript --- old/tdb-1.4.10/wscript 2024-01-29 17:18:40.731547000 +0100 +++ new/tdb-1.4.12/wscript 2024-08-06 15:14:43.378543100 +0200 @@ -1,7 +1,7 @@ #!/usr/bin/env python APPNAME = 'tdb' -VERSION = '1.4.10' +VERSION = '1.4.12' import sys, os @@ -216,7 +216,8 @@ if not os.path.exists(link): os.symlink(ctx.path.make_node('test').abspath(), link) - sh_tests = ["test/test_tdbbackup.sh test/jenkins-be-hash.tdb"] + sh_tests = ["test/test_tdbbackup.sh test/jenkins-be-hash.tdb", + "test/test_tdbdump.sh test/sample_tdb.tdb test/sample_tdb.txt test/sample_tdb_x.txt"] for sh_test in sh_tests: cmd = "BINDIR=%s %s" % (blddir, sh_test)
