1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-18 06:04:06 +03:00

57062 Commits

Author SHA1 Message Date
Andrew Tridgell
d483c3bb96 s4-ldb: fixed tdb error handling in ldb_index.c 2009-10-22 12:47:55 +11:00
Andrew Tridgell
fcd16eab6c s4-ldb: delete empty index records 2009-10-22 12:47:54 +11:00
Andrew Tridgell
936c8f311a s4-ldb: do more validation of idxptr lists 2009-10-22 12:47:54 +11:00
Andrew Tridgell
74ae8b90ae s4-ldb: expose ltdb_err_map and ltdb_delete_noindex
These will be used by ldb_index.c
2009-10-22 12:47:54 +11:00
Andrew Tridgell
c4cb0c520c s4-ldb: fast path for equal pointers
We compare identical ldb_val values surprisingly often
2009-10-22 12:47:54 +11:00
Andrew Tridgell
606ff46447 selftest: make python run unbuffered
This makes some output in make test easier to follow
2009-10-22 12:47:54 +11:00
Andrew Tridgell
dfa0b74516 util: fixed place where we could look one byte past end of string
We need to check the length before the value
2009-10-22 12:47:54 +11:00
Andrew Tridgell
3f5d535972 idl-drsblobs: mark some more reserved values as value(0)
This prevents valgrind errors when we store these blobs in a database
2009-10-22 12:47:53 +11:00
Andrew Tridgell
5f3cbb5f0b s4-ldb: when taking a list intersection, the result can be as long as the first list
Intuitively you would think it couldn't be longer than the minimum of
the two lists, but we are deliberately allowing for duplicates at this
level of the indexing code, which means the result can be longer
2009-10-22 12:47:53 +11:00
Andrew Tridgell
859cf72692 s4-ldb: ldb indexing rewrite - part1
This gets rid of the @IDXPTR approach to in-transaction indexing,
instead using an in-memory tdb to hold index values during a
transaction. This also cleans up a lot of the internal indexing logic,
hopefully making it easier to understand.

One of the big changes is in memory management, with a lot more use
made of talloc tricks to avoid copying dn lists, and shortcuts used to
avoid high intersection and union calculation costs.

The overall result is that a re-provision on my laptop goes from 48s
to a bit over 10s.
2009-10-22 12:47:53 +11:00
Andrew Tridgell
c5de880c40 s4-ldb: ldb_oom() for modules 2009-10-22 12:47:53 +11:00
Andrew Bartlett
c9838f0e13 s4:torture Silence const warning by use of data_blob_const()
This was inspired by one of mdw's const patches

Andrew Bartlett
2009-10-22 10:17:35 +11:00
Matthias Dieter Wallnöfer
60ec0f1ae7 s4:dsdb/samdb/cracknames - Remove unused header and add more "const"
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2009-10-22 10:02:48 +11:00
Matthias Dieter Wallnöfer
d120e7ebde s4:ldb_sort - Add some more "const"
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2009-10-22 10:02:43 +11:00
Matthias Dieter Wallnöfer
0defcfb4f7 s4:libcli/security/access_check - Add "const" in front of "type"
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2009-10-22 10:02:38 +11:00
Matthias Dieter Wallnöfer
24bca52c0b s4:smbtorture - Add "const" before "value"
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2009-10-22 10:02:27 +11:00
Andrew Bartlett
925a94b67c s4:dsdb Use the 'correct' case for the namingContext values in rootDSE
This makes the namingContext attributes in the rootDSE a little more pretty, by
using the exact same values as used in the database DNs.

Andrew Bartlett
2009-10-22 09:45:14 +11:00
Andrew Bartlett
f4240973ba s4:dsdb Add default modules list to samba3sam
This is needed because the work to allow existing databases to be loaded now
moves the 'you have an old @PARTITION' record to the presense or absence of
this attribute.

Andrew Bartlett
2009-10-22 09:22:18 +11:00
Matthias Dieter Wallnöfer
33f3d54de4 s4:provision - rework the "guess_names" and "make_smbconf" method
- Cleans it up from unnecessary "lower()/upper()" and parameters which can be
  derived through "lp" calls.
- Substitute the "HOSTNAME" caption in the "smb.conf" templates with
  "NETBIOS_NAME" which fits better.
- Now the "realm" and "domain" parameter of the provision are totally case
  insensitive and the script itself up/downcases them appropriately depending
  on the use (e.g. "realm" upcase for KERBEROS, lowcase for DNS domainname).
