1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
Commit Graph

222 Commits

Author SHA1 Message Date
Stefan Metzmacher
b2a594926c ldb: version 1.1.21
* build fixes
* improved python bindings

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2015-07-21 19:04:15 +02:00
Jelmer Vernooij
90ec37cf90 Move waf into third_party/.
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-03-26 22:47:22 +01:00
Stefan Metzmacher
56503d32c3 ldb:wscript: remove allow_warnings=True for ldb_sample
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-03-20 20:43:12 +01:00
Stefan Metzmacher
b5ee6ae29d ldb:tests/sample_module: don't be lazy and use ldb_msg_copy_shallow/ldb_build_add_req
If we want to modify the the passed request on its way down the module chain,
we should use the proper way and use ldb_msg_copy_shallow() and ldb_build_add_req().

This way we don't alter the callers const structure.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-03-20 20:43:12 +01:00
Petr Viktorin
c05b0a35a2 pyldb: Add tests for type errors
Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Mar  4 01:49:02 CET 2015 on sn-devel-104
2015-03-04 01:49:02 +01:00
Petr Viktorin
379b919e4b pyldb: Report errors converting controls list to char**
With this change, passing an unexpected type to the CRUD methods
will result in an informative TypeError.

Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-03-03 23:20:06 +01:00
Petr Viktorin
229935e036 pyldb: Better error reporting
Provide more useful error messages for some type errors

Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-03-03 23:20:06 +01:00
Petr Viktorin
d460bab949 pyldb: Type-check arguments parsed with PyArg_ParseTuple*
PyObject* arguments need to be type-checked before they're
cast to subtypes.

Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-03-03 23:20:06 +01:00
Petr Viktorin
d599dcb6bc pyldb: Fix reference leaks
The parse_ldif and MessageElement.__iter__ functions leaked references
to intermediate lists whose iterators they return.

The MessageElement repr used the undocumented macro PyObject_REPR, which
leaks references. (It was used internally in CPython before fatal errors,
and will be removed in Python 3.5.)

Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-03-03 23:20:06 +01:00
Petr Viktorin
359e86af28 pyldb: Remove use of staticforward macro
Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-03-03 23:20:06 +01:00
Petr Viktorin
f87e6df34a pyldb: Properly preallocate result control list
The list was always allocated with size 1, so
if there is more than 1 result control, the additional
items would not be added in the list, and would
become leaked references.

Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-03-03 23:20:06 +01:00
Petr Viktorin
92ff259f40 pyldb: Use the Py_TYPE macro
The "ob_type" member of Python objects is going away
in Python 3 for compliance with C's strict aliasing rules.
The Py_TYPE macro should be used instead.

Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-03-03 23:20:06 +01:00
Petr Viktorin
39b08c7c1e pyldb: Correct reference counting when returning bools
Simply returning Py_True/PyFalse doesn't increment the bool object's
reference count.

Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-03-03 23:20:06 +01:00
Volker Lendecke
38628b1e32 Fix the O3 developer build
Different gcc versions complain at different places

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Mar  3 13:14:53 CET 2015 on sn-devel-104
2015-03-03 13:14:53 +01:00
Jelmer Vernooij
fcf4a89194 Force rebuild of ldb if pyldb-util is not available.
This is necessary since pyldb-util uses ldb_private.h, so we want to
build against the same source ldb.

Change-Id: I802974b9eef7deb102fea15b67ec5f87e8e353bd
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2015-02-17 15:41:11 +01:00
Jelmer Vernooij
92e21167c3 wscript: Expand tabs.
Change-Id: I2746f775accceeb2eeb02679f2c91b02085560b6
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>

