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

3231 Commits

Author SHA1 Message Date
Andrew Bartlett
4d7dad1315 s4-dsdb: Remove unused variables
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Sat Sep  1 05:10:47 CEST 2012 on sn-devel-104
2012-09-01 05:10:47 +02:00
Andrew Bartlett
01ade93c7c s4-dsdb: Remove unused tmp_ctx leaked onto long-term ldb_context
This was found based on a log provided by Ricky Nance
<ricky.nance@weaubleau.k12.mo.us>.  Thanks Ricky!

Andrew Bartlett
2012-09-01 03:33:20 +02:00
Andrew Bartlett
43904cb4f5 s4-dsdb: Remove double-free in update_keytab module 2012-08-28 07:57:29 +10:00
Andrew Bartlett
8c205395c6 s4-dsdb: Add secrets_tdb_sync - an ldb module to keep secrets.tdb in sync
secrets_tdb_sync is a new ldb module designed to sync secrets.ldb
entries with the secrets.tdb file.

While not ideal to keep two copies of this data, this routine will
assist in allowing the samba-tool domain join code to operate
correctly in most cases where winbindd and smbd are used.

Andrew Bartlett
2012-08-28 07:57:29 +10:00
Andrew Bartlett
be9a8cf4ca s4-dsdb: Remove unused variables 2012-08-23 15:02:26 +02:00
Andrew Bartlett
d1eac79690 s4-dsdb: Do not use a possibly-old loadparm context in schema reload
The loadparm context on the schema DB might have gone away already.
Pre-cache the schema refresh interval at load time to avoid worrying
about this.

Andrew Bartlett
2012-08-23 15:02:25 +02:00
Matthias Dieter Wallnöfer
c4b9c3aba8 s4:samldb LDB module - remove unused "member" attribute from search filter
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2012-08-22 01:31:57 +02:00
Matthias Dieter Wallnöfer
c8bfb8eb09 s4:dsdb - always fail if a search filter could not be parsed
A NULL string/expression returns the generic "(objectClass=*)" filter

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2012-08-22 01:31:55 +02:00
Matthias Dieter Wallnöfer
5f8006cb64 s4:dsdb_sort_objectClass_attr - simplify memory context handling
Do only require the out memory context and build the temporary one in
the body of the function. This greatly simplifies the callers.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2012-08-22 01:31:55 +02:00
Matthias Dieter Wallnöfer
166a7d37f7 s4:dsdb_sort_objectClass_attr - use "data_blob_string_const" for setting values
As shown in commit c8e6d8b487 this looks easier and in any case we can
treat schema context data like global data.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2012-08-22 01:31:55 +02:00
Andrew Bartlett
2e1ab13f6e s4-dsdb: Use tmp_ctx in kccsrv_check_deleted to avoid leaking memory onto part->dn
The confusing use of do_dn as a memory context while legitimate
created a bug when it was copied and modified to search on a DN from
long-term state.

By always using a temporary memory context it is clear what paramter
is the memory context.

This was found based on a log provided by Ricky Nance
<ricky.nance@weaubleau.k12.mo.us>.  Thanks Ricky!

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Aug 17 18:24:10 CEST 2012 on sn-devel-104
2012-08-17 18:24:09 +02:00
Andrew Bartlett
26bfe70def s4-kcc: Avoid use-after-free of dn and add tmp_ctx
By using a tmp_ctx we are clearer about allocating temporary memory.

Andrew Bartlett
2012-08-17 16:41:26 +02:00
Andrew Bartlett
a7b8e9f562 s4-dsdb: Ensure we always free tmp_ctx in schema refresh check
This was found based on a log provided by Ricky Nance
<ricky.nance@weaubleau.k12.mo.us>.  Thanks Ricky!

In that log, over 2.5 days this particular allocation was repeated:

1715099     talloc_new: ../source4/dsdb/samdb/ldb_modules/schema_load.c:120 contains      0 bytes in   1 blocks

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Aug 17 06:21:18 CEST 2012 on sn-devel-104
2012-08-17 06:21:17 +02:00
Stefan Metzmacher
4ee602c7f0 s4:dsdb/repl: fix the usage of 'GC/' prefixed principal names
The "serverReference" attribute is available on the "server" object
not on the "nTDSA" object.

This allows connections to RODCs, as they don't have a
E3514235-4B06-11D1-AB04-00C04FC2DCD2/${NTDSGUID}/${DNSDOMAIN}
principal.

Pair-Programmed-With: Björn Baumbach <bb@sernet.de>

metze

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Aug 14 18:57:41 CEST 2012 on sn-devel-104
2012-08-14 18:57:41 +02:00
Andrew Bartlett
108c8b758a s4-dsdb: Use samdb_dn_is_our_ntdsa()
This uses a GUID based comparison, and avoids re-fetching the
samdb_ntds_settings_dn each time.

