1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00
Commit Graph

142 Commits

Author SHA1 Message Date
Simo Sorce
b7774527fa r19531: Make struct ldb_dn opaque and local to ldb_dn.c
(This used to be commit 889fb983ba)
2007-10-10 14:24:44 -05:00
Andrew Bartlett
74adb98b65 r19521: Fix memory leak.
Andrew Bartlett
(This used to be commit cf1b0cc19f)
2007-10-10 14:24:44 -05:00
Jelmer Vernooij
4fa24df98d r19507: Merge my DSO fixes branch. Building Samba's libraries as shared libraries
works again now, by specifying --enable-dso to configure.
(This used to be commit 7a01235067)
2007-10-10 14:24:41 -05:00
Simo Sorce
7f833458ca r19489: Change ldb_msg_add_value and ldb_msg_add_empty to take a foruth argument.
This is a pointer to an element pointer. If it is not null it will be
filled with the pointer of the manipulated element.
Will avoid double searches on the elements list in some cases.
(This used to be commit 0fa5d4bc22)
2007-10-10 14:24:38 -05:00
Simo Sorce
5203031007 r19452: Warn but don't die if registering against the rootdse is not possible
(This used to be commit 4ad2eba2aa)
2007-10-10 14:21:33 -05:00
Simo Sorce
8c015370d2 r19370: Handle errors if talloc_reference fails
(This used to be commit 05134a90e3)
2007-10-10 14:21:18 -05:00
Simo Sorce
549dd10f0f r19332: ldb_parse_tree leaks
(This used to be commit 3e0e2787c1)
2007-10-10 14:21:11 -05:00
Simo Sorce
508a04fe57 r19312: This should fix a nasty bug with values and names being freed before the results where used.
Seem that el is hanging out of a request, and the target is put on the final results.

Still one to catch and fix, but this seem to cure most of them
(This used to be commit bfeaa08fde)
2007-10-10 14:21:07 -05:00
Simo Sorce
59b66744f7 r19299: Fix possible memleaks
(This used to be commit 6fad80bb09)
2007-10-10 14:21:04 -05:00
Simo Sorce
f7005d48d2 r19129: Add comment to clarify behavior
(This used to be commit 7180f38e9e)
2007-10-10 14:20:37 -05:00
Andrew Bartlett
77db3973c4 r18781: Move the usnCreated and usnChanged handling around again.
This moves these attributes from objectguid into an optional backend
(objectguid), used by ltdb.  For OpenLDAP, the entryUUID module
converts entryCSN into usnChanged.

This also changes the sequence number API, and uses 'time based'
sequence numbers, when an LDAP or similar backend is detected.

To assist this, we also store the last modified time in the TDB,
whenever we change a value.

Andrew Bartlett
(This used to be commit 72858f8594)
2007-10-10 14:19:11 -05:00
Andrew Bartlett
df98ee6558 r18770: Avoid crashes and fix up other issues in the client-side paged_searches module.
In particular, we must query the remote server to find out if paged
searches are supported, not the local ldb.

This patch also removes the ue of bool, and returns it to LDB error codes.

Andrew Bartlett
(This used to be commit d36d05858b)
2007-10-10 14:19:10 -05:00
Simo Sorce
9dd6cac44a r18591: Better defaults for share creation
Fix logic error in paged_results
(This used to be commit 34ce1f8e1b)
2007-10-10 14:18:53 -05:00
Andrew Bartlett
595c141a69 r18504: Handle mappings for RENAME and KEEP attributes better. We don't need
to mess with the values in these cases.

Where we do convert the values, try and convert substrings.  This
isn't going to be perfect, but we should try rather than segfault.

This also avoids using the wrong arm of the union for the attribute
name

The change in the entryUUID module is to correct the case of
sAMAccountName, due to the case sensitive ldap.js test.

Andrew Bartlett
(This used to be commit 81d9a692c1)
2007-10-10 14:18:40 -05:00
Andrew Bartlett
1e4f5a096c r18495: More work on the LDAP backend (which now passes a lot of our tests!)
This adds a list of attributes that are in our wildcard seaches, but
the remote server requires to be explicitly listed.  This also cleans
up the handling of wildcards in ldb_map to be more consistant.

