1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-05 21:57:51 +03:00

2613 Commits

Author SHA1 Message Date
Andrew Bartlett
a993f53d52 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
(This used to be commit 9c1cd9c2c6bcd9d056a7c9caafacdd573562ebbc)
2007-10-10 14:15:33 -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 af02b4d7c631bb15bf5a5f73f9fdc23075d50f60)
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 af2bece4d343a9f787b2e3628848b266cec2b9f0)
2007-10-10 14:15:33 -05:00
Simo Sorce
a23b63a8e5 r17516: Change helper function names to make more clear what they are meant to do
(This used to be commit ad75cf869550af66119d0293503024d41d834e02)
2007-10-10 14:15:31 -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 260868bae56194fcb98d55afc22fc66d96a303df)
2007-10-10 14:15:31 -05:00
Simo Sorce
a9ad616a68 r17513: ldb_set_errstring is an ldb private string, samdb uses DEBUG() statements
(This used to be commit c57b6420aa4a220257df714aaccb016acb4bae24)
2007-10-10 14:15:31 -05:00
Simo Sorce
8b9e08fe76 r17505: we are setting the timeout with the provide function right after.
(This used to be commit 6520e3c83acfbb7b6aa63d1cbebe8f8801db292f)
2007-10-10 14:15:30 -05:00
Simo Sorce
71041a5007 r17504: Do not use the invented unixID but use the rfc2307 uidNumber and gidNumber attributes instead
Do not change unixName right now, we don't have an attribute to use in the posixGroup class,
and I think we should remove its usage altogether and look up users and groups by their uid/gid only.

Simo.
(This used to be commit d57b521aadf24a277152ec1ff1dac3210bd14316)
2007-10-10 14:15:30 -05:00
Andrew Bartlett
ecfdd5fc6c r17474: Allow the partitions module to load modules for specific backends.
Andrew Bartlett
(This used to be commit c016db2187120991e8ad779b9df35480d7c19400)
2007-10-10 14:15:27 -05:00
Andrew Bartlett
c45ac4343c r17331: Oops, how did I commit this empty file...
Andrew Bartlett
(This used to be commit 3b81f21d4153350b1febe23daad9a08efc617954)
2007-10-10 14:15:15 -05:00
Andrew Bartlett
5d7b99804a 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
(This used to be commit be51b7240889bfcc752f92a2920d8b6a2eccecd6)
2007-10-10 14:15:09 -05:00
Andrew Bartlett
cfa762ff87 r17302: Testing!
This confirms that records are replicated into the correct databases,
and that the case insensitive flags really work.

Andrew Bartlett
(This used to be commit ad463c1a5243019548bdbeea3070ec2e6cbcfcdf)
2007-10-10 14:15:08 -05:00
Andrew Bartlett
77bb75ead0 r17299: Improve the partition module to replicate attribute records into all
partitions.

Test that we do that correctly.

Andrew Bartlett
(This used to be commit 90c07b88010b848423dee9556a24e8d181c365dd)
2007-10-10 14:15:08 -05:00
Andrew Bartlett
4317209606 r17298: Fix up the local_password module to the current LDB API, and build it by default.
Andrew Bartlett
(This used to be commit c1ea0a350cdc2c5ddfd71e08f8c3907d97fc1efd)
2007-10-10 14:15:08 -05:00
Andrew Bartlett
e20ed616e4 r17289: Fix the build: I havn't commited this module yet.
Andrew Bartlett
(This used to be commit 8b0f6e637ee3ef0767be4017b4106877c185d7c7)
2007-10-10 14:15:07 -05:00
Andrew Bartlett
56b1714e9c r17288: Don't mess with entries in the local password prefix, and fix const
warnings.

Andrew Bartlett
(This used to be commit 4569c58a42e1d65ae71ee57e391b9e3dbaba2218)
2007-10-10 14:15:07 -05:00
Andrew Bartlett
0771801911 r17287: Add the local_password module to the tree, so it doesn't get lost in
ldb API changes.

Andrew Bartlett
(This used to be commit 44806c67dbabe2952fe355de76d7fa51f772775f)
2007-10-10 14:15:07 -05:00
Simo Sorce
49f68caed2 r17186: "async" word abuse clean-up part 2
(This used to be commit c6aa60c7e69abf1f83efc150b1c3ed02751c45fc)
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 25fc7354049d62efeba17681ef1cdd326bc3f2ef)
2007-10-10 14:10:16 -05:00
Andrew Bartlett
37eab82528 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
(This used to be commit 0a354a1ddeccd9a6b1610bc6813a86fcdfc4d310)
2007-10-10 14:10:13 -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 a1161cb30e4ffa09657a89e03ca85dd6efd4feba)
2007-10-10 14:10:04 -05:00
Andrew Bartlett
fdbbabe602 r16933: Sort the partitions in order from most, to least specific.
Remember to perform operations on the base database as well.

Andrew Bartlett
(This used to be commit eae232530c967fe949355cf1914ca0cb8c0ea8c2)
2007-10-10 14:10:01 -05:00
Andrew Bartlett
bfc02627ce r16914: Add more tests for the partition module.
Andrew Bartlett
(This used to be commit 2728b60dfa50ded03e06f0bd53eee55fce5143bd)
2007-10-10 14:09:59 -05:00
Andrew Bartlett
0f215e9947 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
(This used to be commit ae470ff7014e52b55d88e9fe12e2322e069daf9d)
2007-10-10 14:09:54 -05:00
Andrew Bartlett
bc3d68af6d 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
(This used to be commit 9d31b9f04721a2cac62f492f8db071aaa0aa966b)
2007-10-10 14:09:54 -05:00
Andrew Bartlett
51e0ae33ac r16833: Add a base DN to more search calls, we need to look for an ID over the
whole tree here.

