Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package tdb for openSUSE:Factory checked in 
at 2025-03-20 19:24:33
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/tdb (Old)
 and      /work/SRC/openSUSE:Factory/.tdb.new.2696 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "tdb"

Thu Mar 20 19:24:33 2025 rev:46 rq:1254185 version:1.4.13

Changes:
--------
--- /work/SRC/openSUSE:Factory/tdb/tdb.changes  2024-10-11 17:00:57.595278365 
+0200
+++ /work/SRC/openSUSE:Factory/.tdb.new.2696/tdb.changes        2025-03-20 
19:24:50.801277221 +0100
@@ -1,0 +2,6 @@
+Wed Mar 12 15:21:07 UTC 2025 - Samuel Cabrero <scabr...@suse.de>
+
+- Update to 1.4.13
+  * Add LGPLv3 LICENSE file
+
+-------------------------------------------------------------------

Old:
----
  tdb-1.4.12.tar.asc
  tdb-1.4.12.tar.gz

New:
----
  tdb-1.4.13.tar.asc
  tdb-1.4.13.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ tdb.spec ++++++
--- /var/tmp/diff_new_pack.2TIYBr/_old  2025-03-20 19:24:51.329299044 +0100
+++ /var/tmp/diff_new_pack.2TIYBr/_new  2025-03-20 19:24:51.333299210 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package tdb
 #
-# Copyright (c) 2024 SUSE LLC
+# Copyright (c) 2025 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -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.12
+Version:        1.4.13
 Release:        0
 Summary:        Samba Trivial Database
 License:        LGPL-3.0-or-later

