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

105 Commits

Author SHA1 Message Date
Jelmer Vernooij
1093875d59 r22681: Fix standalone ldb build when parent directory name != ldb. 2007-10-10 14:52:00 -05:00
Andrew Bartlett
c0fd6f6339 r22557: Simo has long bugged me that the paths in the sam.ldb partitions were
not relative to the location of the sam.ldb, but instead
lp_private_dir().

This fixes that issue.

Andrew Bartlett
2007-10-10 14:51:43 -05:00
Andrew Bartlett
a2848dbf1f r22474: If ldb does not return sucess, then the res variable may not be valid.
It *should* just be NULL from the initialisation above, but I've had
this not be the case...

Andrew Bartlett
2007-10-10 14:51:30 -05:00
Andrew Bartlett
3430d8c072 r21736: Fix the smbclient test to do something more interesting with the last
few authentication tests.  Now that the tests correctly 'fail', I was
able to fix the credentials subsystem to honour USER and PASSWD.

To get --machine-pass working, I needed ldb to always load it's static
modules, so I put this in ldb_connect().

Andrew Bartlett
2007-10-10 14:49:20 -05:00
Stefan Metzmacher
224a31cdbf r20761: let ldb modules call ldb_set_default_dns()
metze
2007-10-10 14:40:47 -05:00
Stefan Metzmacher
cfcd05adc0 r20583: implement the frontend calls for extended operations
metze
2007-10-10 14:37:08 -05:00
Stefan Metzmacher
aababcbb05 r20581: - the ldb modules have explicit hooks for extended operations
so call them
- reorder the request operations first all with explixit hooks

metze
2007-10-10 14:37:07 -05:00
Stefan Metzmacher
e28cb83904 r20317: store references to all important naming contexts.
add ldb_get_config_basedn(), ldb_get_schema_basedn()
and ldb_get_root_basedn()

metze
2007-10-10 14:29:38 -05:00
Stefan Metzmacher
5ac373c8b8 r20192: I assume a 'break' is the correct thing to do here,
simo,tridge: please check this.

found by the IBM checker

metze
2007-10-10 14:29:21 -05:00
Simo Sorce
fdd6ce6b7e r20033: Never commit before testing
Never commit before testing
Never commit before testing

:-)
2007-10-10 14:28:51 -05:00
Simo Sorce
2a2e181e4b r20032: Add ldb_search_exp_fmt()
This functions adds support of a memory context to hook the results to
and a printf style exp_fmt partameter to easily build expressions at once.
2007-10-10 14:28:50 -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
Stefan Metzmacher
47da62b15a r19720: - don't pass a pointer reference to ldb_search_default_callback()
as it's ugly when it free's the callers memory on failure!

- only steal the controls on a LDB_REPLY_EXTENDED, LDB_REPLY_DONE
  and ignore them on LDB_REPLY_ENTRY, LDB_REPLY_REFERRAL as we currently
  have not way to return them in a ldb_result (we should fix this!)

metze
2007-10-10 14:28:13 -05:00
Simo Sorce
ee86e88e4f r19453: Expose helper functions 2007-10-10 14:21:34 -05:00
Andrew Bartlett
512ef62f4a r19264: Clarify behaviour in ldb_search_callback() and provide more
information when modules fail to load.

Andrew Bartlett
2007-10-10 14:20:59 -05:00
Stefan Metzmacher
dc139d8715 r19188: merge from samba3:
fix compiler warnings

metze
2007-10-10 14:20:51 -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
Volker Lendecke
4ce447223c r18894: Merge const fixes from 3_0 2007-10-10 14:20:19 -05:00
Simo Sorce
a141ee9473 r18882: make style consistent 2007-10-10 14:20:18 -05:00
Andrew Tridgell
54b864b491 r18830: ensure backends aren't added twice (needed for samba3) 2007-10-10 14:19:15 -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
Simo Sorce
bcbe82873f r18777: add helper functions to create an ldb_request structure 2007-10-10 14:19:11 -05:00
Andrew Tridgell
254cbf09de r18439: 2nd try at a talloc_move() api. This type with the ** ptr interface
exposed.