Andrew Bartlett
(This used to be commit 7674306e673341513d26556a845a698a28dec92b)
2007-10-10 14:09:49 -05:00
Andrew Bartlett
ebea352760 r16831: Use a valid memory context (found by the IBM checker).
Andrew Bartlett
(This used to be commit 9fdbedafad69e55ef4ccad51c4f002c49e43f372)
2007-10-10 14:09:48 -05:00
Andrew Bartlett
3ed1e8ff3c 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
(This used to be commit 3e58350ec2ab883795b1dd03ac46a3520cac67d0)
2007-10-10 14:09:48 -05:00
Andrew Bartlett
f2e8b3202c 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
(This used to be commit 10eeea6da465564ed9f785d06e2d2ed06cfe29a4)
2007-10-10 14:09:48 -05:00
Simo Sorce
a3f606f6ca 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.
(This used to be commit b9b6bb3e89d3b0e04ccce15156c1a128b6f20d88)
2007-10-10 14:09:45 -05:00
Andrew Bartlett
8932ab2066 r16771: Add const and some better debug messages.
Andrew Bartlett
(This used to be commit 87cac3529ca4f114a93adb5b307766e681c49a1d)
2007-10-10 14:09:44 -05:00
Andrew Bartlett
6218aef0ca 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
(This used to be commit e957f6f4c61c121f79ad518822691e4fd4bf4341)
2007-10-10 14:09:44 -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 b49a4fbb57f10726bd288fdc9fc95c0cbbe9094a)
2007-10-10 14:09:09 -05:00
Andrew Bartlett
6959f2a061 r16263: A number of these searches need to be under the partitions DN, and the
other needs the default basedn.

Andrew Bartlett
(This used to be commit 42c2495683083110ec41aeab5adeee09762db3dd)
2007-10-10 14:09:08 -05:00
Andrew Bartlett
4a687bc44f 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
(This used to be commit 2f104612cd6f170dd28fd4ce09156168d47a681a)
2007-10-10 14:09:08 -05:00
Andrew Bartlett
422f1b5495 r16227: Don't segfault if the ldb_search() fails.
Andrew Bartlett
(This used to be commit af11f464a717cc7db0393070da780091a6053ee0)
2007-10-10 14:09:06 -05:00
Andrew Bartlett
9f4b56dd13 r16159: Even more work on samldb error reporting. Make sure to get the
original error strings back to the callers.

Andrew Bartlett
(This used to be commit defa63298838fefae7ed003458020045edaef21d)
2007-10-10 14:09:02 -05:00
Andrew Bartlett
c8d0489c10 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
(This used to be commit 2d2e71a2d5827c9dc8785b87547559071b47ab34)
2007-10-10 14:09:00 -05:00
Andrew Bartlett
f283307f52 r16125: Add another helpful utility function: samdb_msg_add_int()
Andrew Bartlett
(This used to be commit 2fe9de8105843776b8ef41ef6f9a6cea5cb188ff)
2007-10-10 14:09:00 -05:00
Andrew Bartlett
4a350fd18f r16109: Make this module simpiler, don't intercept operations we are not going
to implement.

Andrew Bartlett
(This used to be commit 3252e425b0e28656ac5fb19fa4edf7322ea72eab)
2007-10-10 14:09:00 -05:00
Andrew Bartlett
e5a00c8ca6 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
(This used to be commit b31003403d84def6f11b21df566ff57c01da21b8)
2007-10-10 14:08:59 -05:00
Andrew Bartlett
247af0d569 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
(This used to be commit fbe7d0ca9031e292b2d2fae263233c973982980a)
2007-10-10 14:08:57 -05:00
Simo Sorce
2ed444de43 r16070: Fix kludge_acls
(This used to be commit 795f8ebe8eecf28f5729754dc248d2a8411effb9)
2007-10-10 14:08:56 -05:00
Andrew Bartlett
e2e5c037f0 r16069: Remove unused destructor and an unused variable.
Andrew Bartlett
(This used to be commit 25e85975459acc556c0d46f1683dd4bbdd94874b)
2007-10-10 14:08:56 -05:00
Andrew Bartlett
629d6ad3cf 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
(This used to be commit 4e39d7bb245bc337ac496c7e39a510d1c5611c71)
2007-10-10 14:08:55 -05:00
Simo Sorce
56c46ee241 r16042: Fix crashbug caused by incorret error reporting.
(This used to be commit d346531d0a3e7160ae2a3bdc430521148b485540)
2007-10-10 14:08:52 -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 b52e5d6a0cb1a32e62759eaa49ce3e4cc804cc92)
2007-10-10 14:08:52 -05:00
Simo Sorce
e47c00414f r16022: ooops, a bit too aggressive commit :-)
(This used to be commit 959c8c35ef170e03a5f698d0fa11616583cc6f66)
2007-10-10 14:08:51 -05:00
Simo Sorce
68e72e389b 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.
(This used to be commit 6b214f232eefc4ffbc98dfb68c99d1f0c97ae6db)
2007-10-10 14:08:51 -05:00
Andrew Bartlett
08a48b1803 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
(This used to be commit ee6fe3a80fd5038c2b141bf8a85139f99ac96e4d)
2007-10-10 14:08:47 -05:00