Also fix the partitions module to rebase the search, if on the GC
port, we do a subtree search.  (Otherwise backends can rightly
complain that the search is not in their scope).

Andrew Bartlett
(This used to be commit bc58792b71)
2007-10-10 14:18:38 -05:00
Andrew Tridgell
05cdd9ccaf r18439: 2nd try at a talloc_move() api. This type with the ** ptr interface
exposed.

Unfortunately this generates a large number of type punning
warnings. We'll have to find some magic to hide those.
(This used to be commit 254cbf09de)
2007-10-10 14:18:29 -05:00
Andrew Tridgell
24fe49a3d1 r18438: I should have examined these uses of talloc_move() more
carefully. Most of them are OK, but a couple were not.
(This used to be commit b0de283882)
2007-10-10 14:18:29 -05:00
Andrew Tridgell
7f63cebd33 r18436: converted ldb to use talloc_move() instead of talloc_steal() when
appropriate.

Note that I also removed the error checks that were being done on the
result of talloc_steal(). They are pointless as talloc_steal() doesn't
have any failure modes that wouldn't cause a segv anyway, and they
tend to clutter the code
(This used to be commit c0d9e7d473)
2007-10-10 14:18:29 -05:00
Andrew Tridgell
9adf2883ef r18321: fixed some warnings on AIX
(This used to be commit 449fab2c26)
2007-10-10 14:18:08 -05:00
Simo Sorce
fb15300c60 r18317: Make sure we actually have a valid reply or fail
(This used to be commit 41cb3a9258)
2007-10-10 14:18:07 -05:00
Andrew Tridgell
30ee8beb93 r18301: I discovered how to load the warnings from a build farm build into
emacs compile mode (hint, paste to a file, and compile as "cat
filename").

This allowed me to fix nearly all the warnings for a IA_64 SuSE build
very quickly.
(This used to be commit eba6c84eff)
2007-10-10 14:18:04 -05:00
Stefan Metzmacher
47479df22e r17775: use an enum to get rid of compiler warnings
metze
(This used to be commit c66cf31afd)
2007-10-10 14:16:40 -05:00
Andrew Bartlett
3d33bc10ed r17700: Despite our best hopes, the way module initialisation tends to happen,
we make searches before things are initialised.  Cope with this.

Andrew Bartlett
(This used to be commit daa1a61891)
2007-10-10 14:16:27 -05:00
Andrew Bartlett
cda3a37d76 r17698: The original code assumed that &data->context was a valid talloc
pointer.

This only works when this is the only structure member, but when I
added a new context pointer, it failed.

Andrew Bartlett
(This used to be commit 5bcfa12cef)
2007-10-10 14:16:27 -05:00
Andrew Bartlett
3e83b0fac4 r17691: Make the structure more public, so we have somewhere for calling
modules to put private data.

Andrew Bartlett
(This used to be commit ba00f45357)
2007-10-10 14:16:25 -05:00
Simo Sorce
071aa999ab r17614: Our first "client side' ldb module.
This module has been created with the purpose of being used
for searches against ldap servers without the need to handle
the control manually

You can test it by passing -o modules:paged_searches to ldbsearch

The page search size is set to 500 objects.

Simo.
(This used to be commit 07d377f3c2)
2007-10-10 14:16:17 -05:00
Simo Sorce
f41fc00624 r17596: apply patch from Martin
(This used to be commit e9d101bc3c)
2007-10-10 14:16:15 -05:00
Andrew Tridgell
9f7da6fea0 r17579: make ldb build g++ friendly
(This used to be commit 403cbd3355)
2007-10-10 14:15:38 -05:00
Andrew Bartlett
c846d461fa r17542: In using ldb_map, I ran across some very odd behaviours when we search
for objectClass=xyz.  The code has been warning at me 'no
covert_operator set', and indeed this is the case.  (It then proceeds to
strip this as a search expression)

In this commit, I have implemented a convert_operator for objectClass,
by pretending it is a simple MAP_CONVERT operator for the search
requests.

I also have changed the logic for when we should bail out.  I can only
see reason to bail out on the search if we have both local and remote
trees.  How can a remote-only search be un-splittable?