++++++ tdb-1.4.12.tar.gz -> tdb-1.4.13.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tdb-1.4.12/ABI/tdb-1.4.13.sigs 
new/tdb-1.4.13/ABI/tdb-1.4.13.sigs
--- old/tdb-1.4.12/ABI/tdb-1.4.13.sigs  1970-01-01 01:00:00.000000000 +0100
+++ new/tdb-1.4.13/ABI/tdb-1.4.13.sigs  2025-02-06 13:35:11.054717300 +0100
@@ -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.12/LICENSE new/tdb-1.4.13/LICENSE
--- old/tdb-1.4.12/LICENSE      1970-01-01 01:00:00.000000000 +0100
+++ new/tdb-1.4.13/LICENSE      2025-01-09 09:52:30.298728500 +0100
@@ -0,0 +1,165 @@
+                   GNU LESSER GENERAL PUBLIC LICENSE
+                       Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+  This version of the GNU Lesser General Public License incorporates
+the terms and conditions of version 3 of the GNU General Public
+License, supplemented by the additional permissions listed below.
+
+  0. Additional Definitions.
+
+  As used herein, "this License" refers to version 3 of the GNU Lesser
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
+General Public License.
+
+  "The Library" refers to a covered work governed by this License,
+other than an Application or a Combined Work as defined below.
+
+  An "Application" is any work that makes use of an interface provided
+by the Library, but which is not otherwise based on the Library.
+Defining a subclass of a class defined by the Library is deemed a mode
+of using an interface provided by the Library.
+
+  A "Combined Work" is a work produced by combining or linking an
+Application with the Library.  The particular version of the Library
+with which the Combined Work was made is also called the "Linked
+Version".
+
+  The "Minimal Corresponding Source" for a Combined Work means the
+Corresponding Source for the Combined Work, excluding any source code
+for portions of the Combined Work that, considered in isolation, are
+based on the Application, and not on the Linked Version.
+
+  The "Corresponding Application Code" for a Combined Work means the
+object code and/or source code for the Application, including any data
+and utility programs needed for reproducing the Combined Work from the
+Application, but excluding the System Libraries of the Combined Work.
+
+  1. Exception to Section 3 of the GNU GPL.
+
+  You may convey a covered work under sections 3 and 4 of this License
+without being bound by section 3 of the GNU GPL.
+
+  2. Conveying Modified Versions.
+
+  If you modify a copy of the Library, and, in your modifications, a
+facility refers to a function or data to be supplied by an Application
+that uses the facility (other than as an argument passed when the
+facility is invoked), then you may convey a copy of the modified
+version:
+
+   a) under this License, provided that you make a good faith effort to
+   ensure that, in the event an Application does not supply the
+   function or data, the facility still operates, and performs
+   whatever part of its purpose remains meaningful, or
+
+   b) under the GNU GPL, with none of the additional permissions of
+   this License applicable to that copy.
+
+  3. Object Code Incorporating Material from Library Header Files.
+
+  The object code form of an Application may incorporate material from
+a header file that is part of the Library.  You may convey such object
+code under terms of your choice, provided that, if the incorporated
+material is not limited to numerical parameters, data structure
+layouts and accessors, or small macros, inline functions and templates
+(ten or fewer lines in length), you do both of the following:
+
+   a) Give prominent notice with each copy of the object code that the
+   Library is used in it and that the Library and its use are
+   covered by this License.
+
+   b) Accompany the object code with a copy of the GNU GPL and this license
+   document.
+
+  4. Combined Works.
+
+  You may convey a Combined Work under terms of your choice that,
+taken together, effectively do not restrict modification of the
+portions of the Library contained in the Combined Work and reverse
+engineering for debugging such modifications, if you also do each of
+the following:
+
+   a) Give prominent notice with each copy of the Combined Work that
+   the Library is used in it and that the Library and its use are
+   covered by this License.
+
+   b) Accompany the Combined Work with a copy of the GNU GPL and this license
+   document.
+
+   c) For a Combined Work that displays copyright notices during
+   execution, include the copyright notice for the Library among
+   these notices, as well as a reference directing the user to the
+   copies of the GNU GPL and this license document.
+
+   d) Do one of the following:
+
+       0) Convey the Minimal Corresponding Source under the terms of this
+       License, and the Corresponding Application Code in a form
+       suitable for, and under terms that permit, the user to
+       recombine or relink the Application with a modified version of
+       the Linked Version to produce a modified Combined Work, in the
+       manner specified by section 6 of the GNU GPL for conveying
+       Corresponding Source.
+
+       1) Use a suitable shared library mechanism for linking with the
+       Library.  A suitable mechanism is one that (a) uses at run time
+       a copy of the Library already present on the user's computer
+       system, and (b) will operate properly with a modified version
+       of the Library that is interface-compatible with the Linked
+       Version.
+
+   e) Provide Installation Information, but only if you would otherwise
+   be required to provide such information under section 6 of the
+   GNU GPL, and only to the extent that such information is
+   necessary to install and execute a modified version of the
+   Combined Work produced by recombining or relinking the
+   Application with a modified version of the Linked Version. (If
+   you use option 4d0, the Installation Information must accompany
+   the Minimal Corresponding Source and Corresponding Application
+   Code. If you use option 4d1, you must provide the Installation
+   Information in the manner specified by section 6 of the GNU GPL
+   for conveying Corresponding Source.)
+
+  5. Combined Libraries.
+
+  You may place library facilities that are a work based on the
+Library side by side in a single library together with other library
+facilities that are not Applications and are not covered by this
+License, and convey such a combined library under terms of your
+choice, if you do both of the following:
+
+   a) Accompany the combined library with a copy of the same work based
+   on the Library, uncombined with any other library facilities,
+   conveyed under the terms of this License.
+
+   b) Give prominent notice with the combined library that part of it
+   is a work based on the Library, and explaining where to find the
+   accompanying uncombined form of the same work.
+
+  6. Revised Versions of the GNU Lesser General Public License.
+
+  The Free Software Foundation may publish revised and/or new versions
+of the GNU Lesser General Public License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns.
+
+  Each version is given a distinguishing version number. If the
+Library as you received it specifies that a certain numbered version
+of the GNU Lesser General Public License "or any later version"
+applies to it, you have the option of following the terms and
+conditions either of that published version or of any later version
+published by the Free Software Foundation. If the Library as you
+received it does not specify a version number of the GNU Lesser
+General Public License, you may choose any version of the GNU Lesser
+General Public License ever published by the Free Software Foundation.
+
+  If the Library as you received it specifies that a proxy can decide
+whether future versions of the GNU Lesser General Public License shall
+apply, that proxy's public statement of acceptance of any version is
+permanent authorization for you to choose that version for the
+Library.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tdb-1.4.12/buildtools/wafsamba/samba_rust.py 
new/tdb-1.4.13/buildtools/wafsamba/samba_rust.py
--- old/tdb-1.4.12/buildtools/wafsamba/samba_rust.py    1970-01-01 
01:00:00.000000000 +0100
+++ new/tdb-1.4.13/buildtools/wafsamba/samba_rust.py    2024-12-18 
10:06:06.068103800 +0100
@@ -0,0 +1,89 @@
+from waflib.Configure import conf
+from waflib import Build
+import os
+
+@conf
+def SAMBA_CHECK_RUST(conf):
+    conf.find_program('cargo', var='CARGO',
+                      mandatory=conf.env.enable_rust)
+
+def vendor_sources(bld, enabled=True):
+    # force-disable when we can't build rust modules, so
+    # every single call doesn't need to pass this in.
+    if not bld.env.enable_rust:
+        enabled = False
+
+    # Save time, no need to build rust when fuzzing
+    if bld.env.enable_fuzzing:
+        enabled = False
+
+    # Determine the vendor directory
+    vendor = bld.path.find_or_declare('./vendor')
+    # WAF dependencies can only be explicit files, not directories, so we touch
+    # a file to indicate vendoring has been completed.
+    vendor_exists = '%s.exists' % vendor
+    # Locate the source manifest file
+    source_manifest = bld.path.find_or_declare('../../../rust/Cargo.toml')
+
+    rule = ['${CARGO}', 'vendor',
+            '--manifest-path=${SRC[0].abspath(env)}',
+            '%s' % vendor,
+            '&& touch %s' % vendor_exists]
+    bld.SAMBA_GENERATOR('vendor.exists',
+                        ' '.join(rule),
+                        source=source_manifest,
+                        target=vendor_exists,
+                        group='final',
+                        enabled=enabled)
+Build.BuildContext.vendor_sources = vendor_sources
+
+def find_sources(source_dir, dep_crate):
+    sources = []
+    for root, dirs, files in os.walk(os.path.join(source_dir, dep_crate)):
+        for file in files:
+            if os.path.splitext(file)[-1] in ['.rs', '.c', '.h']:
+                sources.append(os.path.join(root, file))
+    return sources
+
+def SAMBA_RUST(bld, rust_subdir, target_name, dep_crates=[], enabled=True):
+    # force-disable when we can't build rust modules, so
+    # every single call doesn't need to pass this in.
+    if not bld.env.enable_rust:
+        enabled = False
+
+    # Save time, no need to build rust when fuzzing
+    if bld.env.enable_fuzzing:
+        enabled = False
+
+    release_flag = ''
+    if bld.env.debug or bld.env.developer:
+        target = os.path.join('debug', target_name)
+    else:
+        release_flag = '--release'
+        target = os.path.join('release', target_name)
+    target = bld.path.find_or_declare(target)
+    # The Rust target directory is one directory above the located target
+    target_dir = os.path.join(os.path.dirname('%s' % target), '../')
+    # Try to determine the source directory
+    source_dir = os.path.abspath(os.path.join(target_dir, '../../../rust'))
+    if not os.path.exists(source_dir):
+        raise Exception('Failed to determine rust source directory')
+    # Now determine the sources of each local crate
+    sources = find_sources(source_dir, rust_subdir)
+    for dep_crate in dep_crates:
+        sources.extend(find_sources(source_dir, dep_crate))
+    sources = [os.path.relpath(p, source_dir) for p in sources]
+
+    rule = ['${CARGO}', 'build',
+            '--manifest-path=${SRC[0].abspath(env)}',
+            '--target-dir=%s' % target_dir,
+            release_flag]
+    bld.SAMBA_GENERATOR(target_name,
+                        ' '.join(rule),
+                        source='%s/Cargo.toml vendor.exists %s' % \
+                                (rust_subdir, ' '.join(sources)),
+                        target=target,
+                        group='final',
+                        enabled=enabled)
+Build.BuildContext.SAMBA_RUST_LIBRARY = SAMBA_RUST
+Build.BuildContext.SAMBA_RUST_BINARY = SAMBA_RUST
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tdb-1.4.12/buildtools/wafsamba/samba_third_party.py 
new/tdb-1.4.13/buildtools/wafsamba/samba_third_party.py
--- old/tdb-1.4.12/buildtools/wafsamba/samba_third_party.py     2024-07-23 
14:42:39.323582200 +0200
+++ new/tdb-1.4.13/buildtools/wafsamba/samba_third_party.py     2025-02-05 
09:46:57.678248400 +0100
@@ -24,7 +24,7 @@
 
 @conf
 def CHECK_SOCKET_WRAPPER(conf):