Andrew Bartlett
2012-08-14 15:37:22 +02:00
Andrew Bartlett
d582e1bef6 s4-dsdb: Add samdb_dn_is_our_ntdsa()
This is like samdb_reference_dn_is_our_ntdsa but without the attribute de-reference.

Andrew Bartlett
2012-08-14 15:37:22 +02:00
Andrew Bartlett
773d0367a6 s4-dsdb: Use samdb_reference_dn_is_our_ntdsa() 2012-08-14 15:37:22 +02:00
Andrew Bartlett
1e127b270c s4-dsdb: Add helper function samdb_reference_dn_is_our_ntdsa()
We often want to know if we own an FSMO role (for example).  This tries to be more
efficient by comparing the GUID, rather than the string DN, as this does not need
to be re-fetched each time.

Andrew Bartlett
2012-08-14 15:37:22 +02:00
Andrew Bartlett
3c8d8f206b s4-dsdb: Use ldb_dn_copy() rather than talloc_reference()
As the normal case (outside provision) uses a copy, this avoids a case
where a caller might modify a global variable accidentily.

As suggested by metze.

Andrew Bartlett
2012-08-14 15:37:22 +02:00
Andrew Bartlett
fd0394d85d s4-libnet: Improve debugging of libnet_BecomeDC LDAP errors 2012-08-14 15:37:22 +02:00
Stefan Metzmacher
c47d73f6c4 s4:dsdb/repl: ldb_errstring() takes a 'struct ldb_context' not 'int'
metze

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Aug 14 13:58:31 CEST 2012 on sn-devel-104
2012-08-14 13:58:31 +02:00
Stefan Metzmacher
0b926a27d8 s4:dsdb/repl: make sure instanceType_e is not changed by a reallocation
Pair-Programmed-With: Björn Baumbach <bb@sernet.de>

metze
2012-08-14 10:47:26 +02:00
Stefan Metzmacher
d81d6afd6f s4:dsdb/repl: avoid reallocation of msg->elements
The index into the elements needs to match between
msg->elements and md->ctr.ctr1.array, which means we should
pre-allocate them with the same size.

Pair-Programmed-With: Björn Baumbach <bb@sernet.de>

metze
2012-08-14 10:40:55 +02:00
Andrew Bartlett
9566786853 s4-dsdb: Add mem_ctx argument to samdb_ntds_settings_dn
As this value is calculated new each time, we need to give it a context to live on.

If the value is the forced value during provision, a reference is taken.

This was responsible for the memory leak in the replication process.  In the
example I was given, this DN appeared in memory 13596 times!

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Aug 14 10:05:14 CEST 2012 on sn-devel-104
2012-08-14 10:05:14 +02:00
Andrew Bartlett
0f2a87b547 s4-dsdb: Improve memory handling in dsdb_schema_from_ldb_results() by adding a tmp_ctx 2012-08-14 08:27:19 +02:00
Andrew Bartlett
1f7477349f s4-dsdb: Improve memory handling in kccsrv_add_connection() 2012-08-14 08:27:19 +02:00
Andrew Bartlett
77990c1831 s4-dsdb: Improve memory handling in kccsrv_find_connections() by adding a tmp_ctx 2012-08-14 08:27:19 +02:00
Andrew Bartlett
f74e7b5606 s4-dsdb: Add const 2012-08-14 08:27:19 +02:00
Andrew Bartlett
4631723c98 s4-dsdb: Take more care in handling of global schema memory
This reworks dsdb_replicated_objects_commit() to have a proper local tmp_ctx and
to be more careful about what schema is set (only setting a global schema if
the original schema was global).

In particular, the new working_schema is not given a talloc reference
to the old schema.  This ensures that the old schema can go away when
no longer used.

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Sat Aug 11 10:31:57 CEST 2012 on sn-devel-104
2012-08-11 10:31:57 +02:00
Andrew Bartlett
329e374938 s4-dsdb: Remove support for per-partition sequence numbers
These sequence numbers were only used for telling if the schema was
changed, and are no longer directly related to the replication USN.

The per-partition replication USN can be obtained from the
@REPLCHANGED record on the per-partition database, and this is done
with an ldb_search().

Andrew Bartlett
2012-08-11 12:53:42 +10:00
Andrew Bartlett
2d21a9bf5e s4-dsdb: Use only the replication USN for schema reload.
This way we do not track both the partition seq number and the
replication USN for schema reload purposes.

We only need one indication of actual data change, and the replication
per-partition sequence number is no more expensive to obtain than the
ldb per-partition sequence number.

Andrew Bartlett
2012-08-11 12:53:42 +10:00
Björn Jacke
13f8674a15 build: rename security → samba-security
there is a libsecurity on OSF1 which clasheѕ with our security lib. see bug #9023.

Signed-off-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Fri Aug 10 14:22:21 CEST 2012 on sn-devel-104
2012-08-10 14:22:20 +02:00
Andrew Bartlett
fdd07e87c6 s4-dsdb: Explain better what records are written during schema set
This is controlled by setting write_indices_and_attributes.