Reviewed-by: Andreas Schneider <asn@samba.org>
2015-02-17 15:41:11 +01:00
Stefan Metzmacher
c7af8ae9d2 ldb: version 1.1.20
- Bug 9810 - validate_ldb of String(Generalized-Time) does not accept millisecond format ".000Z"

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
2015-01-24 17:49:05 +01:00
Stefan Metzmacher
d1b515535d lib/ldb: fix logic in ldb_val_to_time()
040408072012Z should represent 20040408072012.0Z
as well as 20040408072012.000Z or
20040408072012.RandomIgnoredCharaters...Z

Bug: https://bugzilla.samba.org/show_bug.cgi?id=9810

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
2015-01-24 17:49:05 +01:00
Petr Viktorin
02980268e8 Remove use of the "staticforward" macro
This macro was used for compatibility with broken compilers.
Since Python 2.3, it is always defined as `static`, and only exists
"for source compatibility with old C extensions".

Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2015-01-22 10:51:07 +01:00
Andrew Bartlett
02f6ab85a0 ldb: bump to version 1.1.19
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Pair-programmed-by: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
2014-12-22 00:18:09 +01:00
Samuel Cabrero
faa4be0535 ldb: Allow to register extended match rules
This allows to extend LDB by registering extended match rules from outside
the library itself. This is necessary when the implementation requires
knowledge about syntaxes implemented in samba extensions, like the
LDAP_MATCHING_RULE_TRANSITIVE_EVAL match.

Signed-off-by: Samuel Cabrero <samuelcabrero@kernevil.me>
Singed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2014-12-22 00:18:09 +01:00
Stefan Metzmacher
13a1406fa1 ldb: version 1.1.18
This release contains:

- fixes for segfaults in pyldb
- documentation fixes
- build system improvements

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Sat Nov 29 14:45:56 CET 2014 on sn-devel-104
2014-11-29 14:45:56 +01:00
Kamen Mazdrashki
30c0790774 lib-pyldb: Block elements should be surrounded by {} in py_msg.setitem()
Change-Id: I0d09374b27708fcaad3523d985a2db7983dbd81a
Signed-off-by: Kamen Mazdrashki <kamenim@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Nov 25 07:24:12 CET 2014 on sn-devel-104
2014-11-25 07:24:12 +01:00
Kamen Mazdrashki
322320889c lib-pyldb: Fix docstring for msg.add() method - it was "S.append()"
Change-Id: I9492d3c3993fc3d68d7bf24405db6e8cd746eaac
Signed-off-by: Kamen Mazdrashki <kamenim@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-11-25 05:04:08 +01:00
Kamen Mazdrashki
1d14af7729 lib-ldb-test: Test copying message element from a message to a new message
Change-Id: Iefcafb418a170ee410aec900bb36eb8e01e946b1
Signed-off-by: Kamen Mazdrashki <kamenim@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-11-25 05:04:08 +01:00
Kamen Mazdrashki
2d67335f68 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@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-11-25 05:04:08 +01:00
Kamen Mazdrashki
7f121d3860 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@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-11-25 05:04:07 +01:00
Kamen Mazdrashki
ea7778697e 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@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-11-25 05:04:07 +01:00
Kamen Mazdrashki
4d25dfd611 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@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-11-25 05:04:07 +01:00
Kamen Mazdrashki
18f879b857 lib-pyldb: Avoid leaking memory in error cases
Signed-off-by: Kamen Mazdrashki <kamenim@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-11-25 05:04:07 +01:00
Kamen Mazdrashki
a48b533ea5 lib-pyldb: Avoid SEGFAULT in case we can't convert passed value to py_String
Signed-off-by: Kamen Mazdrashki <kamenim@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-11-25 05:04:07 +01:00
Stefan Metzmacher
94fadfc89b lib/ldb: remove unused 'allow_warnings=True'
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-14 23:27:04 +01:00
Stefan Metzmacher
8ac49f9f05 lib/ldb: fix compiler warnings in ldb_tdb.c
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-14 23:27:04 +01:00
Stefan Metzmacher
edc6a89398 lib/ldb: fix compiler warnings in ldb_modules_list_from_string()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-14 23:27:04 +01:00
Matthieu Patou
bf0ee5f6ba ldb: fix a typo in the comment, LDB_FLAGS_MOD_xxx -> LDB_FLAG_MOD_xxx
Change-Id: I99ac6e272aa0f54a2720c58f630ae472068f255b
Signed-off-by: Matthieu Patou <mat@matws.net>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>