-    return conf.CHECK_BUNDLED_SYSTEM_PKG('socket_wrapper', minversion='1.4.3')
+    return conf.CHECK_BUNDLED_SYSTEM_PKG('socket_wrapper', minversion='1.4.4')
 Build.BuildContext.CHECK_SOCKET_WRAPPER = CHECK_SOCKET_WRAPPER
 
 @conf
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tdb-1.4.12/buildtools/wafsamba/wafsamba.py 
new/tdb-1.4.13/buildtools/wafsamba/wafsamba.py
--- old/tdb-1.4.12/buildtools/wafsamba/wafsamba.py      2024-04-22 
16:58:42.249157700 +0200
+++ new/tdb-1.4.13/buildtools/wafsamba/wafsamba.py      2024-12-18 
10:06:06.068103800 +0100
@@ -19,6 +19,7 @@
 from samba_python import *
 from samba_perl import *
 from samba_deps import *
+from samba_rust import *
 from samba_bundled import *
 from samba_third_party import *
 import samba_cross
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tdb-1.4.12/buildtools/wafsamba/wscript 
new/tdb-1.4.13/buildtools/wafsamba/wscript
--- old/tdb-1.4.12/buildtools/wafsamba/wscript  2024-04-22 16:58:42.249157700 
+0200
+++ new/tdb-1.4.13/buildtools/wafsamba/wscript  2024-12-18 10:06:06.072103700 
+0100
@@ -8,6 +8,13 @@
 from samba_utils import symlink
 from optparse import SUPPRESS_HELP
 
