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

114 Commits

Author SHA1 Message Date
Simo Sorce
166195b487 r26574: Do not call functions in the variable declaration, fix checking for tmp_ctx,
and also makes code more readable and debuggable.

Eliminate silly parenthesys.

Simo.
2007-12-24 01:51:04 -06:00
Andrew Tridgell
aa9ab431e0 r25690: - only use a readonly traverse in ldb_search when not in a transaction. When we are in a transaction then we could be in a top level modify operation (such as rename), so we must use a writeable traverse so that the async callbacks can do the modifies while the search is progressing.
- don't do the lockall operation on the tdb during a ldb search if in
  a transaction, as this would prevent modifies by callbacks as well
2007-12-21 05:43:15 +01:00
Stefan Metzmacher
8f2db3c130 r25215: replace talloc_append_string() with talloc_strdup_append_buffer()
metze
2007-10-10 15:06:55 -05:00
Andrew Bartlett
9cccd00dac r25204: Patch by Andrew Kroeger <andrew@sprocks.gotdns.com> fixing bug #4958 -
rename of ldb entries for a case change (only).

I've modified the testsuite to verify this.

Andrew Bartlett
2007-10-10 15:06:52 -05:00
Andrew Tridgell
40c0919aaa r23798: updated old Temple Place FSF addresses to new URL 2007-10-10 14:59:15 -05:00
Andrew Tridgell
84b468b2f8 r23795: more v2->v3 conversion 2007-10-10 14:59:14 -05:00
Andrew Bartlett
3f3da9c471 r23762: Fix DN renames over LDAP, and instrument the partition module. Add a
test to prove the behaviour of LDAP renames etc.

Fix LDB to return correct error code when failing to rename one DN
onto another.

Andrew Bartlett
2007-10-10 14:59:11 -05:00
Andrew Bartlett
10277f2724 r23737: Validate that we object to duplicate values in an add or replace.
We can't ever allow duplicates, even if the client sends them

Andrew Bartlett
2007-10-10 14:59:09 -05:00
Andrew Tridgell
0c3442c68b r23364: add LDB_FLG_NOMMAP flag 2007-10-10 14:53:12 -05:00
Jelmer Vernooij
1093875d59 r22681: Fix standalone ldb build when parent directory name != ldb. 2007-10-10 14:52:00 -05:00
Simo Sorce
50534c84b4 r22471: Convert more code to use proper LDB error codes.
This is a 1 to 1 convertion, next step is to make this
code report an error if the basedn is not used, hopefully
avoiding an  explicit search on the base object in the most
common cases.
2007-10-10 14:51:30 -05:00
Stefan Metzmacher
21fddb643b r20865: remove useless warning, we now always pass the current partition
control as non critical control

metze
2007-10-10 14:43:41 -05:00
Stefan Metzmacher
b97b8f5dcb r20184: change ldb_attrib_handler into ldb_schema_attribute, which has a pointer
to a ldb_schema_syntax struct.

the default attribute handler is now registered dynamicly as "*"
attribute, instead of having its own code path.

ldb_schema_attribute's can be added to the ldb_schema given a
ldb_schema_syntax struct or the syntax name

we may also need to introduce a ldb_schema_matching_rule,
and add a pointer to a default ldb_schema_matching_rule
in the ldb_schema_syntax.

metze
2007-10-10 14:29:19 -05:00
Simo Sorce
ea111795f4 r20106: Optional ONE Level indexing for ldb_tdb
To activate it you must modify the @INDEXLIST object adding
the attribute @IDXONE: 1

Ldb test included

Simo.
2007-10-10 14:29:07 -05:00
Simo Sorce
8bbbfa3467 r19911: talloc_apsrintf is not really required here
its faster this way (another 2-4%s)
2007-10-10 14:28:36 -05:00
Simo Sorce
3929c086d5 r19832: better prototypes for the linearization functions:
- ldb_dn_get_linearized
  returns a const string

- ldb_dn_alloc_linearized
  allocs astring with the linearized dn
2007-10-10 14:28:22 -05:00
Simo Sorce
a580c871d3 r19831: Big ldb_dn optimization and interfaces enhancement patch
This patch changes a lot of the code in ldb_dn.c, and also
removes and add a number of manipulation functions around.

The aim is to avoid validating a dn if not necessary as the
validation code is necessarily slow. This is mainly to speed up
internal operations where input is not user generated and so we
can assume the DNs need no validation. The code is designed to
keep the data as a string if possible.

The code is not yet 100% perfect, but pass all the tests so far.
A memleak is certainly present, I'll work on that next.

Simo.
2007-10-10 14:28:22 -05:00
Andrew Tridgell
1347ad254e r19402: - use the new tdb_lockall_read() to make ldb_search() more efficient,
by avoiding chain locks on each tdb_fetch() within the search

- use the tdb_get_seqnum() call to avoid re-reading the @BASEINFO
  record when it hasn't changed.

These speed up the LOCAL-DBSPEED test for ldb from 7k ops/sec to a bit
over 11k ops/sec
2007-10-10 14:21:26 -05:00
Andrew Tridgell
3bf76db42d r19362: - don't need to store the baseinfo message after cache load
- set better names on talloc structures in ldb modules, making leaks
  easier to track down
