lib: Add tdb_data_dbg() Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
s3/lib: don't write to buffer (which might be NULL) if bufsize <=0 Some code depends that tdb_pack[va] will return the bytes it would write to 'buf' if the bufsize passed in is <=0, writing to the buffer is protected by with lines like if (bufsize && bufsize >= len) { /* write to 'buf' */ } however in these instances the local pointer to the buffer is still modified buf += len; It's quite probable if bufsize == 0 that buf itself is NULL, in this case we should protect against performing pointer arithmetic. Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andreas Schneider <asn@samba.org>
s3:lib: Fix undefined behavior in tdb_unpack() Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz> Autobuild-User(master): Gary Lockyer <gary@samba.org> Autobuild-Date(master): Tue Dec 4 00:23:03 CET 2018 on sn-devel-144
s3:lib: Fix undefined behavior in tdb_pack() util_tdb.c:98:5: runtime error: null pointer passed as argument 2, which is declared to never be null This means the second argument of memcpy() can't be NULL. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
s3:lib: Fix uninitialized variable util_tdb.c:116:7: error: ‘len’ may be used uninitialized in this function [-Werror=maybe-uninitialized] buf += len; ^~ ../../source3/lib/util_tdb.c:44:6: note: ‘len’ was declared here int len; ^~~ Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
lib: Remove unused tdb_trans_* functions The transactions have all moved to dbwrap Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
tdb_unpack: Protect against overflow Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
tdb_unpack: Correct "len" arg for "B" format All but one of the users of the "B" format specifier passed in a pointer to uint32_t instead of what tdb_unpack expected, an "int". Because this is a purely internal API, change the tdb_unpack function and adjust that one caller. To reviewers: Please check carefully, thanks :-) Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
tdb_unpack: Convert to size_t for internal calculations Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
lib: Remove unused tdb_pack_append() Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
s3-lib: Fix format-nonliteral warning BUG: https://bugzilla.samba.org/show_bug.cgi?id=12168 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
s3-lib: Pass missing argument for format string BUG: https://bugzilla.samba.org/show_bug.cgi?id=12163 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Volker Lendecke <vl@samba.org>
Convert all uint32/16/8 to _t in source3/lib. Signed-off-by: Richard Sharpe <rsharpe@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
lib: Remove tdb_open_compat Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
lib: Move tdb lock timeout fns to source3 This is not the nicest code and needs to be replaced. Remove it from common. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net>
util_tdb: add function tdb_data_string() Signed-off-by: Gregor Beck <gbeck@sernet.de> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
tdb: return unpack error on strdup failure Signed-off-by: Lars Müller <lars@samba.org> Autobuild-User(master): David Disseldorp <ddiss@samba.org> Autobuild-Date(master): Fri Aug 31 21:05:21 CEST 2012 on sn-devel-104
util_tdb: move timeout chainlock variants from source3/lib/util/util_tdb.c We're about to use them for dbwrap. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
TDB2: make SAMBA use tdb1 again for the moment. Otherwise the following surgery will break the SAMBA build and testsuite. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
lib/util: Move map_nt_error_from_tdb to the top level This will help with making dbwrap available as a top level library. Andrew Bartlett