+def get_libc_version():
+    import ctypes
+    libc = ctypes.CDLL("libc.so.6")
+    gnu_get_libc_version = libc.gnu_get_libc_version
+    gnu_get_libc_version.restype = ctypes.c_char_p
+    return gnu_get_libc_version().decode()
+
 phs = os.environ.get("PYTHONHASHSEED", None)
 if phs != "1":
     raise Errors.WafError('''PYTHONHASHSEED=1 missing! Don't use waf directly, 
use ./configure and make!''')
@@ -288,6 +295,9 @@
     opt.add_option('--disable-python',
                     help='do not generate python modules',
                     action='store_true', dest='disable_python', default=False)
+    opt.add_option('--enable-rust',
+                   help='build rust modules',
+                   action='store_true', dest='enable_rust', default=False)
 
 
 @Utils.run_once
@@ -351,6 +361,13 @@
     conf.env.AUTOCONF_PROGRAM_PREFIX = Options.options.AUTOCONF_PROGRAM_PREFIX
 
     conf.env.disable_python = Options.options.disable_python
+    conf.env.enable_rust = Options.options.enable_rust
+    if Options.options.enable_rust:
+        glibc_vers = float('.'.join(get_libc_version().split('.')[:2]))
+        if glibc_vers < 2.32:
+            conf.fatal('--enable-rust cannot be specified with '
+                       'glibc version %s' % glibc_vers)
+        conf.DEFINE('HAVE_RUST', '1')
 
     if (conf.env.AUTOCONF_HOST and
         conf.env.AUTOCONF_BUILD and
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tdb-1.4.12/lib/replace/README 
new/tdb-1.4.13/lib/replace/README
--- old/tdb-1.4.12/lib/replace/README   2022-01-24 14:19:31.481143500 +0100
+++ new/tdb-1.4.13/lib/replace/README   2025-01-09 09:52:30.294728300 +0100
@@ -40,7 +40,6 @@
 dlsym
 dlerror
 chroot
-bzero
 strerror
 errno
 mkdtemp
@@ -123,6 +122,5 @@
 volatile
 
 Prerequisites:
-memset (for bzero)
 syslog (for vsyslog)
 mktemp (for mkstemp and mkdtemp)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tdb-1.4.12/lib/replace/inet_pton.c 
new/tdb-1.4.13/lib/replace/inet_pton.c
--- old/tdb-1.4.12/lib/replace/inet_pton.c      2022-01-24 14:19:31.481143500 
+0100
+++ new/tdb-1.4.13/lib/replace/inet_pton.c      2024-12-18 10:06:06.096104000 
+0100
@@ -131,8 +131,6 @@
        const char *src;
        unsigned char *dst;
 {
-       static const char xdigits_l[] = "0123456789abcdef",
-                         xdigits_u[] = "0123456789ABCDEF";
        unsigned char tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp;
        const char *xdigits, *curtok;
        int ch, saw_xdigit;
@@ -151,8 +149,8 @@
        while ((ch = *src++) != '\0') {
                const char *pch;
 
-               if ((pch = strchr((xdigits = xdigits_l), ch)) == NULL)
-                       pch = strchr((xdigits = xdigits_u), ch);
+               if ((pch = strchr((xdigits = hexchars_lower), ch)) == NULL)
+                       pch = strchr((xdigits = hexchars_upper), ch);
                if (pch != NULL) {
                        val <<= 4;
                        val |= (pch - xdigits);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tdb-1.4.12/lib/replace/replace.c 
new/tdb-1.4.13/lib/replace/replace.c
--- old/tdb-1.4.12/lib/replace/replace.c        2023-07-07 12:35:30.849580300 
+0200
+++ new/tdb-1.4.13/lib/replace/replace.c        2024-12-18 10:06:06.096104000 
+0100
@@ -970,7 +970,7 @@
        }
 
 #if defined(HAVE_MEMSET_EXPLICIT)
-       memset_explicit(dest, destsz, ch, count);
+       memset_explicit(dest, ch, count);
 #else /* HAVE_MEMSET_EXPLICIT */
        memset(dest, ch, count);
 # if defined(HAVE_GCC_VOLATILE_MEMORY_PROTECTION)
@@ -1083,6 +1083,34 @@
 }
 #endif /* HAVE_COPY_FILE_RANGE */
 
+#ifdef HAVE_LINUX_IOCTL
+# include <linux/fs.h>
+# include <sys/ioctl.h>
+#endif
+
+ssize_t rep_copy_reflink(int src_fd,
+                        off_t src_off,
+                        int dst_fd,
+                        off_t dst_off,
+                        off_t to_copy)
+{
+#ifdef HAVE_LINUX_IOCTL
+       struct file_clone_range cr;
+
+       cr = (struct file_clone_range) {
+               .src_fd = src_fd,
+               .src_offset = (uint64_t)src_off,
+               .dest_offset = (uint64_t)dst_off,
+               .src_length = (uint64_t)to_copy,
+       };
+
+       return ioctl(dst_fd, FICLONERANGE, &cr);
+#else
+       errno = ENOSYS;
+       return -1;
+#endif
+}
+
 #ifndef HAVE_OPENAT2
 
 /* fallback known wellknown __NR_openat2 values */
@@ -1143,3 +1171,66 @@
 #endif
 }
 #endif /* !HAVE_OPENAT2 */
+
+#ifndef HAVE_RENAMEAT2
+
+/* fallback to wellknown __NR_renameat2 values */
+#ifndef __NR_renameat2
+# if defined(LINUX) && defined(HAVE_SYS_SYSCALL_H)
+#  if defined(__i386__)
+#   define __NR_renameat2 353
+#  elif defined(__x86_64__) && defined(__LP64__)
+#   define __NR_renameat2 316 /* 316 0x13C */
+#  elif defined(__x86_64__) && defined(__ILP32__)
+#   define __NR_renameat2 1073742140 /* 1073742140 0x4000013C */
+#  elif defined(__aarch64__)
+#   define __NR_renameat2 276
+#  elif defined(__arm__)
+#   define __NR_renameat2 382
+#  elif defined(__sparc__)
+#   define __NR_renameat2 345
+#  endif
+# endif /* defined(LINUX) && defined(HAVE_SYS_SYSCALL_H) */
+#endif /* !__NR_renameat2 */
+
+#ifdef DISABLE_OPATH
+/*
+ * systems without O_PATH also don't have renameat2,
+ * so make sure we at a realistic combination.
+ */
+#undef __NR_renameat2
+#endif /* DISABLE_OPATH */
+
+int rep_renameat2(int __oldfd, const char *__old, int __newfd,
+                 const char *__new, unsigned int __flags)
+{
+       if (__flags != 0) {
+#ifdef __NR_renameat2
+               int ret;
+
+               ret = syscall(__NR_renameat2,
+                             __oldfd,
+                             __old,
+                             __newfd,
+                             __new,
+                             __flags);
+               if (ret != -1 || errno != ENOSYS) {
+                       /*
+                        * if it's ENOSYS, we fallback
+                        * to EINVAL below, otherwise
+                        * we return what the kernel
+                        * did.
+                        */
+                       return ret;
+               }
+#endif
+               errno = EINVAL;
+               return -1;
+       }
+
+       return renameat(__oldfd, __old, __newfd, __new);
+}
+#endif /* ! HAVE_RENAMEAT2 */
+
+const char hexchars_lower[] = "0123456789abcdef";
+const char hexchars_upper[] = "0123456789ABCDEF";
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tdb-1.4.12/lib/replace/replace.h 
new/tdb-1.4.13/lib/replace/replace.h
--- old/tdb-1.4.12/lib/replace/replace.h        2024-04-22 16:58:42.293157800 
+0200
+++ new/tdb-1.4.13/lib/replace/replace.h        2025-01-09 09:52:30.294728300 
+0100
@@ -414,10 +414,6 @@
 int rep_initgroups(char *name, gid_t id);
 #endif
 
-#if !defined(HAVE_BZERO) && defined(HAVE_MEMSET)
-#define bzero(a,b) memset((a),'\0',(b))
-#endif
-
 #ifndef HAVE_DLERROR
 #define dlerror rep_dlerror
 char *rep_dlerror(void);
@@ -1014,6 +1010,15 @@
                            unsigned int flags);
 #endif /* HAVE_COPY_FILE_RANGE */
 