Autobuild-User(master): Matthieu Patou <mat@samba.org>
Autobuild-Date(master): Tue Sep 30 08:19:55 CEST 2014 on sn-devel-104
2014-09-30 08:19:55 +02:00
Stefan Metzmacher
bb9a939e78 lib/ldb/wscript: pass dep_vars=['LDB_VERSION'] to SAMBA_GENERATOR()
bld.add_manual_dependency() only works for files not for environment variables.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-05 19:47:06 +02:00
Marc Muehlfeld
4ee65a4666 Fix typo in ldbrename manpage
Signed-off-by: Marc Muehlfeld <mmuehlfeld@samba.org>
Reviewed-by: Jeremy Allson <jra@samba.org>
2014-08-28 01:57:13 +02:00
Amitay Isaacs
9f0b2f9503 ldb: Fix check for third_party
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-08-21 09:11:06 +02:00
Ira Cooper
38de110b02 third_party/popt: Initial support for popt.
ctdb, ldb, and samba are supported builds for third_party popt.

Signed-off-by: Ira Cooper <ira@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-08-09 18:26:17 +02:00
Michael Adam
09b991b79b ldb:build: improve detection of srcdir
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-06-20 23:38:10 +02:00
Andrew Bartlett
d7c22d56d3 ldb: make the successful ldb_transaction_start() message clearer
Change-Id: I00d0705484c3b53f55c4a8ec2953e92329b7408e
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Sat May  3 10:20:52 CEST 2014 on sn-devel-104
2014-05-03 10:20:52 +02:00
Stefan Metzmacher
7f03a94ffa ldb: change version to 1.1.17
This adds some pyldb methods for ldb.Dn.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-05-02 01:19:19 +02:00
Stefan Metzmacher
771d7b8c0d ldb:pyldb: add some more helper functions for LdbDn
This adds [g|s]et_component[|_name|_value]() and get_rdn_[name|value]().

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-05-02 01:19:19 +02:00
Stefan Metzmacher
094c39107c ldb:pyldb: fix doc string for set_extended_component()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-05-02 01:19:19 +02:00
Stefan Metzmacher
aae9da9803 ldb:pyldb: add some const to PyObject_FromLdbValue()
PyString_FromStringAndSize() makes a copy of the value...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-05-02 01:19:19 +02:00
Andreas Schneider
11e87cdbb6 ldb: Add a env variable to disable RTLD_DEEPBIND.
We need a way to disable this in order to allow the
ldb_*ldap modules to work with a preloaded socket wrapper.

The only known user is the bind_dlz module,
but symbol versioniong might be enough...

So in future we may remove this completely
or at least invert the default behavior.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-04-17 14:56:06 +02:00
Volker Lendecke
1dba07db0d dlinklist: Fix a typo
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Wed Apr  2 17:11:37 CEST 2014 on sn-devel-104
2014-04-02 17:11:37 +02:00
Stefan Metzmacher
9e0ae164a9 lib/ldb: explicitly use allow_warnings=True
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-04-02 09:03:46 +02:00
Andrew Bartlett
e76bbef8b7 ldb: pass module init errors back to the caller
This makes provision errors clearer in Samba, as we can now get
permission denied errors presented from LDB modules.

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
2014-02-05 08:42:25 +01:00
Andrew Bartlett
673d41503c ldb: Return LDB_ERR_INSUFFICIENT_ACCESS_RIGHTS rather than OPERATIONS_ERROR on EACCES and EPERM
This makes provision errors clearer in Samba.

Andrew Bartlett

Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
2014-02-05 08:42:25 +01:00