1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-25 00:23:52 +03:00
Commit Graph

326 Commits

Author SHA1 Message Date
Andrew Bartlett
420d1920a6 r17703: Fixes to enable the entryUUID module to work for it's objectClass ->
OID mappings.

The key point is to 'enable' the partitions in the partitions module
before the init is complete.  That way, the modules can perform
searches that use partitions.

Andrew Bartlett
2007-10-10 14:16:28 -05:00
Andrew Bartlett
3c497405fe r17699: Remove more printf calls.
Try to cope with partital initialisation.

Andrew Bartlett
2007-10-10 14:16:27 -05:00
Andrew Bartlett
9f810ddd14 r17694: Don't use printf() in a module... 2007-10-10 14:16:26 -05:00
Andrew Bartlett
fb085a651f r17690: Demonstrate how we can read the schema to find out details needed for
translation.  I hope to have this reading a schema structure in the
future.

Andrew Bartlett
2007-10-10 14:16:25 -05:00
Andrew Bartlett
3b5c973988 r17639: Martin Kuhl noticed that we loaded an incorrect value for
distinguisedName on templated objects.

In looking how to handle distinguishedName correctly on LDAP, I was
very glad to find it supported entryDN, and this adds another mapping.

Andrew Bartlett
2007-10-10 14:16:18 -05:00
Andrew Bartlett
0e19d15969 r17553: Actually enable the samba3sam module. Should help 'make test'.
Andrew Bartlett
2007-10-10 14:15:37 -05:00
Andrew Bartlett
9c1cd9c2c6 r17529: Simo doesn't like the use of the internal ldb_errstring in functions
not used purely as ldb module helper functions.  This now passes these
strings back as explicit parameters.

Andrew Bartlett
2007-10-10 14:15:33 -05:00
Andrew Bartlett
af02b4d7c6 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
2007-10-10 14:15:33 -05:00
Andrew Bartlett
af2bece4d3 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.
2007-10-10 14:15:33 -05:00
Simo Sorce
ad75cf8695 r17516: Change helper function names to make more clear what they are meant to do 2007-10-10 14:15:31 -05:00
Simo Sorce
260868bae5 r17514: Simplify the way to set ldb errors and add another
helper function to set them.
2007-10-10 14:15:31 -05:00
Simo Sorce
6520e3c83a r17505: we are setting the timeout with the provide function right after. 2007-10-10 14:15:30 -05:00
Andrew Bartlett
c016db2187 r17474: Allow the partitions module to load modules for specific backends.
Andrew Bartlett
2007-10-10 14:15:27 -05:00
Andrew Bartlett
3b81f21d41 r17331: Oops, how did I commit this empty file...
Andrew Bartlett
2007-10-10 14:15:15 -05:00
Andrew Bartlett
be51b72408 r17303: More testing results: Don't try and call a NULL callback, and use the
correct parameter, as this is called for more than just 'add'.

Andrew Bartlett
2007-10-10 14:15:09 -05:00
Andrew Bartlett
ad463c1a52 r17302: Testing!
This confirms that records are replicated into the correct databases,
and that the case insensitive flags really work.

Andrew Bartlett
2007-10-10 14:15:08 -05:00
Andrew Bartlett
90c07b8801 r17299: Improve the partition module to replicate attribute records into all
partitions.

Test that we do that correctly.

Andrew Bartlett
2007-10-10 14:15:08 -05:00
Andrew Bartlett
c1ea0a350c r17298: Fix up the local_password module to the current LDB API, and build it by default.
Andrew Bartlett
2007-10-10 14:15:08 -05:00
Andrew Bartlett
8b0f6e637e r17289: Fix the build: I havn't commited this module yet.
Andrew Bartlett
2007-10-10 14:15:07 -05:00
Andrew Bartlett
4569c58a42 r17288: Don't mess with entries in the local password prefix, and fix const
warnings.

Andrew Bartlett
2007-10-10 14:15:07 -05:00
Andrew Bartlett
44806c67db r17287: Add the local_password module to the tree, so it doesn't get lost in
ldb API changes.

Andrew Bartlett
2007-10-10 14:15:07 -05:00
Simo Sorce
c6aa60c7e6 r17186: "async" word abuse clean-up part 2 2007-10-10 14:10:17 -05:00
Simo Sorce
25fc735404 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.
2007-10-10 14:10:16 -05:00
Andrew Bartlett
0a354a1dde r17103: Big updates to the not-yet-enabled partitions module. It now services
the Global Catalog port 'correctly' (in a very simple sense) in that
it should be no worse than what we had before.

We now combine partitions together to search over the whole tree, when
we are marked as 'global catalog'.

Andrew Bartlett
2007-10-10 14:10:13 -05:00
Andrew Bartlett
a1161cb30e 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
2007-10-10 14:10:04 -05:00
Andrew Bartlett
eae232530c r16933: Sort the partitions in order from most, to least specific.
Remember to perform operations on the base database as well.

Andrew Bartlett
2007-10-10 14:10:01 -05:00
Andrew Bartlett
2728b60dfa r16914: Add more tests for the partition module.
Andrew Bartlett
2007-10-10 14:09:59 -05:00
Andrew Bartlett
ae470ff701 r16860: Fix (and reactivate) the RPC-SAMR test. We need to allow these sids
to be created as foreign, even if they are in a local domain.

Also we do need the user to exist for the life of the test, as we add
it to a group.

Andrew Bartlett
2007-10-10 14:09:54 -05:00
Andrew Bartlett
9d31b9f047 r16854: Fix the RPC-SAMR-PASSWORDS test. It failed because we allocated users
in the Builtin domain a SID from the global domain.

