[SCM] Samba Shared Repository - branch v4-10-stable updated
Karolin Seeger
kseeger at samba.org
Wed Apr 3 08:45:09 UTC 2019
The branch, v4-10-stable has been updated
via e0cc225f8a4 VERSION: Disable GIT_SNAPSHOT for the 4.10.1 release.
via 17f3d535c71 WHATSNEW: Add release notes for Samba 4.10.1.
via af05bf7911e libcli: permit larger values of DataLength in SMB2_ENCRYPTION_CAPABILITIES of negotiate response
via 815be52b600 lib: Make fd_load work for non-regular files
via e769bd66089 s4/messaging: Fix undefined reference in linking libMESSAGING-samba4.so
via 0e94b0a3144 s4:dlz make b9_has_soa check dc=@ node
via 7921aa6365b dlz: Add test to ensure there are writable zones
via 78b72ff339d regfio tests: Update comment style to match README.Coding
via 722c5b32548 regfio: Update code near recent changes to match README.Coding
via d4ef858ec11 regfio: Improve handling of malformed registry hive files
via bf6a8517820 regfio: Add trivial unit test
via cfffac0fc9f regfio: Use correct function names in debug information
via 3f278c3f911 Fix typos in "valid"
via 76b38e19d3c py/logger: use python 2.6 compatible arguments
via f52ebe258ba py/uptodateness: use 2.6 compatible dictionary construction
via 9b8398ecbbd py/kcc_utils: py2.6 compatibility
via 75b6e02a8e6 py/graph: use 2.6 compatible check for set membership
via 868356cf365 acl_read: Fix regression caused by db15fcfa899e1fe4d6994f68ceb299921b8aa6f1 for empty lists
via 286b80cb7a3 ldb: cmocka test for empty attributes bug
via 10a390e8975 dbcheck: use the str() value of the "name" attribute
via 6602a77b649 dbcheck: don't check expired tombstone objects by default anymore
via 4b658a5a396 blackbox/dbcheck-links.sh: prepare regression test for skipping expired tombstones
via 40b6af9c000 blackbox/dbcheck*.sh: pass --selftest-check-expired-tombstones to dbcheck
via b292ef1d9f6 dbcheck: add --selftest-check-expired-tombstones cmdline option
via 178fad24f2c python/samba/netcmd: provide SUPPRESS_HELP via Option class
via 89fb9d0a81b dbcheck: detect the change after deletion bug
via 4f0b554b955 blackbox/dbcheck-links.sh: add regression test for lost deleted object repair
via caf0caba4e4 dbcheck: add find_repl_attid() helper function
via a47b27b2c96 dbcheck: don't remove dangling one-way links on already deleted objects
via 0c2f7224e07 dbcheck: don't move already deleted objects to LostAndFound
via 95f5b9f246a dbcheck: do isDeleted, systemFlags and replPropertyMetaData detection first
via 8736fb5eb4e dbcheck: use DSDB_CONTROL_DBCHECK_FIX_LINK_DN_NAME when renaming deleted objects
via 3e539f756ac dsdb:repl_meta_data: allow CONTROL_DBCHECK_FIX_LINK_DN_NAME to by pass rename
via 4fc17804088 blackbox/dbcheck-links.sh: reproduce lost deleted object problem
via 8d1241dac6b blackbox/*.sh: pass -u to 'diff'
via 18f4167198a selftest: force running with TZ=UTC
via 2d4820f0a8e s3:waf: Fix the detection of makdev() macro on Linux
via a21e9754c74 s3:tests: Add test for smbstatus and smbstatus --resolve_uids
via 79d3de4de41 selftest: Add smbstatus to testhelper
via b866bdbe4fa s3:utils: Add 'smbstatus -L --resolve-uids' to show usernames
via 084d2f1bc4f s3:utils: Use C99 initializer for poptOption in smbstatus
via c8e8d97959d s3:lib: Fix the debug message for adding cache entries.
via f6df8d97686 s4:librpc: Fix installation of Samba
via eb632754830 ctdb-tests: Add some testing for IPv4-mapped IPv6 address parsing
via 909cecd3606 ctdb: Initialize addr struct to zero before reparsing as IPV4
via fc4e3273316 ctdb-packaging: Test package requires tcpdump
via 755f624e2bb ctdb-packaging: ctdb package should not own system library directory
via 84aad2ea7d5 s3:client: Fix smbspool device uri handling
via c6f1719b5e2 s3:client: Make sure we work on a copy of the title
via 0db9487434a s3:client: Evaluate the AUTH_INFO_REQUIRED variable set by cups
via 18515064c9b s3:client: Pass DEVICE_URI and AUTH_INFO_REQUIRED env to smbspool
via d3ed17e74e7 s3:script: Fix jobid check in test_smbspool.sh
via 4cafdc7f2eb ctdb-tests: Build cluster mutex path manually
via 5f1d98c233e ndr_spoolss_buf: fix out of scope use of stack variable in NDR_SPOOLSS_PUSH_ENUM_OUT()
via f515f1a5486 ctdb-version: Simplify version string usage
via 6401d809566 ctdb-build: Drop creation of .distversion in tarball
via 2b30986174d ctdb-build: use a fixed ctdb_version.h using SAMBA_VERSION_STRING
via 3170d75b5f1 VERSION: Bump version up to 4.10.1...
from 25f2fe02a61 VERSION: Disable GIT_SNAPSHOT for the 4.10.0 release.
https://git.samba.org/?p=samba.git;a=shortlog;h=v4-10-stable
- Log -----------------------------------------------------------------
-----------------------------------------------------------------------
Summary of changes:
VERSION | 2 +-
WHATSNEW.txt | 82 +++++
ctdb/.gitignore | 1 -
ctdb/common/version.c | 20 --
ctdb/common/version.h | 18 --
ctdb/packaging/RPM/ctdb.spec.in | 4 +-
ctdb/protocol/protocol_util.c | 3 +
ctdb/server/ctdb_daemon.c | 4 +-
ctdb/tests/local_daemons.sh | 3 +-
ctdb/tests/src/protocol_util_test.c | 19 ++
ctdb/tools/ctdb.c | 4 +-
ctdb/wscript | 25 +-
lib/util/util_file.c | 63 +++-
libcli/smb/smbXcli_base.c | 2 +-
librpc/ndr/ndr_spoolss_buf.c | 4 +-
python/samba/dbchecker.py | 228 +++++++++++--
python/samba/graph.py | 2 +-
python/samba/kcc/kcc_utils.py | 4 +-
python/samba/logger.py | 2 +-
python/samba/netcmd/__init__.py | 1 +
python/samba/netcmd/dbcheck.py | 13 +-
python/samba/uptodateness.py | 2 +-
selftest/selftest.pl | 3 +
selftest/selftesthelpers.py | 1 +
selftest/tests.py | 2 +
source3/client/smbspool.c | 160 ++++++---
source3/client/smbspool_krb5_wrapper.c | 24 +-
source3/lib/gencache.c | 8 +-
source3/registry/regfio.c | 29 +-
source3/registry/tests/test_regfio.c | 184 +++++++++++
source3/script/tests/test_smbspool.sh | 4 +-
source3/script/tests/test_smbstatus.sh | 155 +++++++++
source3/selftest/tests.py | 6 +-
source3/torture/torture.c | 2 +-
source3/utils/status.c | 135 +++++++-
source3/wscript | 3 +
source3/wscript_build | 6 +
source4/dns_server/dlz_bind9.c | 11 +
source4/dsdb/common/tests/dsdb.c | 93 ++++++
source4/dsdb/samdb/ldb_modules/acl_read.c | 3 -
source4/dsdb/samdb/ldb_modules/repl_meta_data.c | 7 +
source4/lib/messaging/messaging_handlers.c | 4 +-
source4/librpc/wscript_build | 8 -
...cted-dbcheck-link-output-lost-deleted-user1.txt | 9 +
...cted-dbcheck-link-output-lost-deleted-user2.txt | 8 +
...cted-dbcheck-link-output-lost-deleted-user3.txt | 19 ++
source4/selftest/tests.py | 3 +
source4/torture/dns/dlz_bind9.c | 7 +
source4/torture/wscript_build | 9 +
testdata/samba3/regfio_corrupt_hbin1.dat | Bin 0 -> 5120 bytes
testdata/samba3/regfio_corrupt_lf_subkeys.dat | Bin 0 -> 5120 bytes
testprogs/blackbox/dbcheck-links.sh | 356 ++++++++++++++++++++-
testprogs/blackbox/dbcheck-oldrelease.sh | 42 +--
testprogs/blackbox/tombstones-expunge.sh | 14 +-
54 files changed, 1574 insertions(+), 247 deletions(-)
delete mode 100644 ctdb/common/version.c
delete mode 100644 ctdb/common/version.h
create mode 100644 source3/registry/tests/test_regfio.c
create mode 100755 source3/script/tests/test_smbstatus.sh
create mode 100644 source4/dsdb/common/tests/dsdb.c
create mode 100644 source4/selftest/provisions/release-4-5-0-pre1/expected-dbcheck-link-output-lost-deleted-user1.txt
create mode 100644 source4/selftest/provisions/release-4-5-0-pre1/expected-dbcheck-link-output-lost-deleted-user2.txt
create mode 100644 source4/selftest/provisions/release-4-5-0-pre1/expected-dbcheck-link-output-lost-deleted-user3.txt
create mode 100644 testdata/samba3/regfio_corrupt_hbin1.dat
create mode 100644 testdata/samba3/regfio_corrupt_lf_subkeys.dat
Changeset truncated at 500 lines:
diff --git a/VERSION b/VERSION
index 48820391c4f..5331743670e 100644
--- a/VERSION
+++ b/VERSION
@@ -25,7 +25,7 @@
########################################################
SAMBA_VERSION_MAJOR=4
SAMBA_VERSION_MINOR=10
-SAMBA_VERSION_RELEASE=0
+SAMBA_VERSION_RELEASE=1
########################################################
# If a official release has a serious bug #
diff --git a/WHATSNEW.txt b/WHATSNEW.txt
index 5d3d23ab9da..9fd3e8abe10 100644
--- a/WHATSNEW.txt
+++ b/WHATSNEW.txt
@@ -1,3 +1,85 @@
+ ==============================
+ Release Notes for Samba 4.10.1
+ April 3, 2019
+ ==============================
+
+
+This is the latest stable release of the Samba 4.10 release series.
+
+
+Changes since 4.10.0:
+---------------------
+
+o Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
+ * BUG 13837: py/kcc_utils: py2.6 compatibility.
+
+o Philipp Gesang <philipp.gesang at intra2net.com>
+ * BUG 13869: libcli: permit larger values of DataLength in
+ SMB2_ENCRYPTION_CAPABILITIES of negotiate response.
+
+o Michael Hanselmann <public at hansmi.ch>
+ * BUG 13840: regfio: Improve handling of malformed registry hive files.
+
+o Amitay Isaacs <amitay at samba.org>
+ * BUG 13789: ctdb-version: Simplify version string usage.
+
+o Volker Lendecke <vl at samba.org>
+ * BUG 13859: lib: Make fd_load work for non-regular files.
+
+o Stefan Metzmacher <metze at samba.org>
+ * BUG 13816: dbcheck in the middle of the tombstone garbage collection causes
+ replication failures, dbcheck: add --selftest-check-expired-tombstones
+ cmdline option.
+ * BUG 13818: ndr_spoolss_buf: Fix out of scope use of stack variable in
+ NDR_SPOOLSS_PUSH_ENUM_OUT().
+
+o Anoop C S <anoopcs at redhat.com>
+ * BUG 13854: s4/messaging: Fix undefined reference in linking
+ libMESSAGING-samba4.so.
+
+o Garming Sam <garming at catalyst.net.nz>
+ * BUG 13836: acl_read: Fix regression for empty lists.
+
+o Michael Saxl <mike at mwsys.mine.bz>
+ * BUG 13841: s4:dlz make b9_has_soa check dc=@ node.
+
+o Andreas Schneider <asn at samba.org>
+ * BUG 13832: s3:client: Fix printing via smbspool backend with kerberos auth.
+ * BUG 13847: s4:librpc: Fix installation of Samba.
+ * BUG 13848: s3:lib: Fix the debug message for adding cache entries.
+ * BUG 13793: s3:utils: Add 'smbstatus -L --resolve-uids' to show username.
+ * BUG 13848: s3:lib: Fix the debug message for adding cache entries.
+ * BUG 13853: s3:waf: Fix the detection of makdev() macro on Linux.
+
+o Martin Schwenke <martin at meltin.net>
+ * BUG 13789: ctdb-build: Drop creation of .distversion in tarball.
+ * BUG 13838: ctdb-packaging: Test package requires tcpdump, ctdb package
+ should not own system library directory.
+
+
+#######################################
+Reporting bugs & Development Discussion
+#######################################
+
+Please discuss this release on the samba-technical mailing list or by
+joining the #samba-technical IRC channel on irc.freenode.net.
+
+If you do report problems then please try to send high quality
+feedback. If you don't provide vital information to help us track down
+the problem then you will probably be ignored. All bug reports should
+be filed under the "Samba 4.1 and newer" product in the project's Bugzilla
+database (https://bugzilla.samba.org/).
+
+
+======================================================================
+== Our Code, Our Bugs, Our Responsibility.
+== The Samba Team
+======================================================================
+
+
+Release notes for older releases follow:
+----------------------------------------
+
==============================
Release Notes for Samba 4.10.0
March 19, 2019
diff --git a/ctdb/.gitignore b/ctdb/.gitignore
index a634aeb8b45..f0534b3afd1 100644
--- a/ctdb/.gitignore
+++ b/ctdb/.gitignore
@@ -27,7 +27,6 @@ tests/takeover/ctdb_takeover.pyc
tests/eventscripts/var
tests/eventscripts/etc/iproute2
tests/eventscripts/etc-ctdb/policy_routing
-include/ctdb_version.h
packaging/RPM/ctdb.spec
doc/*.[1-7]
doc/*.[1-7].html
diff --git a/ctdb/common/version.c b/ctdb/common/version.c
deleted file mode 100644
index e34e98c09ef..00000000000
--- a/ctdb/common/version.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- CTDB version string
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "ctdb_version.h"
-
-const char ctdb_version_string[] = CTDB_VERSION_STRING;
diff --git a/ctdb/common/version.h b/ctdb/common/version.h
deleted file mode 100644
index 1cf1c5d0cab..00000000000
--- a/ctdb/common/version.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- CTDB version string
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, see <http://www.gnu.org/licenses/>.
-*/
-
-extern const char ctdb_version_string[];
diff --git a/ctdb/packaging/RPM/ctdb.spec.in b/ctdb/packaging/RPM/ctdb.spec.in
index d25735e06e0..efece159bdc 100644
--- a/ctdb/packaging/RPM/ctdb.spec.in
+++ b/ctdb/packaging/RPM/ctdb.spec.in
@@ -222,7 +222,7 @@ fi
%{_bindir}/onnode
%dir %{_libexecdir}/ctdb
%{_libexecdir}/ctdb/*
-%dir %{_libdir}
+%dir %{_libdir}/ctdb
%{_libdir}/ctdb/lib*
%dir %{_datadir}/ctdb/events
%{_datadir}/ctdb/events/*
@@ -258,7 +258,7 @@ development libraries for ctdb
Summary: CTDB test suite
Group: Development/Tools
Requires: ctdb = %{version}
-Requires: nc
+Requires: nc, tcpdump
%description tests
test suite for ctdb
diff --git a/ctdb/protocol/protocol_util.c b/ctdb/protocol/protocol_util.c
index 75427e44f50..a09292c72a9 100644
--- a/ctdb/protocol/protocol_util.c
+++ b/ctdb/protocol/protocol_util.c
@@ -251,6 +251,9 @@ static int ip_from_string(const char *str, ctdb_sock_addr *addr)
if (memcmp(&addr->ip6.sin6_addr.s6_addr[0],
ipv4_mapped_prefix,
sizeof(ipv4_mapped_prefix)) == 0) {
+ /* Initialize addr struct to zero before reparsing as IPV4 */
+ ZERO_STRUCTP(addr);
+
/* Reparse as IPv4 */
ret = ipv4_from_string(p+1, &addr->ip);
}
diff --git a/ctdb/server/ctdb_daemon.c b/ctdb/server/ctdb_daemon.c
index aac331dd1dd..a8691388d4a 100644
--- a/ctdb/server/ctdb_daemon.c
+++ b/ctdb/server/ctdb_daemon.c
@@ -36,7 +36,7 @@
#include "lib/util/blocking.h"
#include "lib/util/become_daemon.h"
-#include "common/version.h"
+#include "version.h"
#include "ctdb_private.h"
#include "ctdb_client.h"
@@ -1237,7 +1237,7 @@ int ctdb_start_daemon(struct ctdb_context *ctdb, bool do_fork)
ctdb->ctdbd_pid = getpid();
DEBUG(DEBUG_ERR, ("Starting CTDBD (Version %s) as PID: %u\n",
- ctdb_version_string, ctdb->ctdbd_pid));
+ SAMBA_VERSION_STRING, ctdb->ctdbd_pid));
ctdb_create_pidfile(ctdb);
/* create a unix domain stream socket to listen to */
diff --git a/ctdb/tests/local_daemons.sh b/ctdb/tests/local_daemons.sh
index 07cf1e9b135..3c3897feb50 100755
--- a/ctdb/tests/local_daemons.sh
+++ b/ctdb/tests/local_daemons.sh
@@ -193,7 +193,8 @@ local_daemons_setup ()
_recovery_lock="${directory}/rec.lock"
if $_recovery_lock_use_command ; then
- _recovery_lock="! ${CTDB_CLUSTER_MUTEX_HELPER} ${_recovery_lock}"
+ _helper="${CTDB_SCRIPTS_HELPER_BINDIR}/ctdb_mutex_fcntl_helper"
+ _recovery_lock="! ${_helper} ${_recovery_lock}"
fi
if [ -n "$_socket_wrapper" ] ; then
diff --git a/ctdb/tests/src/protocol_util_test.c b/ctdb/tests/src/protocol_util_test.c
index 178ce1d6429..edd2a3411a0 100644
--- a/ctdb/tests/src/protocol_util_test.c
+++ b/ctdb/tests/src/protocol_util_test.c
@@ -52,6 +52,20 @@ static void test_sock_addr_from_string_bad(const char *ip, bool with_port)
assert(ret == EINVAL);
}
+static void test_sock_addr_from_string_memcmp(const char *ip1,
+ const char* ip2)
+{
+ ctdb_sock_addr sa1, sa2;
+ int ret;
+
+ ret = ctdb_sock_addr_from_string(ip1, &sa1, false);
+ assert(ret == 0);
+ ret = ctdb_sock_addr_from_string(ip2, &sa2, false);
+ assert(ret == 0);
+ ret = memcmp(&sa1, &sa2, sizeof(ctdb_sock_addr));
+ assert(ret == 0);
+}
+
static void test_sock_addr_cmp(const char *ip1, const char *ip2,
bool with_port, int res)
{
@@ -329,6 +343,11 @@ int main(int argc, char *argv[])
test_sock_addr_from_string_bad("junk", false);
test_sock_addr_from_string_bad("0.0.0.0:0 trailing junk", true);
+ test_sock_addr_from_string_memcmp("127.0.0.1", "127.0.0.1");
+ test_sock_addr_from_string_memcmp("fe80::6af7:28ff:fefa:d136",
+ "fe80::6af7:28ff:fefa:d136");
+ test_sock_addr_from_string_memcmp("::ffff:192.0.2.128", "192.0.2.128");
+
test_sock_addr_cmp("127.0.0.1", "127.0.0.1" , false, 0);
test_sock_addr_cmp("127.0.0.1", "127.0.0.2" , false, -1);
test_sock_addr_cmp("127.0.0.2", "127.0.0.1" , false, 1);
diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c
index ee64566ba04..0fbe54c9f83 100644
--- a/ctdb/tools/ctdb.c
+++ b/ctdb/tools/ctdb.c
@@ -30,7 +30,7 @@
#include <tevent.h>
#include <tdb.h>
-#include "common/version.h"
+#include "version.h"
#include "lib/util/debug.h"
#include "lib/util/samba_util.h"
#include "lib/util/sys_rw.h"
@@ -718,7 +718,7 @@ static int run_helper(TALLOC_CTX *mem_ctx, const char *command,
static int control_version(TALLOC_CTX *mem_ctx, struct ctdb_context *ctdb,
int argc, const char **argv)
{
- printf("%s\n", ctdb_version_string);
+ printf("%s\n", SAMBA_VERSION_STRING);
return 0;
}
diff --git a/ctdb/wscript b/ctdb/wscript
index c2f1956a916..4adf60046c3 100644
--- a/ctdb/wscript
+++ b/ctdb/wscript
@@ -340,15 +340,6 @@ def configure(conf):
else:
Logs.info(" %s: no" % (m))
-def gen_ctdb_version(task):
- fp = open(task.outputs[0].bldpath(task.env), 'w')
- fp.write('/* This file is auto-generated from waf */\n')
- fp.write('#include "version.h"\n')
- fp.write('\n')
- fp.write('#define CTDB_VERSION_STRING "%s"\n' % get_version_string())
- fp.close()
-
-
def build(bld):
if bld.env.standalone_ctdb:
# enable building of public headers in the build tree
@@ -357,12 +348,6 @@ def build(bld):
if bld.env.standalone_ctdb:
bld.SAMBA_MKVERSION('version.h', '%s/VERSION' % vdir)
- t = bld.SAMBA_GENERATOR('ctdb-version-header',
- target='include/ctdb_version.h',
- rule=gen_ctdb_version,
- dep_vars=['VERSION'])
- t.env.VERSION = get_version_string()
-
bld.env.PKGCONFIGDIR = '${LIBDIR}/pkgconfig'
bld.RECURSE('lib/replace')
@@ -427,7 +412,7 @@ def build(bld):
pidfile.c run_proc.c
hash_count.c
run_event.c event_script.c
- sock_client.c version.c
+ sock_client.c
cmdline.c path.c conf.c line.c
'''),
deps='''samba-util sys_rw tevent-util
@@ -1181,14 +1166,6 @@ def manpages(ctx):
def distonly(ctx):
samba_dist.DIST_FILES('VERSION:VERSION', extend=True)
- version = get_version()
-
- distfile = open('.distversion', 'w')
- for field in version.vcs_fields:
- distfile.write('%s=%s\n' % (field, str(version.vcs_fields[field])))
- distfile.close()
- samba_dist.DIST_FILES('ctdb/.distversion:.distversion', extend=True)
-
t = 'ctdb.spec'
sed_expr1 = 's/@VERSION@/%s/g' % get_version_string()
sed_expr2 = 's/@RELEASE@/%s/g' % '1'
diff --git a/lib/util/util_file.c b/lib/util/util_file.c
index 926eda240f6..29c0be91b6b 100644
--- a/lib/util/util_file.c
+++ b/lib/util/util_file.c
@@ -168,30 +168,63 @@ load a file into memory from a fd.
**/
_PUBLIC_ char *fd_load(int fd, size_t *psize, size_t maxsize, TALLOC_CTX *mem_ctx)
{
- struct stat sbuf;
- char *p;
- size_t size;
+ FILE *file;
+ char *p = NULL;
+ size_t size = 0;
+ size_t chunk = 1024;
+ int err;
+
+ if (maxsize == 0) {
+ maxsize = SIZE_MAX;
+ }
- if (fstat(fd, &sbuf) != 0) return NULL;
+ file = fdopen(fd, "r");
+ if (file == NULL) {
+ return NULL;
+ }
- size = sbuf.st_size;
+ while (size < maxsize) {
+ size_t newbufsize;
+ size_t nread;
- if (maxsize) {
- size = MIN(size, maxsize);
- }
+ chunk = MIN(chunk, (maxsize - size));
- p = (char *)talloc_size(mem_ctx, size+1);
- if (!p) return NULL;
+ newbufsize = size + (chunk+1); /* chunk+1 can't overflow */
+ if (newbufsize < size) {
+ goto fail; /* overflow */
+ }
- if (read(fd, p, size) != size) {
- talloc_free(p);
- return NULL;
+ p = talloc_realloc(mem_ctx, p, char, newbufsize);
+ if (p == NULL) {
+ goto fail;
+ }
+
+ nread = fread(p+size, 1, chunk, file);
+ size += nread;
+
+ if (nread != chunk) {
+ break;
+ }
}
- p[size] = 0;
- if (psize) *psize = size;
+ err = ferror(file);
+ if (err != 0) {
+ goto fail;
+ }
+ p[size] = '\0';
+
+ if (psize != NULL) {
+ *psize = size;
+ }
+
+ fclose(file);
return p;
+
+fail:
+ TALLOC_FREE(p);
+ fclose(file);
+ return NULL;
}
/**
diff --git a/libcli/smb/smbXcli_base.c b/libcli/smb/smbXcli_base.c
index a237bf17d0a..a8c73be445a 100644
--- a/libcli/smb/smbXcli_base.c
+++ b/libcli/smb/smbXcli_base.c
@@ -5064,7 +5064,7 @@ static void smbXcli_negprot_smb2_done(struct tevent_req *subreq)
return;
}
- if (cipher->data.length != (2 + 2 * cipher_count)) {
+ if (cipher->data.length < (2 + 2 * cipher_count)) {
tevent_req_nterror(req,
NT_STATUS_INVALID_NETWORK_RESPONSE);
return;
diff --git a/librpc/ndr/ndr_spoolss_buf.c b/librpc/ndr/ndr_spoolss_buf.c
index c1d175fcbe5..244d692dca8 100644
--- a/librpc/ndr/ndr_spoolss_buf.c
+++ b/librpc/ndr/ndr_spoolss_buf.c
@@ -43,7 +43,8 @@
} while(0)
#define NDR_SPOOLSS_PUSH_ENUM_OUT(fn) do { \
- struct ndr_push *_ndr_info;\
+ DATA_BLOB _data_blob_info = data_blob_null;\
+ struct ndr_push *_ndr_info = NULL;\
_r.in.level = r->in.level;\
_r.in.buffer = r->in.buffer;\
_r.in.offered = r->in.offered;\
@@ -56,7 +57,6 @@
"SPOOLSS Buffer: *r->out.info but there's no r->in.buffer");\
}\
if (r->in.buffer) {\
- DATA_BLOB _data_blob_info;\
_ndr_info = ndr_push_init_ctx(ndr);\
NDR_ERR_HAVE_NO_MEMORY(_ndr_info);\
_ndr_info->flags= ndr->flags;\
diff --git a/python/samba/dbchecker.py b/python/samba/dbchecker.py
index bf999ddaab9..d341983738a 100644
--- a/python/samba/dbchecker.py
+++ b/python/samba/dbchecker.py
@@ -60,7 +60,8 @@ class dbcheck(object):
def __init__(self, samdb, samdb_schema=None, verbose=False, fix=False,
yes=False, quiet=False, in_transaction=False,
- reset_well_known_acls=False):
+ reset_well_known_acls=False,
+ check_expired_tombstones=False):
self.samdb = samdb
self.dict_oid_name = None
self.samdb_schema = (samdb_schema or samdb)
@@ -107,6 +108,8 @@ class dbcheck(object):
self.fix_doubled_userparameters = False
self.fix_sid_rid_set_conflict = False
self.reset_well_known_acls = reset_well_known_acls
+ self.check_expired_tombstones = check_expired_tombstones
+ self.expired_tombstones = 0
self.reset_all_well_known_acls = False
self.in_transaction = in_transaction
self.infrastructure_dn = ldb.Dn(samdb, "CN=Infrastructure," + samdb.domain_dn())
@@ -120,6 +123,7 @@ class dbcheck(object):
self.fix_missing_deleted_objects = False
self.fix_replica_locations = False
self.fix_missing_rid_set_master = False
+ self.fix_changes_after_deletion_bug = False
--
Samba Shared Repository
More information about the samba-cvs
mailing list