2007-10-10 14:21:17 -05:00
Simo Sorce
326389afed r19338: leak on error 2007-10-10 14:21:12 -05:00
Simo Sorce
49fc640b5c r19314: Commit tridge's fixes for a big mem leak in ltdb I introduced
when the code has been changed to be async.
With the other committed fixes now this works.
2007-10-10 14:21:07 -05:00
Stefan Metzmacher
67a6a41ba3 r19196: merge from samba3:
pass always a mem_ctx to functions and a ldb_context where needed

metze
2007-10-10 14:20:52 -05:00
Volker Lendecke
e946717bf6 r19134: Merge the second set of C++ warning fixes from Samba3. I'll leave r19132 to
metze to merge until the questions have been answered.

Volker
2007-10-10 14:20:38 -05:00
Andrew Tridgell
7e2ec87590 r18942: add a ldb_set_create_perms() function in ldb. I didn't call it
ldb_set_umask() (which is what we had discussed) as it doesn't
actually set the umask (in effect it sets the inverse of the umask -
the perms to be used for the file)
2007-10-10 14:20:22 -05:00
Andrew Tridgell
1a42f38dfd r18939: don't rely on the umask being right in ldb creation. Both Samba3 and
Samba4 smbd force the umask to 0, which meant we ended up with ldb
being world writable.

This isn't really an ideal fix, as it means ldb no longer honors umask
(as it should do, like all good libraries).

Unfortunately the 'proper' fix is too complex for now

this also merges a tiny code style fix from s4 to s3
2007-10-10 14:20:22 -05:00
Andrew Bartlett
72858f8594 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
2007-10-10 14:19:11 -05:00
Stefan Metzmacher
f3dc51fef5 r17711: fix compiler warnings
metze
2007-10-10 14:16:29 -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
97c4d41a30 r17350: Avoid a couple of memleaks, unnecessary code and use a more linear style 2007-10-10 14:15:18 -05:00
Andrew Bartlett
26bc7dbed9 r17349: We can't just return sucess here, modules below us expect the async
reply rules to be followed.

Add code to do a fake async callback on the skipped records.

Andrew Bartlett
2007-10-10 14:15:17 -05:00
Andrew Bartlett
38bd4f6179 r17304: Improve ldb_tdb error strings a bit more.
Andrew Bartlett
2007-10-10 14:15:09 -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
dd6ca33422 r16932: Consistanly use the macro for these DNs and attributes.
Andrew Bartlett
2007-10-10 14:10:01 -05:00
Andrew Bartlett
58898092c1 r16774: This patch modifies the tdb API to allow the logging function to be used
as part of ldb.

This allows tdb failures to be passed all the way up to Samba's DEBUG
system, which allowed easier debugging.

Unfortunately I had to extend the tdb API, as the logging function
didn't have a context pointer.

I've worked over the 'debug levels' in TDB.  Most of them were 0,
which didn't seem right, as some were trace-like messages.  We didn't
see any of these previously, except when accessing TDB directly.

Andrew Bartlett
2007-10-10 14:09:45 -05:00
Andrew Bartlett
8912c4e057 r16087: Fix silly cut-and-paste typo that cost me much of my afternoon...
This only affects my new partitions module, which I will post soon,
but should be fixed anyway.

Andrew Bartlett
2007-10-10 14:08:58 -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
Stefan Metzmacher
941f93f93f r15981: we need to initialize 'ret' before 'goto failed'
metze
2007-10-10 14:08:46 -05:00
Stefan Metzmacher
53ec76d8d2 r15979: some farmating...
metze
2007-10-10 14:08:46 -05:00
Stefan Metzmacher
7b9d711920 r15978: - pass the error code back to the caller...
- we were giving OPERATIONS_ERROR in all cases:-(
- we now pass ALREADY_EXIST fine to the caller,
  and the code in libnet_site.c is happy again.
- this bug wasn't noticed for a long time because
  the ldb_ildap code always passed SUCCESS to it's caller

metze
2007-10-10 14:08:45 -05:00
Simo Sorce
bbda863f07 r15945: Check ltdb_modified results 2007-10-10 14:08:43 -05:00
Simo Sorce
51083de795 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).
2007-10-10 14:08:43 -05:00
Simo Sorce
7d65105e88 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.
2007-10-10 14:08:41 -05:00
Simo Sorce
6af1d738b9 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)
2007-10-10 14:08:39 -05:00
Jelmer Vernooij
f10fae23f0 r14592: Add support for loading shared modules to LDB. 2007-10-10 13:58:58 -05:00
Simo Sorce
09f6f552d7 r14161: return early if we know the job is already finished 2007-10-10 13:56:56 -05:00
Simo Sorce
ef1b3e6368 r13996: simplify ldb_async_wait() some more 2007-10-10 13:52:36 -05:00
Simo Sorce
3347322d13 r13992: change the way ldb_async_wait() works.
I think I should change the name of this function
to ldb_async_process(), any opinions ?
2007-10-10 13:52:34 -05:00
Jelmer Vernooij
fb2f70de4f r13839: Use registration mechanism for backends as well (in the same sense
my previous patch added it for modules). This is the next step towards
LDB backends and modules as run-time loadable .so files.
2007-10-10 13:52:14 -05:00