+
+#define copy_reflink rep_copy_reflink
+
+ssize_t rep_copy_reflink(int src_fd,
+                        off_t src_off,
+                        int dst_fd,
+                        off_t dst_off,
+                        off_t to_copy);
+
 #ifndef FALL_THROUGH
 # ifdef HAVE_FALLTHROUGH_ATTRIBUTE
 #  define FALL_THROUGH __attribute__ ((fallthrough))
@@ -1092,6 +1097,9 @@
        return ok;
 }
 
+extern const char hexchars_lower[];
+extern const char hexchars_upper[];
+
 /* Needed for Solaris atomic_add_XX functions. */
 #if defined(HAVE_SYS_ATOMIC_H)
 #include <sys/atomic.h>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tdb-1.4.12/lib/replace/snprintf.c 
new/tdb-1.4.13/lib/replace/snprintf.c
--- old/tdb-1.4.12/lib/replace/snprintf.c       2023-07-07 12:35:30.849580300 
+0200
+++ new/tdb-1.4.13/lib/replace/snprintf.c       2024-12-18 10:06:06.096104000 
+0100
@@ -832,9 +832,8 @@
        if (flags & DP_F_UP) caps = 1; /* Should characters be upper case? */
 
        do {
-               convert[place++] =
-                       (caps? "0123456789ABCDEF":"0123456789abcdef")
-                       [uvalue % (unsigned)base  ];
+               convert[place++] = (caps ? hex_upper
+                                        : hex_lower)[uvalue % (unsigned)base];
                uvalue = (uvalue / (unsigned)base );
        } while(uvalue && (place < sizeof(convert)));
        if (place == sizeof(convert)) place--;