Andrew Bartlett
2007-10-10 14:09:54 -05:00
Andrew Bartlett
9fdbedafad r16831: Use a valid memory context (found by the IBM checker).
Andrew Bartlett
2007-10-10 14:09:48 -05:00
Andrew Bartlett
3e58350ec2 r16829: Fix a number of issues raised by the IBM checker, or gcc warnings.
In particular, this removes one use of the LDB_DN_NULL_FAILED macro,
which was being used on more than DNs, had an embedded goto, and
confused the IBM checker.

In the password_hash code, ensure that sambaAttr is not, before
checking the number of values.

In GENSEC, note that this switch value can't occour.  This seems to be
the only way to quiet both the IBM checker and gcc, as well as cope
with possibly invalid inputs.

Andrew Bartlet
2007-10-10 14:09:48 -05:00
Andrew Bartlett
10eeea6da4 r16827: Factor out some code into common samdb functions:
- creation of ForeignSecurityPrincipals
 - template duplication code

Rework much of the LSA server to pass the RPC-LSA test.  Much of the
server code was untested.  In implementing the LSA Accounts feature, I
have opted to have it only create entires when privilages are applied,
and not to delete entries, but to delete the privilages.

We skip some parts of the test, but it is much better than not testing
it at all.

Andrew Bartlett
2007-10-10 14:09:48 -05:00
Simo Sorce
b9b6bb3e89 r16784: - make some function in ldb static, they not need to be exported anywhere
- fix a bad segfault
  Andrew please make test before committing.

Simo.
2007-10-10 14:09:45 -05:00
Andrew Bartlett
e957f6f4c6 r16769: Working on fixing the RPC-SAMR test against Samba4. This fixes
password changes which only include the LM and NT hash, such as the
original ChangePassword.

It also fixes setting passwords on the BUILTIN domain.

Finally, the msDS-KeyVersionNumber is only incremented if not
explicity set by the modify.

Andrew Bartlett
2007-10-10 14:09:44 -05:00
Andrew Bartlett
b49a4fbb57 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
2007-10-10 14:09:09 -05:00
Andrew Bartlett
2f104612cd r16240: Add better error reporting in the password_hash module
Remove duplicate attribute in search request

Search for the domain by NDR-encoded SID, not string (consistant with
the rest of the C code, and helps partially-constructed LDAP
backends).

Use the default basedn for the domain search.

Andrew Bartlett
2007-10-10 14:09:08 -05:00
Andrew Bartlett
af11f464a7 r16227: Don't segfault if the ldb_search() fails.
Andrew Bartlett
2007-10-10 14:09:06 -05:00
Andrew Bartlett
defa632988 r16159: Even more work on samldb error reporting. Make sure to get the
original error strings back to the callers.

Andrew Bartlett
2007-10-10 14:09:02 -05:00
Andrew Bartlett
2d2e71a2d5 r16129: Further clean up the samldb module.
This adds more/better setting of the ldb error string, and avoids
using gendb_search(), as this doens't return the error code.

Andrew Bartlett
2007-10-10 14:09:00 -05:00
Andrew Bartlett
3252e425b0 r16109: Make this module simpiler, don't intercept operations we are not going
to implement.

Andrew Bartlett
2007-10-10 14:09:00 -05:00
Andrew Bartlett
b31003403d r16108: Fixes from working with the partition module.
We were not using the correct baseDN for the templates search.  Using NULL is no longer valid (like against AD).

While chasing that down, return proper error codes, and use the
ldb_set_errstr() to get a good error string back up to the UI layer.

Andrew Bartlett
2007-10-10 14:08:59 -05:00
Andrew Bartlett
fbe7d0ca90 r16083: Make it possible to initialise a backend module, without it setting up
the whole ldb structure.

Because the sequence number was a fn pointer on the main ldb context,
turn it into a full request (currently sync).

Andrew Bartlett
2007-10-10 14:08:57 -05:00
Simo Sorce
795f8ebe8e r16070: Fix kludge_acls 2007-10-10 14:08:56 -05:00
Andrew Bartlett
25e8597545 r16069: Remove unused destructor and an unused variable.
Andrew Bartlett
2007-10-10 14:08:56 -05:00
Andrew Bartlett
4e39d7bb24 r16061: Prove that removing the objectClass list in the samldb module breaks things.
With this fix, we now correctly detect computers again, and get the
correct objectCategory, which is important for the OSX AD plugin.

Andrew Bartlett
2007-10-10 14:08:55 -05:00
Simo Sorce
d346531d0a r16042: Fix crashbug caused by incorret error reporting. 2007-10-10 14:08:52 -05:00
Simo Sorce
b52e5d6a0c 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.
2007-10-10 14:08:52 -05:00
Simo Sorce
959c8c35ef r16022: ooops, a bit too aggressive commit :-) 2007-10-10 14:08:51 -05:00
Simo Sorce
6b214f232e r16021: While studying how to make samldb really async I found a critical situation handled in the incorrect way.
A while(1) loop may end up looping forever consuming all valid RIDs because of a secondary bug.
And anyway nextRid is supposed to always give back a new unique RID, if someone messed up the database let him
fix the problem first, trying to be smart here would probably end up in worst results.

Simo.
2007-10-10 14:08:51 -05:00
Andrew Bartlett
ee6fe3a80f r15999: password_hash module changes:
- Quiet some IBM Checker warnings (enum mismatch)
 - Only search for the attributes we need
 - fix comments
 - fix copyrights

Andrew Bartlett
2007-10-10 14:08:47 -05:00