2009-10-21 23:43:04 +02:00
Björn Jacke
78a5e26783 s3:Makefile: add some explicit dependencies to libc
Add libc as explicit dependency where we use "-z defs" linker flags. This is
to silence the Sun linker. Otherwise it whines:

malloc  ... (symbol belongs to implicit dependency /lib/libc.so.1)
2009-10-21 22:50:39 +02:00
Matthias Dieter Wallnöfer
47fcde1922 s4:provision - important fix for DNS domainname: lower realm 2009-10-21 18:46:44 +02:00
Matthias Dieter Wallnöfer
925b156a12 .gitignore: add "partition_proto.h" 2009-10-21 17:56:17 +02:00
Matthias Dieter Wallnöfer
9f170bc7ea heimdal - hdb/ext.c - fix a "shadows variable" warning
Renamed the variable "str" in the nested block to "str2" to prevent the collision
with "str" in the main function block.
2009-10-21 17:35:51 +02:00
Torgeir Lerkerød
95ce7dff20 S4: ldb_map modules uses defines that are reserved
On OpenSolaris MAP_RENAME and friends are defined in <sys/mman.h> e.g. mmap and friends. So on these systems MAP_* have a meaning. Cleaned up LDB name space by adding LDB_ in front of MAP_* e.g. MAP_RENAME => LDB_MAP_RENAME

Signed-off-by: Torgeir Lerkerød <torgeir.lerkerod@gmail.com>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2009-10-21 15:46:38 +02:00
Torgeir Lerkerød
6e5dad49d9 S4: Building on a system with libintl
Heimdal's internal buildsystem uses a different define for checking for libintl than what samba uses. LIBINTL vs HAVE_LIBINTL_H. Since changing heimdals defineswould brake dropin merges of heimdal. This is a simple workaround in line with others in heimdal_build catalog.

Signed-off-by: Torgeir Lerkerød <torgeir.lerkerod@gmail.com>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2009-10-21 15:46:38 +02:00
Rusty Russell
0944931159 lib/tdb: make tdbtool use tdb_check() for "check" command
Also, set logging function so we get more informative messages.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2009-10-22 00:11:34 +10:30
Rusty Russell
022b4d4aa6 lib/tdb: add tdb_check()
ctdb wants a quick way to detect corrupt tdbs; particularly, tdbs with
loops in their hash chains.  tdb_check() provides this.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2009-10-22 00:10:34 +10:30
Rusty Russell
0fc6800005 lib/tdb: add -t (always use transactions) option to tdbtorture
This means you can kill it at any time and expect no corruption.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2009-10-22 00:10:54 +10:30
Rusty Russell
b77f41d58b lib/tdb: wean off TDB_ERRCODE.
It was a regrettable hack which I used to reduce line count in tdb; in fact it caused confusion as can be seen in this patch.
In particular, ecode now needs to be set before TDB_LOG anyway, and having it exposed in
the header is useless (the struct tdb_context isn't defined, so it's doubly useless).
Also, we should never set errno, as io.c was doing.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2009-10-22 00:09:43 +10:30
Rusty Russell
703004340c lib/tdb: TDB_TRACE support (for developers)
When TDB_TRACE is defined (in tdb_private.h), verbose tracing of tdb operations is enabled.
This can be replayed using "replay_trace" from http://ccan.ozlabs.org/info/tdb.

The majority of this patch comes from moving internal functions to _<funcname> to
avoid double-tracing.  There should be no additional overhead for the normal (!TDB_TRACE)
case.

Note that the verbose traces compress really well with rzip.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2009-10-22 00:00:12 +10:30
Andrew Tridgell
1467e5eaab s4-ldb: allow for non-null terminated ldb_val in ldb_dn_from_ldb_val
The strlen() could go past the end of a non-null terminated value
2009-10-21 22:43:58 +11:00
Andrew Bartlett
16a80f1742 s4:dsdb Add note explaining about the partition format upgrade 2009-10-21 22:43:58 +11:00
Andrew Bartlett
d7cf71d9b6 s4:dsdb Allow loading of old-style partition records
This should make upgrades easier
2009-10-21 22:43:57 +11:00
Andrew Bartlett
4209cf9860 s4:dsdb Make the 'relative path' code in partitions handle tdb://
The previous code would fail if the caller used tdb:// in the URL for the
top-level database.