@@ -1028,8 +1027,8 @@
                idx = (int) ((temp -intpart +0.05)* 10.0);
                /* idx = (int) (((double)(temp*0.1) -intpart +0.05) *10.0); */
                /* printf ("%llf, %f, %x\n", temp, intpart, idx); */
-               iconvert[iplace++] =
-                       (caps? "0123456789ABCDEF":"0123456789abcdef")[idx];
+               iconvert[iplace++] = (caps ? hexchars_upper
+                                          : hexchars_lower)[idx];
        } while (intpart && (iplace < 311));
        if (iplace == 311) iplace--;
        iconvert[iplace] = 0;
@@ -1043,8 +1042,8 @@
                        idx = (int) ((temp -fracpart +0.05)* 10.0);
                        /* idx = (int) ((((temp/10) -fracpart) +0.05) *10); */
                        /* printf ("%lf, %lf, %ld\n", temp, fracpart, idx ); */
-                       fconvert[fplace++] =
-                       (caps? "0123456789ABCDEF":"0123456789abcdef")[idx];
+                       fconvert[fplace++] = (caps ? hexchars_upper
+                                                  : hexchars_lower)[idx];
                } while(fracpart && (fplace < 311));
                if (fplace == 311) fplace--;
        }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tdb-1.4.12/lib/replace/system/filesys.h 