Andrew Bartlett
(This used to be commit 656e58672c)
2007-10-10 14:15:35 -05:00
Andrew Bartlett
8f42f1292c r17526: Move timestamp generation into the objectGUID module. It probably
needs to be renamed (operation_add?).

This allows me to match the behaviour and substitute with the
entryUUID module for remote LDAP connections.

Andrew Bartlett
(This used to be commit af02b4d7c6)
2007-10-10 14:15:33 -05:00
Andrew Bartlett
027583e6de r17525: This is a merge from the Google Summer of Code 2006 project by Martin Kühl
<mkhl@samba.org>.

Martin took over the work done last year by Jelmer, in last year's
SoC.  This was a substanital task, as the the ldb modules API changed
significantly during the past year, with the addition of async calls.

This changeset reimplements and enables the ldb_map ldb module and
adapts the example module and test case, both named samba3sam, to the
implementation.

The ldb_map module supports splitting an ldb database into two parts
(called the "local" and "remote" part) and storing the data in one of
them (the remote database) in a different format while the other acts
as a fallback.
This allows ldb to e.g. store to and load data from a remote LDAP
server and present it according to the Samba4 schema while still
allowing the LDAP to present and modify its data separately.

A complex example of this is the samba3sam module (by Jelmer
Vernooij), which maps data between the samba3 and samba4 schemas.

A simpler example is given by the entryUUID module (by Andrew
Bartlett), which handles some of the differences between AD and
OpenLDAP in operational attributes.  It principally maps objectGUID,
to and from entryUUID elements.  This is also an example of a module
that doesn't use the local backend as fallback storage.

This merge also splits the ldb_map.c file into smaller, more
manageable parts.
(This used to be commit af2bece4d3)
2007-10-10 14:15:33 -05:00
Simo Sorce
faed817506 r17514: Simplify the way to set ldb errors and add another
helper function to set them.
(This used to be commit 260868bae5)
2007-10-10 14:15:31 -05:00
Simo Sorce
49f68caed2 r17186: "async" word abuse clean-up part 2
(This used to be commit c6aa60c7e6)
2007-10-10 14:10:17 -05:00
Simo Sorce
c93817b36d r17185: Oh, I wanted to do this for sooo long time.
Finally acknowledge that ldb is inherently async and does not have a dual personality anymore
Rename all ldb_async_XXX functions to ldb_XXX except for ldb_async_result, it is now ldb_reply
to reflect the real function of this structure.

Simo.
(This used to be commit 25fc735404)
2007-10-10 14:10:16 -05:00
Andrew Bartlett
624544f065 r17031: When I first revived the objectclass sorting module, simo complained
that it should handle the add without a search.

Now that I'm working on better behaviour with an LDAP backend, I've
fixed the module to do just that.  For an ADD, and a MODIFY with the
REPLACE flag, we do not need the search step.

Andrew Bartlett
(This used to be commit 87573e2ee4)
2007-10-10 14:10:09 -05:00
Andrew Bartlett
32ab518767 r16972: Replace the sequence_number function pointer in ldb with the ldb flags.
The function pointer was meant to be unused, this patch fixes
partition.c to use ldb_sequence_number().  (No backend provided the
pointer any more).

Set the flags onto the ldb structure, so that all backends opened by
the partitions module inherit the flags.

Set the read-ony flag when accessed as the global catalog

Modify the LDAP server to track that this query is for the global
catalog (by incoming port), and set a opqaue pointer.

Next step is to read that opaque pointer in the partitions module.

Andrew Bartlett
(This used to be commit a1161cb30e)
2007-10-10 14:10:04 -05:00
Andrew Bartlett
44e6f21393 r16825: Make ldb_sainity_check() set an error string. This makes it much
easier to chase down what modules or application code gets wrong.

Ensure not to leave memory allocated on failure in ldb_search()

Andrew Bartlett
(This used to be commit 0828739951)
2007-10-10 14:09:47 -05:00
Andrew Bartlett
f77c410084 r16264: Add, but do not yet enable, the partitions module.
This required changes to the rootDSE module, to allow registration of
partitions.  In doing so I renamed the 'register' operation to
'register_control' and 'register_partition', which changed a few more
modules.