Andrew Bartlett
2012-08-10 10:18:28 +10:00
Andrew Bartlett
d799b25dd3 s4-dsdb: Remove strcasecmp() fallback in replmd_ldb_message_element_attid_sort
In all callers, we must already have a attributeID for each of the
values or else we would have already given an error, or could not have
obtained the message over DRS.

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Aug  9 11:39:54 CEST 2012 on sn-devel-104
2012-08-09 11:39:54 +02:00
Andrew Bartlett
8dd09ef46d s4-dsdb: Do not reload partition metadata except on transaction start
This ensures that we do not add objects that should go into a partition, but we
simply return that an object is not present if the connection was created
before the partition was loaded.  It is rare to create a new partition.

Andrew Bartlett
2012-08-09 10:01:04 +02:00
Andrew Bartlett
ef87b4e4f1 s4-pydsdb: Provide control of if we should write index attributes when reloading a schema
This allows us to carefully control the loading of the schema.

Andrew Bartlett
2012-08-09 06:39:20 +02:00
Andrew Bartlett
1a1f01ee7a s4-dsdb: Change talloc parent
This matches the rest of the function.

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Aug  9 06:26:36 CEST 2012 on sn-devel-104
2012-08-09 06:26:36 +02:00
Andrew Bartlett
17275561a0 s4-dsdb: Remove ldb_sequence_type argument from partition_primary_sequence_number
We always want LDB_SEQ_HIGHEST_SEQ here.

Andrew Bartlett
2012-08-09 04:32:18 +02:00
Andrew Bartlett
6ec963eef7 s4-dsdb: simplify migration of old-style seqence numbers to metadata.tdb
This simple operation does not need to be encased in generic ldb extended operations.

Andrew Bartlett
2012-08-09 04:32:18 +02:00
Andrew Bartlett
6a648b727f s4-dsdb: Reduce calls to the ldb layer by reloading less often
We do not need to reload the partition list to get the global sequence
number, as that number is stored in the metadata.tdb, not the ldb files.

Andrew Bartlett
2012-08-09 04:32:18 +02:00
Stefan Metzmacher
a370792cbc s4:libcli/pyerrors: s/PyErr_WERROR_IS_ERR_RAISE/PyErr_WERROR_NOT_OK_RAISE/
metze
2012-08-06 15:50:16 +02:00
Stefan Metzmacher
8dafdb54e3 s4:dsdb:replicated_objects: do not move 'instanceType' to the end of msg->elements on RODC replication
It's very important that the order of msg->elements and md->ctr.ctr1.array
is the same.

metze
2012-08-03 08:27:58 +02:00
Andrew Bartlett
6d1b8ff8a7 s4-dsdb: Replace any existing lastKnownParent attribute during delete
This allows a lastKnownParent from LostAndFound to be replaced.

Andrew Bartlett
2012-07-31 14:15:29 +02:00
Andrew Bartlett
fcb54ca25f s4-dsdb: Improve tracing in repl_meta_data
When we call ldb_module_done() rather than just calling the callback, we make log entries
that are critical in debugging.

Andrew Bartlett
2012-07-31 14:15:29 +02:00
Andrew Bartlett
bc5be09bae s4-dsdb: Handle rename conflicts in both directions
Previously we would only consider renaming the local object, now we can cope with
renaming the remote object as well.

This should avoid most of the cases where Samba AD replication can just stop.

Andrew Bartlett
2012-07-31 14:15:29 +02:00
Andrew Bartlett
221cd524e3 s4-dsdb: Request extended DN and show deleted when searching for a possible parent
This fixes up the lastKnownParent attribute on lostAndFound objects to have a GUID

(found by dbcheck).

Andrew Bartlett
2012-07-31 14:15:29 +02:00
Andrew Bartlett
b567d3a607 s4-dsdb: Fill in lastKnownParent when moving to lostAndFound
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Sun Jul 29 16:51:34 CEST 2012 on sn-devel-104
2012-07-29 16:51:34 +02:00
Andrew Bartlett
54b83ce9b7 s4-dsdb: Do not strip base components off DN before searching for NC root 2012-07-29 22:55:33 +10:00
Andrew Bartlett
056b215156 s4-dsdb: Change move to lostAndFound to use container in this partiion and add debugging
The logic looking for LostAndFound failed for a user, so add extensive
debugging to make this eaiser to trace down in future.

Andrew Bartlett
2012-07-29 22:55:33 +10:00
Andrew Bartlett
03a75afa79 s4-dsdb: Provide a way to force incoming renames to take priority
This should mean that a samba-tool drs replicate --full-sync forces a
replication of all objects, regardless of if we think the local name
is newer and regards any local name as being in conflict.

Andrew Bartlett
2012-07-29 22:55:33 +10:00