new/tdb-1.4.13/lib/replace/system/filesys.h
--- old/tdb-1.4.12/lib/replace/system/filesys.h 2023-07-07 12:08:52.587889000 
+0200
+++ new/tdb-1.4.13/lib/replace/system/filesys.h 2024-08-29 10:46:24.171477000 
+0200
@@ -278,4 +278,33 @@
        rep_openat2(dirfd, pathname, how, size)
 #endif /* !HAVE_OPENAT2 */
 
+#ifdef DISABLE_OPATH
+/*
+ * Without O_PATH, the kernel
+ * most likely doesn't have renameat2() too
+ * and we should test the fallback code
+ */
+#undef HAVE_RENAMEAT2
+#endif
+
+#ifndef HAVE_RENAMEAT2
+
+#ifndef RENAME_NOREPLACE
+# define RENAME_NOREPLACE (1 << 0)
+#endif
+
+#ifndef RENAME_EXCHANGE
+# define RENAME_EXCHANGE (1 << 1)
+#endif
+
+#ifndef RENAME_WHITEOUT
+# define RENAME_WHITEOUT (1 << 2)
+#endif
+
+int rep_renameat2(int __oldfd, const char *__old, int __newfd,
+                 const char *__new, unsigned int __flags);
+#define renameat2(__oldfd, __old, __newfd, __new, __flags) \
+       rep_renameat2(__oldfd, __old, __newfd, __new, __flags)
+#endif /* !HAVE_RENAMEAT2 */
+
 #endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tdb-1.4.12/lib/replace/system/readline.h 