Due to the behaviour of certain LDAP servers, we create the baseDN
entry in two parts: Firstly, we allow the admin to export a simple
LDIF file to add to their server.  Then we perform a modify to add the
remaining attributes.

To delete all users in partitions, we must now search and delete all
objects in the partition, rather than a simple search from the root.
Against LDAP, this might not delete all objects, so we allow this to
fail.

In testing, we found that the 'Domain Controllers' container was
misnamed, and should be 'CN=', rather than 'OU='.

To avoid the Templates being found in default searches, they have been
moved to CN=Templates from CN=Templates,${BASEDN}.

Andrew Bartlett
(This used to be commit b49a4fbb57)
2007-10-10 14:09:09 -05:00
Gerald Carter
e3a6c6be79 r16100: Patch from Michael Wood <mwood@icts.uct.ac.za>: s/then/than/ for correct grammar
(This used to be commit 26a2fa97e4)
2007-10-10 14:08:59 -05:00
Tim Potter
7d7e43d94f r16090: Fix standalone build after the rename of enum ldb_request_type in
r15944.

Hey idra I think a better rename would be to keep the LDB_REQ suffix
here to remain consistent with the other enums (e.g ldb_reply_type,
ldb_async_wait_type and ldb_async_state).
(This used to be commit d44ee8c43b)
2007-10-10 14:08:58 -05:00
Andrew Bartlett
66f77c4ebf r16053: Allow entries without an objectClass. We need this to permit the
cn=rootDSE entry.

(it was also crashing, as 'ac' wasn't initialised at this point)

Andrew Bartlett
(This used to be commit 8455aafb15)
2007-10-10 14:08:53 -05:00
Simo Sorce
ca5accf224 r16036: Add a couple of new functions to corretly deal with timeouts.
Check timeouts are correctly verified.
Some minor fixed and removal of unused code.
(This used to be commit b52e5d6a0c)
2007-10-10 14:08:52 -05:00
Andrew Bartlett
b31c685ec2 r16028: Re-add the objectclass module, in the new async scheme.
Add a test to show that we need this, and to prove it works (for add
at least).

Andrew Bartlett
(This used to be commit f72079029a)
2007-10-10 14:08:51 -05:00
Simo Sorce
2d19dca9c8 r15944: rename LDB_ASYNC_ADD -> LDB_ADD, LDB_ASYNC_MODIFY -> LDB_MODIFY, etc...
(This used to be commit 55d97ef88f)
2007-10-10 14:08:43 -05:00
Simo Sorce
0c7b82e5f6 r15942: Remove the sync internal ldb calls altogether.
This means that some modules have been disabled as well as they
have not been ported to the async interface

One of them is the ugly objectclass module.
I hope that the change in samldb module will make the MMC happy
without the need of this crappy module, we need proper handling
in a decent schema module.

proxy and ldb_map have also been disabled
ldb_sqlite3 need to be ported as well (currenlty just broken).
(This used to be commit 51083de795)
2007-10-10 14:08:43 -05:00
Simo Sorce
03703a58d7 r15932: Remove per request creds
They have never benn used and make little sense too imo
(This used to be commit f0c1d08d50)
2007-10-10 14:08:41 -05:00
Simo Sorce
3a4d7eb2c0 r15927: Optimize ldb module traverse while keeping the API intact.
I was sick of jumping inot each module for each request,
even the ones not handle by that module.
(This used to be commit 7d65105e88)
2007-10-10 14:08:41 -05:00
Simo Sorce
3308a23850 r15922: password_hash.c has proven to be a good way to research how to build an async module
change asq.c to be more readble
(This used to be commit 9197187c42)
2007-10-10 14:08:40 -05:00
Simo Sorce
90a5e19e03 r15913: Error passing in the async code is not in agood shape
Start enhancing it and fix some problems with incorrect evalutaion of the codes

Implement rdn rename (async only)
(This used to be commit 6af1d738b9)
2007-10-10 14:08:39 -05:00
Andrew Tridgell
971d30bb20 r15854: more talloc_set_destructor() typesafe fixes
(This used to be commit 61c6100617)
2007-10-10 14:08:32 -05:00