[SCM] Samba Shared Repository - branch v4-2-test updated
Karolin Seeger
kseeger at samba.org
Wed Dec 3 21:43:09 MST 2014
The branch, v4-2-test has been updated
via 22e6ce3 libcli: SMB2: Pure SMB2-only negprot fix to make us behave as a Windows client does.
via 1e7e417 ldb: version 1.1.18
via 726cb76 lib-pyldb: Block elements should be surrounded by {} in py_msg.setitem()
via efcd88e lib-pyldb: Fix docstring for msg.add() method - it was "S.append()"
via fd215d1 lib-ldb-test: Test copying message element from a message to a new message
via fd55b04 lib-pyldb: Avoid crash when copying MessageElements between Python Message objects
via e6b7e82 lib-ldb_ldif: Stop processing if ldb_message element name is NULL
via eb8c868 lib-ldb: Check for input parameter when searching attributes by name
via 06b0465 lib-pyldb: Throw exception when we can't create MessageElement object
via a7d2060 lib-pyldb: Avoid leaking memory in error cases
via c4d3398 lib-pyldb: Avoid SEGFAULT in case we can't convert passed value to py_String
via e418c82 lib/ldb: remove unused 'allow_warnings=True'
via 5509a43 lib/ldb: fix compiler warnings in ldb_tdb.c
via d4503fa lib/ldb: fix compiler warnings in ldb_modules_list_from_string()
via cbda5fd tdb: version 1.3.3
via cd154b8 tdb/test: TDB_CLEAR_IF_FIRST | TDB_MUTEX_LOCKING, O_RDONLY is a valid combination
via efe372a tdb: version 1.3.2
via 6902d47 tdb: Fix tdb_runtime_check_for_robust_mutexes()
via dc0c274 tdb: allow tdb_open_ex() with O_RDONLY of TDB_FEATURE_FLAG_MUTEX tdbs.
via e7f393c vfs_streams_xattr: check stream type
via b619f83 vfs_streams_xattr: initialize pointer
via 2acf54b vfs_streams_xattr: fix check with samba_private_attr_name()
via 3b722dd s4-rpc: dnsserver: Fix enumeration of IPv4 and IPv6 addresses
via bf66d71 samba-tool: Fix the IP output of "samba-tool dns serverinfo <some_server>"
via fb6d916 samba-tool: Fix enum values in dns.py
via 6af694e param: fix testparm to show hidden share defaults
from e914042 s3-smbstatus: Fix exit code of profile output.
https://git.samba.org/?p=samba.git;a=shortlog;h=v4-2-test
- Log -----------------------------------------------------------------
commit 22e6ce39e2f8c684b237db2efaa6af41bea45c82
Author: Jeremy Allison <jra at samba.org>
Date: Wed Nov 26 13:15:24 2014 -0800
libcli: SMB2: Pure SMB2-only negprot fix to make us behave as a Windows client does.
Required as some servers return zero when asked for
zero credits in an initial SMB2-only negprot.
Back-port of c426f97238e4f664d1b13781101ca9c942aa7d0d
from master.
https://bugzilla.samba.org/show_bug.cgi?id=10966
Signed-off-by: Jeremy Allison <jra at samba.org>
Autobuild-User(v4-2-test): Karolin Seeger <kseeger at samba.org>
Autobuild-Date(v4-2-test): Thu Dec 4 05:42:28 CET 2014 on sn-devel-104
commit 1e7e417fa265aadce4f972a2668952bb0a72ac11
Author: Stefan Metzmacher <metze at samba.org>
Date: Sat Nov 29 11:43:53 2014 +0100
ldb: version 1.1.18
This release contains:
- fixes for segfaults in pyldb
- documentation fixes
- build system improvements
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
Autobuild-User(master): Volker Lendecke <vl at samba.org>
Autobuild-Date(master): Sat Nov 29 14:45:56 CET 2014 on sn-devel-104
(cherry picked from commit 13a1406fa11f4c7eb1996a5ac1e33c966b886082)
The last 13 patches address
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10975
We need to backport ldb-1.1.18 to v4-2-test...
commit 726cb76f7ebfa7cdd38f64222090b31ba9a58625
Author: Kamen Mazdrashki <kamenim at samba.org>
Date: Thu Nov 20 04:07:47 2014 +0100
lib-pyldb: Block elements should be surrounded by {} in py_msg.setitem()
Change-Id: I0d09374b27708fcaad3523d985a2db7983dbd81a
Signed-off-by: Kamen Mazdrashki <kamenim at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
Autobuild-Date(master): Tue Nov 25 07:24:12 CET 2014 on sn-devel-104
(cherry picked from commit 30c07907749063d0b0c663f1b43b02b4c6b0049d)
commit efcd88e7d67d09299854191760667b3a2d550c77
Author: Kamen Mazdrashki <kamenim at samba.org>
Date: Thu Nov 20 04:06:01 2014 +0100
lib-pyldb: Fix docstring for msg.add() method - it was "S.append()"
Change-Id: I9492d3c3993fc3d68d7bf24405db6e8cd746eaac
Signed-off-by: Kamen Mazdrashki <kamenim at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
(cherry picked from commit 322320889c60f31cc536342bc9a54ae258f41139)
commit fd215d1e1659d29f2382f6e8d51232b0aae65836
Author: Kamen Mazdrashki <kamenim at samba.org>
Date: Tue Nov 25 03:50:52 2014 +0100
lib-ldb-test: Test copying message element from a message to a new message
Change-Id: Iefcafb418a170ee410aec900bb36eb8e01e946b1
Signed-off-by: Kamen Mazdrashki <kamenim at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
(cherry picked from commit 1d14af77299e88b5f0d3230ec0481ed5abaf4bdd)
commit fd55b0405d2ec87396980e5bd09159fe08b0e2ff
Author: Kamen Mazdrashki <kamenim at samba.org>
Date: Wed Nov 12 01:17:56 2014 +0100
lib-pyldb: Avoid crash when copying MessageElements between Python Message objects
This patch allows for following snipets in Python:
res = ldb.search(...)
m_from = res[0]
m_to = Message()
m_to.add(m_from["attrName"])
The problem previously is that we are trying to reference a
ldb_message_element that may not be a memory context on its own.
For instance, when search request from above example returns
Messages with more than one attribute, this leads immediately
to "Bad talloc magic value" crash, every message element beside
the first one is not a memory context
Signed-off-by: Kamen Mazdrashki <kamenim at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
(cherry picked from commit 2d67335f681a60a636e48107d908778806a0b15f)
commit e6b7e823cf16bf4c8dd7922f2b762196dd91be2d
Author: Kamen Mazdrashki <kamenim at samba.org>
Date: Wed Nov 12 01:12:31 2014 +0100
lib-ldb_ldif: Stop processing if ldb_message element name is NULL
I have hit this while using Python bindings for testing and
forgot to pass 'name' argument to MessageElement constructor
Passing NULL as 'name' is obviously a mistake and this commits
aims to warn about such unintetional mistakes.
Signed-off-by: Kamen Mazdrashki <kamenim at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
(cherry picked from commit 7f121d3860ee3289f5fd397ab3312634d11cb2f2)
commit eb8c86838c6389f1dbef43ebf1de03ee4711e336
Author: Kamen Mazdrashki <kamenim at samba.org>
Date: Tue Nov 11 02:56:32 2014 +0100
lib-ldb: Check for input parameter when searching attributes by name
This prevents a segfault that is hard to be tracked down from
Python bindings for instance.
Signed-off-by: Kamen Mazdrashki <kamenim at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
(cherry picked from commit ea7778697e22ffbe22634974144c6e5c142a85d6)
commit 06b046522a0ac4c4b94a3f4b861c16c660d7b5aa
Author: Kamen Mazdrashki <kamenim at samba.org>
Date: Mon Nov 10 22:59:07 2014 +0100
lib-pyldb: Throw exception when we can't create MessageElement object
At the moment we return an error, but no exception and it is
hard to instantly see what the problem is from Python
Signed-off-by: Kamen Mazdrashki <kamenim at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
(cherry picked from commit 4d25dfd611e7786a17975fcaed039be971bac7da)
commit a7d206042eb71830ce12bf26b997316a559ed96b
Author: Kamen Mazdrashki <kamenim at samba.org>
Date: Sun Nov 9 04:31:36 2014 +0100
lib-pyldb: Avoid leaking memory in error cases
Signed-off-by: Kamen Mazdrashki <kamenim at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
(cherry picked from commit 18f879b857c174371a9fe27722c70051ed68ed64)
commit c4d33988b63f598c4219cd18913f9fe1e78866d8
Author: Kamen Mazdrashki <kamenim at samba.org>
Date: Sun Nov 9 04:28:47 2014 +0100
lib-pyldb: Avoid SEGFAULT in case we can't convert passed value to py_String
Signed-off-by: Kamen Mazdrashki <kamenim at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
(cherry picked from commit a48b533ea5c9faae3429b0fb680b52b14676cd22)
commit e418c826160de7c765a64bdd42765d4ac05416b8
Author: Stefan Metzmacher <metze at samba.org>
Date: Wed Oct 29 11:56:25 2014 +0100
lib/ldb: remove unused 'allow_warnings=True'
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
(cherry picked from commit 94fadfc89bab0c28f5c126c653569c5f1b99a64e)
commit 5509a4352dc82b2dbdf8817d9969cb3368bd9fa4
Author: Stefan Metzmacher <metze at samba.org>
Date: Wed Oct 29 11:53:06 2014 +0100
lib/ldb: fix compiler warnings in ldb_tdb.c
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
(cherry picked from commit 8ac49f9f05415a49619e160c468a3fa261b0320b)
commit d4503fab645a2c9b64ba96edd00b965a7b6aa2d9
Author: Stefan Metzmacher <metze at samba.org>
Date: Wed Oct 29 11:52:37 2014 +0100
lib/ldb: fix compiler warnings in ldb_modules_list_from_string()
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
(cherry picked from commit edc6a89398f1fff9de55e77e84b441bfab955869)
commit cbda5fdc306fefeb7988e175bbbfb9f4c2305cd3
Author: Stefan Metzmacher <metze at samba.org>
Date: Tue Dec 2 08:42:18 2014 +0100
tdb: version 1.3.3
This fixes the tdb1-run-mutex-openflags2 test when robust mutexes are available.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10781
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
Autobuild-Date(master): Tue Dec 2 11:54:28 CET 2014 on sn-devel-104
(cherry picked from commit 1e32ada8ec1a2699caa1e813782cfc8a1c50f690)
commit cd154b88922bfc799fa0044a08d164bda98e87e3
Author: Stefan Metzmacher <metze at samba.org>
Date: Tue Dec 2 08:39:05 2014 +0100
tdb/test: TDB_CLEAR_IF_FIRST | TDB_MUTEX_LOCKING, O_RDONLY is a valid combination
This used to be invalid in the early developement code, but now we're
able to open a tdb with mutex area and TDB_NOLOCK without problems.
O_RDONLY implies TDB_NOLOCK...
This should have been part of commit c8d05e934ea03fffbc34944d2d51a016b89a7eca.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10781
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
(cherry picked from commit 6244346c11c40b3ed39ee626e1d27c75a29b7430)
commit efe372ae1f498615ead2fdb6efda7d6d1bdf2844
Author: Stefan Metzmacher <metze at samba.org>
Date: Sat Nov 29 11:37:54 2014 +0100
tdb: version 1.3.2
The following bugs are fixed with this release:
- Bug 10625 - tdb.h missing include of stdbool.h
- Bug 10781 - smbstatus: locking.tdb - TDB_MUTEX_LOCKING requires TDB_CLEAR_IF_FIRST
- Bug 10968 - tdb mutex runtime test clobbers stdout
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10625
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10781
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10968
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
(cherry picked from commit e6c766848c5f5f13584f3bc4c1670c76e7ff8472)
commit 6902d47fa3769f64002e776eea2a0c3620f65d13
Author: Volker Lendecke <vl at samba.org>
Date: Wed Nov 26 15:35:19 2014 +0000
tdb: Fix tdb_runtime_check_for_robust_mutexes()
When using exit() instead of _exit(), the child will flush buffered stdout
(and other stdio) content that it inherited from the parent process. In
make test, this led to duplicate output from net registry which then
confused the blackbox selftest.
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
(cherry picked from commit 42b2e5ca8c9b85e6fce71529bef5d6b3ba4f4a38)
commit dc0c274dbf99178073befe13a358e98da29b9afb
Author: Stefan Metzmacher <metze at samba.org>
Date: Tue Nov 4 09:51:51 2014 +0100
tdb: allow tdb_open_ex() with O_RDONLY of TDB_FEATURE_FLAG_MUTEX tdbs.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10781
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
(cherry picked from commit c8d05e934ea03fffbc34944d2d51a016b89a7eca)
commit e7f393c5787c6985932224cfbbd050e1393e0e9c
Author: Ralph Boehme <slow at samba.org>
Date: Fri Nov 21 14:56:08 2014 +0100
vfs_streams_xattr: check stream type
Only allow access to the stream type "$DATA". vfs_streams_depot does
this too and it fixes the failing test "smb2.streams.names".
Backport of 927290b384bc4f4fd53a1f93d4d27ccc71dd6135 from master.
https://bugzilla.samba.org/show_bug.cgi?id=10971
Signed-off-by: Ralph Boehme <slow at samba.org>
commit b619f83fc86bbae5773b3e631fd941d30370c90e
Author: Ralph Boehme <slow at samba.org>
Date: Fri Nov 21 14:54:17 2014 +0100
vfs_streams_xattr: initialize pointer
Intitialize pointer to NULL, otherwise we talloc_free() an unitialized
pointer in the error code path.
Backport of 1076e4e4e2a2b6238116bd860b03a9dcc8a151f8 from master.
https://bugzilla.samba.org/show_bug.cgi?id=10971
Signed-off-by: Ralph Boehme <slow at samba.org>
commit 2acf54be523e9d3bc01024ba626c727a254896c1
Author: Ralph Boehme <slow at samba.org>
Date: Thu Nov 20 16:33:22 2014 +0100
vfs_streams_xattr: fix check with samba_private_attr_name()
We want to check with samba_private_attr_name() whether the xattr name
is a private one, unfortunately it flags xattrs that begin with the
default streams prefix as private. By only calling
samba_private_attr_name() in case the xattr does NOT begin with the
default prefix, we know that if it returns 'true' it definitely one of
our internal xattr like "user.DOSATTRIB".
This fixes a bug introduced in 634bcb09a08b927fd79ae0e16aeee2a123605f94
that denied all access to valid stream xattrs.
Backport of 1160fcfe3d97644a6bcfa9ee687fd7dfca58e812 from master.
https://bugzilla.samba.org/show_bug.cgi?id=10971
Signed-off-by: Ralph Boehme <slow at samba.org>
commit 3b722dd84bfb7ea6a9f235bd3146c024dfca37eb
Author: Guenter Kukkukk <linux at kukkukk.com>
Date: Fri Nov 21 16:57:45 2014 +0100
s4-rpc: dnsserver: Fix enumeration of IPv4 and IPv6 addresses
In the initial implementation only IPv4 addresses were supported.
Add IPv6 (and mixed IPv4/IPv6) support and all further needed conversion
routines to support w2k, dotnet, longhorn clients.
Signed-off-by: Guenter Kukkukk <linux at kukkukk.com>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay at samba.org>
Autobuild-Date(master): Wed Nov 26 03:44:07 CET 2014 on sn-devel-104
(cherry picked from commit 3ac4355f3e7f79bc0045c43bc818697dc6b08850)
The last 3 patches address
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10952
samba-tool dns serverinfo <server> is broken for IPv6 - also in mixed IPv4/IPv6
environments.
commit bf66d719e81d0b376f9641272db5b0369e091a1d
Author: Guenter Kukkukk <linux at kukkukk.com>
Date: Fri Nov 21 03:55:25 2014 +0100
samba-tool: Fix the IP output of "samba-tool dns serverinfo <some_server>"
Avoid hardcoded IP-strings, use standard python IP functions to format
IPv4 and IPv6 addresses correctly.
I have removed the display of the port number.
MS-DNSP 2.2.3.2.2.1 DNS_ADDR: (from May 15, 2014)
Port Number (2bytes): Senders MUST set this to zero, and receivers MUST ignore
it.
Signed-off-by: Guenter Kukkukk <linux at kukkukk.com>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit d5af53c5372866a33a0195cabbd64232ac53bad4)
commit fb6d916a46ecd1b5c44ab173e675ea5696aace83
Author: Guenter Kukkukk <linux at kukkukk.com>
Date: Fri Nov 21 03:40:17 2014 +0100
samba-tool: Fix enum values in dns.py
DNS_ZONE_UPDATE_SECURE was used twice, DNS_ZONE_UPDATE_UNSECURE was missing.
Signed-off-by: Guenter Kukkukk <linux at kukkukk.com>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit 4bda589c8e68cd66ca3b0ea9496cb1b11febcae6)
commit 6af694e371a09fae5d2b7b7f0fe6c89584d319de
Author: Garming Sam <garming at catalyst.net.nz>
Date: Fri Nov 28 10:03:29 2014 +1300
param: fix testparm to show hidden share defaults
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10864
Change-Id: I16710f70a3cbaeadf7adf139441dd2b017ef81ee
Signed-off-by: Garming Sam <garming at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
Autobuild-User(master): Garming Sam <garming at samba.org>
Autobuild-Date(master): Fri Nov 28 07:54:54 CET 2014 on sn-devel-104
(cherry picked from commit 907094c7fa73aaf2e9dda184ea4f0c1a606300bc)
-----------------------------------------------------------------------
Summary of changes:
lib/ldb/ABI/{ldb-1.1.14.sigs => ldb-1.1.18.sigs} | 0
...ldb-util-1.1.10.sigs => pyldb-util-1.1.18.sigs} | 0
lib/ldb/common/ldb_attributes.c | 15 ++-
lib/ldb/common/ldb_ldif.c | 7 ++
lib/ldb/common/ldb_modules.c | 4 +-
lib/ldb/ldb_tdb/ldb_tdb.c | 14 ++-
lib/ldb/pyldb.c | 46 +++++++--
lib/ldb/tests/python/api.py | 14 +++
lib/ldb/wscript | 4 +-
lib/param/loadparm.c | 7 +-
lib/tdb/ABI/{tdb-1.3.0.sigs => tdb-1.3.2.sigs} | 0
lib/tdb/ABI/{tdb-1.3.0.sigs => tdb-1.3.3.sigs} | 0
lib/tdb/common/mutex.c | 8 +-
lib/tdb/common/open.c | 18 ++--
lib/tdb/test/run-mutex-openflags2.c | 5 +-
lib/tdb/wscript | 2 +-
libcli/smb/smbXcli_base.c | 11 +++
python/samba/netcmd/dns.py | 15 +--
source3/include/local.h | 2 +
source3/modules/vfs_streams_xattr.c | 29 +++++-
source4/rpc_server/dnsserver/dcerpc_dnsserver.c | 20 ++--
source4/rpc_server/dnsserver/dnsdata.c | 56 +++++++++++
source4/rpc_server/dnsserver/dnsserver.h | 7 +-
source4/rpc_server/dnsserver/dnsutils.c | 106 +++++++++++++++------
24 files changed, 305 insertions(+), 85 deletions(-)
copy lib/ldb/ABI/{ldb-1.1.14.sigs => ldb-1.1.18.sigs} (100%)
copy lib/ldb/ABI/{pyldb-util-1.1.10.sigs => pyldb-util-1.1.18.sigs} (100%)
copy lib/tdb/ABI/{tdb-1.3.0.sigs => tdb-1.3.2.sigs} (100%)
copy lib/tdb/ABI/{tdb-1.3.0.sigs => tdb-1.3.3.sigs} (100%)
Changeset truncated at 500 lines:
diff --git a/lib/ldb/ABI/ldb-1.1.14.sigs b/lib/ldb/ABI/ldb-1.1.18.sigs
similarity index 100%
copy from lib/ldb/ABI/ldb-1.1.14.sigs
copy to lib/ldb/ABI/ldb-1.1.18.sigs
diff --git a/lib/ldb/ABI/pyldb-util-1.1.10.sigs b/lib/ldb/ABI/pyldb-util-1.1.18.sigs
similarity index 100%
copy from lib/ldb/ABI/pyldb-util-1.1.10.sigs
copy to lib/ldb/ABI/pyldb-util-1.1.18.sigs
diff --git a/lib/ldb/common/ldb_attributes.c b/lib/ldb/common/ldb_attributes.c
index 21a3e6e..767f69c 100644
--- a/lib/ldb/common/ldb_attributes.c
+++ b/lib/ldb/common/ldb_attributes.c
@@ -116,8 +116,14 @@ static const struct ldb_schema_attribute ldb_attribute_default = {
};
/*
- return the attribute handlers for a given attribute
-*/
+ * Return the attribute handlers for a given attribute
+ *
+ * @param ldb ldb context
+ * @param name attribute name to search for
+ * @return Always return valid pointer to schema attribute.
+ * In case there is no attribute with name,
+ * ldb_attribute_default is returned
+ */
static const struct ldb_schema_attribute *ldb_schema_attribute_by_name_internal(
struct ldb_context *ldb,
const char *name)
@@ -127,6 +133,11 @@ static const struct ldb_schema_attribute *ldb_schema_attribute_by_name_internal(
int r;
const struct ldb_schema_attribute *def = &ldb_attribute_default;
+ /* fallback to default attribute implementation */
+ if (name == NULL) {
+ return def;
+ }
+
/* as handlers are sorted, '*' must be the first if present */
if (strcmp(ldb->schema.attributes[0].name, "*") == 0) {
def = &ldb->schema.attributes[0];
diff --git a/lib/ldb/common/ldb_ldif.c b/lib/ldb/common/ldb_ldif.c
index a2e4488..f9743dc 100644
--- a/lib/ldb/common/ldb_ldif.c
+++ b/lib/ldb/common/ldb_ldif.c
@@ -312,6 +312,13 @@ static int ldb_ldif_write_trace(struct ldb_context *ldb,
for (i=0;i<msg->num_elements;i++) {
const struct ldb_schema_attribute *a;
+ if (msg->elements[i].name == NULL) {
+ ldb_debug(ldb, LDB_DEBUG_ERROR,
+ "Error: Invalid element name (NULL) at position %d", i);
+ talloc_free(mem_ctx);
+ return -1;
+ }
+
a = ldb_schema_attribute_by_name(ldb, msg->elements[i].name);
if (ldif->changetype == LDB_CHANGETYPE_MODIFY) {
diff --git a/lib/ldb/common/ldb_modules.c b/lib/ldb/common/ldb_modules.c
index 05a8d8a..91412a6 100644
--- a/lib/ldb/common/ldb_modules.c
+++ b/lib/ldb/common/ldb_modules.c
@@ -87,7 +87,7 @@ const char **ldb_modules_list_from_string(struct ldb_context *ldb, TALLOC_CTX *m
if (modstr[0] == '\0') {
modules[0] = NULL;
- m = (const char **)modules;
+ m = discard_const_p(const char *, modules);
return m;
}
@@ -110,7 +110,7 @@ const char **ldb_modules_list_from_string(struct ldb_context *ldb, TALLOC_CTX *m
modules[i + 1] = NULL;
- m = (const char **)modules;
+ m = discard_const_p(const char *, modules);
return m;
}
diff --git a/lib/ldb/ldb_tdb/ldb_tdb.c b/lib/ldb/ldb_tdb/ldb_tdb.c
index d3c83f5..bcb8f0f 100644
--- a/lib/ldb/ldb_tdb/ldb_tdb.c
+++ b/lib/ldb/ldb_tdb/ldb_tdb.c
@@ -264,6 +264,7 @@ int ltdb_store(struct ldb_module *module, const struct ldb_message *msg, int flg
void *data = ldb_module_get_private(module);
struct ltdb_private *ltdb = talloc_get_type(data, struct ltdb_private);
TDB_DATA tdb_key, tdb_data;
+ struct ldb_val ldb_data;
int ret = LDB_SUCCESS;
tdb_key = ltdb_key(module, msg->dn);
@@ -272,12 +273,15 @@ int ltdb_store(struct ldb_module *module, const struct ldb_message *msg, int flg
}
ret = ldb_pack_data(ldb_module_get_ctx(module),
- msg, (struct ldb_val *)&tdb_data);
+ msg, &ldb_data);
if (ret == -1) {
talloc_free(tdb_key.dptr);
return LDB_ERR_OTHER;
}
+ tdb_data.dptr = ldb_data.data;
+ tdb_data.dsize = ldb_data.length;
+
ret = tdb_store(ltdb->tdb, tdb_key, tdb_data, flgs);
if (ret != 0) {
ret = ltdb_err_map(tdb_error(ltdb->tdb));
@@ -286,7 +290,7 @@ int ltdb_store(struct ldb_module *module, const struct ldb_message *msg, int flg
done:
talloc_free(tdb_key.dptr);
- talloc_free(tdb_data.dptr);
+ talloc_free(ldb_data.data);
return ret;
}
@@ -673,6 +677,7 @@ int ltdb_modify_internal(struct ldb_module *module,
void *data = ldb_module_get_private(module);
struct ltdb_private *ltdb = talloc_get_type(data, struct ltdb_private);
TDB_DATA tdb_key, tdb_data;
+ struct ldb_val ldb_data;
struct ldb_message *msg2;
unsigned int i, j, k;
int ret = LDB_SUCCESS, idx;
@@ -701,7 +706,10 @@ int ltdb_modify_internal(struct ldb_module *module,
goto done;
}
- ret = ldb_unpack_data(ldb_module_get_ctx(module), (struct ldb_val *)&tdb_data, msg2);
+ ldb_data.data = tdb_data.dptr;
+ ldb_data.length = tdb_data.dsize;
+
+ ret = ldb_unpack_data(ldb_module_get_ctx(module), &ldb_data, msg2);
free(tdb_data.dptr);
if (ret == -1) {
ret = LDB_ERR_OTHER;
diff --git a/lib/ldb/pyldb.c b/lib/ldb/pyldb.c
index 78b8012..ee751b3 100644
--- a/lib/ldb/pyldb.c
+++ b/lib/ldb/pyldb.c
@@ -1624,17 +1624,26 @@ static PyObject *py_ldb_schema_format_value(PyLdbObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "sO", &element_name, &val))
return NULL;
- mem_ctx = talloc_new(NULL);
-
old_val.data = (uint8_t *)PyString_AsString(val);
old_val.length = PyString_Size(val);
+ if (old_val.data == NULL) {
+ PyErr_SetString(PyExc_RuntimeError, "Failed to convert passed value to String");
+ return NULL;
+ }
+
a = ldb_schema_attribute_by_name(pyldb_Ldb_AsLdbContext(self), element_name);
if (a == NULL) {
Py_RETURN_NONE;
}
+ mem_ctx = talloc_new(NULL);
+ if (mem_ctx == NULL) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+
if (a->syntax->ldif_write_fn(pyldb_Ldb_AsLdbContext(self), mem_ctx, &old_val, &new_val) != 0) {
talloc_free(mem_ctx);
Py_RETURN_NONE;
@@ -2343,6 +2352,8 @@ static struct ldb_message_element *PyObject_AsMessageElement(
(uint8_t *)PyString_AsString(obj), me->values[i].length+1);
}
} else {
+ PyErr_Format(PyExc_TypeError,
+ "String or List type expected for '%s' attribute", attr_name);
talloc_free(me);
me = NULL;
}
@@ -2764,21 +2775,39 @@ static PyObject *py_ldb_msg_add(PyLdbMessageObject *self, PyObject *args)
{
struct ldb_message *msg = pyldb_Message_AsMessage(self);
PyLdbMessageElementObject *py_element;
- int ret;
+ int i, ret;
struct ldb_message_element *el;
+ struct ldb_message_element *el_new;
if (!PyArg_ParseTuple(args, "O!", &PyLdbMessageElement, &py_element))
return NULL;
- el = talloc_reference(msg, py_element->el);
+ el = py_element->el;
if (el == NULL) {
- PyErr_NoMemory();
+ PyErr_SetString(PyExc_ValueError, "Invalid MessageElement object");
return NULL;
}
- ret = ldb_msg_add(msg, el, el->flags);
+ ret = ldb_msg_add_empty(msg, el->name, el->flags, &el_new);
PyErr_LDB_ERROR_IS_ERR_RAISE(PyExc_LdbError, ret, NULL);
+ /* now deep copy all attribute values */
+ el_new->values = talloc_array(msg->elements, struct ldb_val, el->num_values);
+ if (el_new->values == NULL) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+ el_new->num_values = el->num_values;
+
+ for (i = 0; i < el->num_values; i++) {
+ el_new->values[i] = ldb_val_dup(el_new->values, &el->values[i]);
+ if (el_new->values[i].data == NULL
+ && el->values[i].length != 0) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+ }
+
Py_RETURN_NONE;
}
@@ -2802,7 +2831,7 @@ static PyMethodDef py_ldb_msg_methods[] = {
{ "items", (PyCFunction)py_ldb_msg_items, METH_NOARGS, NULL },
{ "elements", (PyCFunction)py_ldb_msg_elements, METH_NOARGS, NULL },
{ "add", (PyCFunction)py_ldb_msg_add, METH_VARARGS,
- "S.append(element)\n\n"
+ "S.add(element)\n\n"
"Add an element to this message." },
{ NULL },
};
@@ -2834,8 +2863,9 @@ static int py_ldb_msg_setitem(PyLdbMessageObject *self, PyObject *name, PyObject
int ret;
struct ldb_message_element *el = PyObject_AsMessageElement(self->msg,
value, 0, attr_name);
- if (el == NULL)
+ if (el == NULL) {
return -1;
+ }
ldb_msg_remove_attr(pyldb_Message_AsMessage(self), attr_name);
ret = ldb_msg_add(pyldb_Message_AsMessage(self), el, el->flags);
if (ret != LDB_SUCCESS) {
diff --git a/lib/ldb/tests/python/api.py b/lib/ldb/tests/python/api.py
index 7df40e4..7f5c504 100755
--- a/lib/ldb/tests/python/api.py
+++ b/lib/ldb/tests/python/api.py
@@ -592,6 +592,20 @@ class LdbMsgTests(TestCase):
err_rec = {"a1": ["a1-val1", "a1-val1"]}
self.assertRaises(TypeError, ldb.Message.from_dict, l, err_rec, ldb.FLAG_MOD_REPLACE)
+ def test_copy_add_message_element(self):
+ m = ldb.Message()
+ m["1"] = ldb.MessageElement(["val 111"], ldb.FLAG_MOD_ADD, "1")
+ m["2"] = ldb.MessageElement(["val 222"], ldb.FLAG_MOD_ADD, "2")
+ mto = ldb.Message()
+ mto["1"] = m["1"]
+ mto["2"] = m["2"]
+ self.assertEqual(mto["1"], m["1"])
+ self.assertEqual(mto["2"], m["2"])
+ mto = ldb.Message()
+ mto.add(m["1"])
+ mto.add(m["2"])
+ self.assertEqual(mto["1"], m["1"])
+ self.assertEqual(mto["2"], m["2"])
class MessageElementTests(TestCase):
diff --git a/lib/ldb/wscript b/lib/ldb/wscript
index 027c8cb..0fba225 100755
--- a/lib/ldb/wscript
+++ b/lib/ldb/wscript
@@ -1,7 +1,7 @@
#!/usr/bin/env python
APPNAME = 'ldb'
-VERSION = '1.1.17'
+VERSION = '1.1.18'
blddir = 'bin'
@@ -153,7 +153,6 @@ def build(bld):
pc_files='ldb.pc',
vnum=VERSION,
private_library=private_library,
- allow_warnings=True,
manpages='man/ldb.3',
abi_directory='ABI',
abi_match = abi_match)
@@ -255,7 +254,6 @@ def build(bld):
'common/ldb.c',
deps='tevent tdb',
includes='include',
- allow_warnings=True,
cflags=['-DLDB_MODULESDIR=\"%s\"' % modules_dir])
LDB_TOOLS='ldbadd ldbsearch ldbdel ldbmodify ldbedit ldbrename'
diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c
index 9953053..56c6796 100644
--- a/lib/param/loadparm.c
+++ b/lib/param/loadparm.c
@@ -2077,10 +2077,11 @@ void lpcfg_dump_a_service(struct loadparm_service * pService, struct loadparm_se
(i == 0 || (parm_table[i].offset != parm_table[i - 1].offset)))
{
if (pService == sDefault) {
- if (flags && (flags[i] & FLAG_DEFAULT)) {
- continue;
- }
if (!show_defaults) {
+ if (flags && (flags[i] & FLAG_DEFAULT)) {
+ continue;
+ }
+
if (is_default(sDefault, i)) {
continue;
}
diff --git a/lib/tdb/ABI/tdb-1.3.0.sigs b/lib/tdb/ABI/tdb-1.3.2.sigs
similarity index 100%
copy from lib/tdb/ABI/tdb-1.3.0.sigs
copy to lib/tdb/ABI/tdb-1.3.2.sigs
diff --git a/lib/tdb/ABI/tdb-1.3.0.sigs b/lib/tdb/ABI/tdb-1.3.3.sigs
similarity index 100%
copy from lib/tdb/ABI/tdb-1.3.0.sigs
copy to lib/tdb/ABI/tdb-1.3.3.sigs
diff --git a/lib/tdb/common/mutex.c b/lib/tdb/common/mutex.c
index bdc4c28..12f89d3 100644
--- a/lib/tdb/common/mutex.c
+++ b/lib/tdb/common/mutex.c
@@ -814,17 +814,17 @@ _PUBLIC_ bool tdb_runtime_check_for_robust_mutexes(void)
ret = pthread_mutex_lock(m);
nwritten = write(pipe_up[1], &ret, sizeof(ret));
if (nwritten != sizeof(ret)) {
- exit(1);
+ _exit(1);
}
if (ret != 0) {
- exit(1);
+ _exit(1);
}
nread = read(pipe_down[0], &c, 1);
if (nread != 1) {
- exit(1);
+ _exit(1);
}
/* leave locked */
- exit(0);
+ _exit(0);
}
if (tdb_robust_mutex_pid == -1) {
goto cleanup_sig_child;
diff --git a/lib/tdb/common/open.c b/lib/tdb/common/open.c
index 16a76a3..3b53fa7 100644
--- a/lib/tdb/common/open.c
+++ b/lib/tdb/common/open.c
@@ -232,6 +232,14 @@ static bool tdb_mutex_open_ok(struct tdb_context *tdb,
{
int locked;
+ if (tdb->flags & TDB_NOLOCK) {
+ /*
+ * We don't look at locks, so it does not matter to have a
+ * compatible mutex implementation. Allow the open.
+ */
+ return true;
+ }
+
locked = tdb_nest_lock(tdb, ACTIVE_LOCK, F_WRLCK,
TDB_LOCK_NOWAIT|TDB_LOCK_PROBE);
@@ -261,14 +269,6 @@ static bool tdb_mutex_open_ok(struct tdb_context *tdb,
return false;
}
- if (tdb->flags & TDB_NOLOCK) {
- /*
- * We don't look at locks, so it does not matter to have a
- * compatible mutex implementation. Allow the open.
- */
- return true;
- }
-
check_local_settings:
if (!(tdb->flags & TDB_MUTEX_LOCKING)) {
@@ -399,7 +399,7 @@ _PUBLIC_ struct tdb_context *tdb_open_ex(const char *name, int hash_size, int td
tdb->read_only = 1;
/* read only databases don't do locking or clear if first */
tdb->flags |= TDB_NOLOCK;
- tdb->flags &= ~TDB_CLEAR_IF_FIRST;
+ tdb->flags &= ~(TDB_CLEAR_IF_FIRST|TDB_MUTEX_LOCKING);
}
if ((tdb->flags & TDB_ALLOW_NESTING) &&
diff --git a/lib/tdb/test/run-mutex-openflags2.c b/lib/tdb/test/run-mutex-openflags2.c
index 57ac7e3..6522ae4 100644
--- a/lib/tdb/test/run-mutex-openflags2.c
+++ b/lib/tdb/test/run-mutex-openflags2.c
@@ -75,8 +75,9 @@ static int do_child(int fd)
TDB_CLEAR_IF_FIRST |
TDB_MUTEX_LOCKING,
O_RDONLY, 0755, &nolog_ctx, NULL);
- ok((tdb == NULL) && (errno == EINVAL), "TDB_MUTEX_LOCKING with "
- "O_RDONLY should fail with EINVAL - %d", errno);
+ ok((tdb != NULL), "TDB_MUTEX_LOCKING with "
+ "O_RDONLY should work - %d", errno);
+ tdb_close(tdb);
tdb = tdb_open_ex("mutex-openflags2.tdb", 0,
TDB_CLEAR_IF_FIRST |
diff --git a/lib/tdb/wscript b/lib/tdb/wscript
index dbbcaf3..d129b24 100644
--- a/lib/tdb/wscript
+++ b/lib/tdb/wscript
@@ -1,7 +1,7 @@
#!/usr/bin/env python
APPNAME = 'tdb'
-VERSION = '1.3.1'
+VERSION = '1.3.3'
blddir = 'bin'
diff --git a/libcli/smb/smbXcli_base.c b/libcli/smb/smbXcli_base.c
index 8a8bbd0..e0c5ff9 100644
--- a/libcli/smb/smbXcli_base.c
+++ b/libcli/smb/smbXcli_base.c
@@ -31,6 +31,7 @@
#include "../libcli/smb/read_smb.h"
#include "smbXcli_base.h"
#include "librpc/ndr/libndr.h"
+#include "local.h"
struct smbXcli_conn;
struct smbXcli_req;
@@ -3830,6 +3831,16 @@ struct tevent_req *smbXcli_negprot_send(TALLOC_CTX *mem_ctx,
*/
conn->dispatch_incoming = smb2cli_conn_dispatch_incoming;
+ /*
+ * As we're starting with an SMB2 negprot, emulate Windows
+ * and ask for 31 credits in the initial SMB2 negprot.
+ * If we don't and leave requested credits at
+ * zero, MacOSX servers return zero credits on
+ * the negprot reply and we fail to connect.
+ */
+ smb2cli_conn_set_max_credits(conn,
+ WINDOWS_CLIENT_PURE_SMB2_NEGPROT_INITIAL_CREDIT_ASK);
+
subreq = smbXcli_negprot_smb2_subreq(state);
if (tevent_req_nomem(subreq, req)) {
return tevent_req_post(req, ev);
diff --git a/python/samba/netcmd/dns.py b/python/samba/netcmd/dns.py
index de0c94d..2cf9a1f 100644
--- a/python/samba/netcmd/dns.py
+++ b/python/samba/netcmd/dns.py
@@ -19,6 +19,9 @@
import samba.getopt as options
from struct import pack
from socket import inet_ntoa
+from socket import inet_ntop
+from socket import AF_INET
+from socket import AF_INET6
import shlex
from samba.netcmd import (
@@ -89,7 +92,7 @@ def zone_type_string(zone_type):
def zone_update_string(zone_update):
- enum_defs = [ 'DNS_ZONE_UPDATE_OFF', 'DNS_ZONE_UPDATE_SECURE',
+ enum_defs = [ 'DNS_ZONE_UPDATE_OFF', 'DNS_ZONE_UPDATE_UNSECURE',
'DNS_ZONE_UPDATE_SECURE' ]
return enum_string(dnsp, enum_defs, zone_update)
@@ -126,7 +129,7 @@ def ip4_array_string(array):
if not array:
return ret
for i in xrange(array.AddrCount):
- addr = '%s' % inet_ntoa(pack('i', array.AddrArray[i]))
+ addr = inet_ntop(AF_INET, pack('I', array.AddrArray[i]))
ret.append(addr)
return ret
@@ -137,11 +140,11 @@ def dns_addr_array_string(array):
return ret
for i in xrange(array.AddrCount):
if array.AddrArray[i].MaxSa[0] == 0x02:
- addr = '%d.%d.%d.%d (%d)' % \
- tuple(array.AddrArray[i].MaxSa[4:8] + [array.AddrArray[i].MaxSa[3]])
+ x = "".join([chr(b) for b in array.AddrArray[i].MaxSa])[4:8]
+ addr = inet_ntop(AF_INET, x)
elif array.AddrArray[i].MaxSa[0] == 0x17:
- addr = '%x%x:%x%x:%x%x:%x%x:%x%x:%x%x:%x%x:%x%x (%d)' % \
- tuple(array.AddrArray[i].MaxSa[4:20] + [array.AddrArray[i].MaxSa[3]])
+ x = "".join([chr(b) for b in array.AddrArray[i].MaxSa])[8:24]
+ addr = inet_ntop(AF_INET6, x)
else:
addr = 'UNKNOWN'
--
Samba Shared Repository
More information about the samba-cvs
mailing list