new/tdb-1.4.13/lib/replace/system/readline.h
--- old/tdb-1.4.12/lib/replace/system/readline.h        2022-01-24 
14:19:31.481143500 +0100
+++ new/tdb-1.4.13/lib/replace/system/readline.h        2025-02-05 
09:46:57.686248500 +0100
@@ -1,14 +1,14 @@
 #ifndef _system_readline_h
 #define _system_readline_h
-/* 
+/*
    Unix SMB/CIFS implementation.
 
    Readline wrappers
-   
+
      ** NOTE! The following LGPL license applies to the replace
      ** library. This does NOT imply that all of Samba is released
      ** under the LGPL
-   
+
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
@@ -46,7 +46,9 @@
 #endif
 
 #ifdef HAVE_NEW_LIBREADLINE
-#ifdef HAVE_CPPFUNCTION
+#if defined(HAVE_RL_COMPLETION_FUNC_T)
+#  define RL_COMPLETION_CAST (rl_completion_func_t *)
+#elif defined(HAVE_CPPFUNCTION)
 #  define RL_COMPLETION_CAST (CPPFunction *)
 #elif defined(HAVE_RL_COMPLETION_T)
 #  define RL_COMPLETION_CAST (rl_completion_t *)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tdb-1.4.12/lib/replace/tests/testsuite.c 
new/tdb-1.4.13/lib/replace/tests/testsuite.c
--- old/tdb-1.4.12/lib/replace/tests/testsuite.c        2024-02-22 
14:51:09.997856900 +0100
+++ new/tdb-1.4.13/lib/replace/tests/testsuite.c        2025-01-09 
09:52:30.294728300 +0100
@@ -451,12 +451,6 @@
        return true;
 }
 
-static int test_bzero(void)
-{
-       /* FIXME: bzero */
-       return true;
-}
-
 static int test_strerror(void)
 {
        /* FIXME */
@@ -1200,7 +1194,6 @@
        ret &= test_seekdir();
        ret &= test_dlopen();
        ret &= test_chroot();
-       ret &= test_bzero();
        ret &= test_strerror();
        ret &= test_errno();
        ret &= test_mkdtemp();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tdb-1.4.12/lib/replace/wscript 
new/tdb-1.4.13/lib/replace/wscript
--- old/tdb-1.4.12/lib/replace/wscript  2023-08-08 11:24:03.873700600 +0200
+++ new/tdb-1.4.13/lib/replace/wscript  2025-01-09 09:52:30.298728500 +0100
@@ -397,7 +397,7 @@
                     msg='Checking for fallthrough attribute')
 
     # these may be builtins, so we need the link=False strategy
-    conf.CHECK_FUNCS('strdup memmem printf memset memcpy memmove strcpy 
strncpy bzero', link=False)
+    conf.CHECK_FUNCS('strdup memmem printf memcpy memmove strcpy strncpy', 
link=False)
 
     # See https://bugzilla.samba.org/show_bug.cgi?id=1097
     #
@@ -422,7 +422,7 @@
     conf.CHECK_FUNCS('link readlink symlink realpath snprintf vsnprintf')
     conf.CHECK_FUNCS('asprintf vasprintf setenv unsetenv strnlen strtoull 
__strtoull')
     conf.CHECK_FUNCS('strtouq strtoll __strtoll strtoq memalign 
posix_memalign')
-    conf.CHECK_FUNCS('fmemopen')
+    conf.CHECK_FUNCS('fmemopen renameat2')
 
     if conf.CONFIG_SET('HAVE_MEMALIGN'):
         conf.CHECK_DECLS('memalign', headers='malloc.h')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tdb-1.4.12/wscript new/tdb-1.4.13/wscript
--- old/tdb-1.4.12/wscript      2024-08-06 15:14:43.378543100 +0200
+++ new/tdb-1.4.13/wscript      2025-02-06 13:35:11.054717300 +0100
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 
 APPNAME = 'tdb'
-VERSION = '1.4.12'
+VERSION = '1.4.13'
 
 import sys, os
 

Reply via email to