Andrew Bartlett
2009-10-21 22:43:57 +11:00
Andrew Bartlett
fa2e04b640 s4:ldb_map Fix use-after-free of memory in ldb_map
We need to keep the old 'ares' from the remote server around so we can forward
it back to the caller.  We can't send the same controls (from the last search
entry) twice (and it makes no sense anyway).

Andrew Bartlett
2009-10-21 22:43:57 +11:00
Andrew Bartlett
96ec45309a s4:dsdb talloc_steal the backend module to under the partition 2009-10-21 22:43:57 +11:00
Andrew Bartlett
937140bf10 s4:ldb Put ltdb_private under the 'module'
This helps track the memory better, as we can then place it under the partition
hirarchy.

Andrew Bartlett
2009-10-21 22:43:56 +11:00
Andrew Bartlett
a0a787ad78 s4:rpc_server Ensure we talloc_free handles when we delete objects
If we don't talloc_free the handle, we leak the memory onto the long-term
context.

Andrew Bartlett
2009-10-21 22:43:56 +11:00
Andrew Bartlett
398188fb9b s4:dsdb Remove potentially confusing 'partition' control from result
This ensures that the partition control, needed here for repl_meta_data's
internal work, is not pushed up to other callers.

Andrew Bartlett
2009-10-21 22:43:56 +11:00
Andrew Bartlett
bd53628c7a s4:ldb Add new function to create a cut down list of controls
This I hope will be useful for removing controls from the ldb_reply

Andrew Bartlett
2009-10-21 22:43:56 +11:00
Andrew Bartlett
fcbe6163f6 s4:samr Don't leak the whole user onto the long-term handle
The user entry is only required for this function, so use
mem_ctx to hold it.

Andrew Bartlett
2009-10-21 22:43:56 +11:00
Andrew Bartlett
108b8344db librpc Make talloc tree in binding tower match the floors
This is mostly cosmetics, but helped me see that these are legitimate stuctures
when viewed in the talloc tree.

Also don't put the 'ndr' structure on the long-term tree.

Andrew Bartlett
2009-10-21 22:43:55 +11:00
Andrew Bartlett
47daa272c0 s4:epmapper Create a proper talloc tree of endpoint floors
Andrew Bartlett
2009-10-21 22:43:55 +11:00
Andrew Bartlett
154747759e s4:dsdb Allow creation of new partitions
This is a collection of fixes to allow the creation of new partitions,
as well as adding debugging that may be useful in chasing down future
failures.

Andrew Bartlett
2009-10-21 22:43:55 +11:00
Andrew Bartlett
4c36cac5ad s4:provision Use schema to casefold partitions on 'upgrade'.
This helps us upgrade from sam.ldb files before the dynamic partitions
work, and ensures we use the right casefolding functions.

Andrew Bartlett
2009-10-21 22:43:55 +11:00
Andrew Bartlett
da7c778741 s4:dsdb Remove default instanceType from repl_meta_data
This is no longer required, as the instancetype module is now above
repl_meta_data.

Andrew Bartlett
2009-10-21 22:43:54 +11:00
Andrew Bartlett
c106017f9a s4:dsdb Remove workaround for two partition head records
The problem here has been avoided in repl_meta_data, and so this is no
longer required.

Andrew Bartlett
2009-10-21 22:43:54 +11:00
Andrew Bartlett
96c9bc18d5 s4:dsdb Use 'partition modified' information to update @REPLCHANGED
This major rework of repl_meta_data changes it from using a static
list of partitions to a dynamic list created from the controls placed
on returned ldb results.

To process these in one place, the similar but distinct callbacks are
combined into a single replmd_op_callback(), which handles both the
'normal operation' and 'inbound replication' case.

This allows new partitions to be created, and replication events for
these new partitions to be scheduled immediately.

Also in this commit: We no longer specify the target partition for new
or modified objects - instead we allow the partitions module to use
the DN as normal.  THis avoids the issue where we would create two
partition head records.

Andrew Bartlett
2009-10-21 22:43:54 +11:00
Andrew Bartlett
d3a5037f2a s4:repl Pass schema as argument to replmd_update_rpmd() 2009-10-21 22:43:53 +11:00
Andrew Bartlett
f545d5fa43 s4:dsdb In partitions module, tell the caller what partition was used.
This means we don't return any control for modifications to the
control records in sam.ldb, but do if they modified one of the actual
data LDB files.

Andrew Bartlett
2009-10-21 22:43:53 +11:00