Unfortunately this generates a large number of type punning
warnings. We'll have to find some magic to hide those.
2007-10-10 14:18:29 -05:00
Andrew Tridgell
b0de283882 r18438: I should have examined these uses of talloc_move() more
carefully. Most of them are OK, but a couple were not.
2007-10-10 14:18:29 -05:00
Andrew Tridgell
c0d9e7d473 r18436: converted ldb to use talloc_move() instead of talloc_steal() when
appropriate.

Note that I also removed the error checks that were being done on the
result of talloc_steal(). They are pointless as talloc_steal() doesn't
have any failure modes that wouldn't cause a segv anyway, and they
tend to clutter the code
2007-10-10 14:18:29 -05:00
Simo Sorce
30a26a501f r18272: Couldn't resist to change this.
What we want to do here is to just make sure res is freed.
Well let's just do so explicitly, the steal cofused me
initially while reading the code. This way it is clear
what we want to do.

Simo.
2007-10-10 14:17:59 -05:00
Andrew Bartlett
b4f234e507 r18245: Ensure we don't keep the rootdse record around (steal it onto the
correct memory context).

Andrew Bartlett
2007-10-10 14:17:54 -05:00
Simo Sorce
0caf6a44e0 r17830: Set the default_basedn (hey, it comes from the "default" naming contex :-)
once at connection time, after modules have been loaded.

Introduce a function to retrieve the value where needed.
2007-10-10 14:16:46 -05:00
Andrew Tridgell
946901e5dd r17828: set the auto_baseDN opaque even on failure to fetch rootDSE. That
ensures we never try twice
2007-10-10 14:16:46 -05:00
Andrew Tridgell
5d1b66b68f r17821: changed ldb_search() and the ldbsearch command line utility to
automatically work out the basedn when basedn==NULL. The basedn is
fetched from the rootDSE defaultNamingContext value (if there is one)

This means we don't have to have the defaultNamingContext logic in
lots of places. It makes a lot of sense to me to have basedn==NULL
mean "use the default, as given by the database"

Note that explicitly specifing a basedn of '' is not the same thing,
and will not trigger this code

The baseDN is cached in a ldb opaque, so we only have to fetch it once
2007-10-10 14:16:44 -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
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
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
0828739951 r16825: Make ldb_sainity_check() set an error string. This makes it much
easier to chase down what modules or application code gets wrong.

Ensure not to leave memory allocated on failure in ldb_search()

Andrew Bartlett
2007-10-10 14:09:47 -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
28883f7193 r16172: Translate the ldb error codes into appropriate messages for the
transaction cases.

Andrew Bartlett
2007-10-10 14:09:04 -05:00
Andrew Bartlett
9ede8edbaf r16085: Set the error string if we fail to find a valid op to execute. Helps
in chasing down bugs :-)

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
Simo Sorce
3511120602 r16071: tdb has nested transactions
change the code to exploit that in ldb

I still have to reintroduce transactions when you call ldb_request directly,
I have some plans I hop to be able to develop in the next weekend
2007-10-10 14:08:56 -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
Andrew Bartlett
b607acf6f0 r16007: If no error string was setup by the backend, ensure that we always get
at least a generic error, even when inside a transaction.

This helps debugging ldb/js interactions a lot...

Andrew Bartlett
2007-10-10 14:08:49 -05:00
Simo Sorce
55d97ef88f r15944: rename LDB_ASYNC_ADD -> LDB_ADD, LDB_ASYNC_MODIFY -> LDB_MODIFY, etc... 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
f0c1d08d50 r15932: Remove per request creds
They have never benn used and make little sense too imo
2007-10-10 14:08:41 -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
8b2a563e71 r15795: Try to use the async code by default
It passess all my tests, but I still need to work on a lot of stuff.
Shouldn't impact anybody else work, so I want to commit now and see what happens

Will work to remove the old code from modules and backends soon, and make some
more restyling in ldb internals.

So, if there is something you don't like in this desgin please speak now.

Simo.
2007-10-10 14:08:21 -05:00
Tim Potter
88e854929f r15388: Fix cut&paste typo. 2007-10-10 14:05:31 -05:00
Andrew Bartlett
a99bd2e033 r15176: Ensure we don't segfault when we try and delete @FOO records.
Don't try and steal the result of a search on failure, it has already
been talloc_free()'ed by the ildb code.

Andrew Bartlett
2007-10-10 14:04:12 -05:00
Tim Potter
456a1de2b9 r15113: Add a ldb_strerror() function. 2007-10-10 14:04:09 -05:00