1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-15 23:24:37 +03:00

211 Commits

Author SHA1 Message Date
Simo Sorce
9ec83ae25d 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.
(This used to be commit 50534c84b4577b2d32565a74a4716088f706bfea)
2007-10-10 14:51:30 -05:00
Stefan Metzmacher
f14c66ca30 r21311: fix very ugly "using free'ed memory" bug
This was there since 2005...

metze
(This used to be commit 393e4eeb82df8017eb0afb526f4d723cf8814311)
2007-10-10 14:48:08 -05:00
Stefan Metzmacher
97666f12a4 r20969: remove unused function, found my lcov
metze
(This used to be commit 0c5eb19ebc12bc954c23e9f561d5f96644a19aca)
2007-10-10 14:44:05 -05:00
Stefan Metzmacher
545f97f94e r20865: remove useless warning, we now always pass the current partition
control as non critical control

metze
(This used to be commit 21fddb643bf05ca2b7c60a4695e1fff0f29ec6d1)
2007-10-10 14:43:41 -05:00
Stefan Metzmacher
930fca1c97 r20684: if we don't have any indexes, then we should not waste time
to traverse the whole tdb and unpack each record

metze
(This used to be commit 492c79de13eab8db6079f880a8f0857dc7a29fa8)
2007-10-10 14:40:22 -05:00
Andrew Tridgell
13b7d54535 r20234: metze pointed out that we are re-loading the cache records on each
write. We should only be doing this if another process writes and
changes the seqnum. This avoids the extra cache loads
(This used to be commit 65858ebb68c25a672e9284e8cba9a6675902f1df)
2007-10-10 14:29:27 -05:00
Stefan Metzmacher
c8c023ea62 r20191: fix bug found by the IBM checker
metze
(This used to be commit 4c1e4bfeef8d93583b6d4345dbb1b8fa90368308)
2007-10-10 14:29:20 -05:00
Stefan Metzmacher
c69717755a 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
(This used to be commit b97b8f5dcbce006f005e53ca79df3330e62f117b)
2007-10-10 14:29:19 -05:00
Stefan Metzmacher
e55ff42229 r20168: start separating attributes and syntaxes
metze
(This used to be commit 8dda4342f648aa71878ac9eeb7941710e2813aee)
2007-10-10 14:29:17 -05:00
Simo Sorce
2cd08c14a0 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.
(This used to be commit ea111795f4016916473ccc05d23c6655e6af1207)
2007-10-10 14:29:07 -05:00
Simo Sorce
784fd1a230 r20101: Also rename a variable now that the unused parameter is gone
(This used to be commit a2520bcfa918977f2139a963e9817370789cf077)
2007-10-10 14:29:06 -05:00
Simo Sorce
5dd224f260 r20100: Remove completely unused parameters
(This used to be commit cc1bcb814844e8a03dfa9a310d26ce3f3441e7bb)
2007-10-10 14:29:05 -05:00
Stefan Metzmacher
aee9e6c7cd r19965: make the output a bit nicer
metze
(This used to be commit 8655db41c1e776261ac61a975ca1883b7b59c6aa)
2007-10-10 14:28:41 -05:00
Stefan Metzmacher
6045b6f314 r19964: make debuging easier and report usefull error messages
metze
(This used to be commit f129d78256d965d52e80aedfa76c7c079e611c5f)
2007-10-10 14:28:40 -05:00
Simo Sorce
2ee7e831f2 r19911: talloc_apsrintf is not really required here
its faster this way (another 2-4%s)
(This used to be commit 8bbbfa3467c00543b0b330aec14e22b7e796fea7)
2007-10-10 14:28:36 -05:00
Simo Sorce
baa8ed2015 r19905: use ldb_dn_new_fmt() to avoid double strdups
(This used to be commit 32a6b6c75b041bf829ecf272a9b10164f7ffe12b)
2007-10-10 14:28:34 -05:00
Stefan Metzmacher
2ad51046e3 r19884: rename ldb_dn_key -> ltdb_index_key to make more clear what it's for...
metze
(This used to be commit 6b76a7be4ac5443d68a1253dc9ec430dcdc327f1)
2007-10-10 14:28:31 -05:00
Simo Sorce
a9e31b33b5 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
(This used to be commit 3929c086d5d0b3f08b1c4f2f3f9602c3f4a9a4bd)
2007-10-10 14:28:22 -05:00
Simo Sorce
4889eb9f7a 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.
(This used to be commit a580c871d3784602a9cce32d33419e63c8236e63)
2007-10-10 14:28:22 -05:00
Simo Sorce
b7774527fa r19531: Make struct ldb_dn opaque and local to ldb_dn.c
(This used to be commit 889fb983ba1cf8a11424a8b3dc3a5ef76e780082)
2007-10-10 14:24:44 -05:00
Andrew Tridgell
4b9eee02c4 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
(This used to be commit 1347ad254eb8cd12ce22a5a2a37bec0a0ac8dbf1)
2007-10-10 14:21:26 -05:00
Andrew Tridgell
0cf42c464e r19365: fixed a memory leak in the ldb attribute handling
(This used to be commit d7e07685164141f8fb2c2a6258e1fcb46ff9d06c)
2007-10-10 14:21:17 -05:00
Andrew Tridgell
1865044d5c r19363: - don't need to store the baseinfo message after cache load
(This used to be commit 8c091bcdece5c17073838ad2367f3f4e22e97c31)
2007-10-10 14:21:17 -05:00
Andrew Tridgell
e36ea2e8eb 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
(This used to be commit 3bf76db42dc6dde5d71083216dba819869b31c75)
2007-10-10 14:21:17 -05:00
Simo Sorce
0f2347e417 r19338: leak on error
(This used to be commit 326389afed0521133ac07339bd5e2bfbf8d80d0a)
2007-10-10 14:21:12 -05:00
Andrew Tridgell
91c33d44b6 r19324: fixed a leak on deleting records when no index is in place
(This used to be commit 0824b3b8c1003064b0f2c5a3f084f3e711155e8c)
2007-10-10 14:21:09 -05:00
Andrew Tridgell
7f00bee3dc r19322: fix a minor memory leak in the ltdb cache code
(This used to be commit e03ed5822a690e2d151107f2edb9b4f1d3a1e1b9)
2007-10-10 14:21:08 -05:00
Simo Sorce
1b8e6fa6e9 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.
(This used to be commit 49fc640b5c0398516ac3a9e3f7c55205cd60b1de)
2007-10-10 14:21:07 -05:00
Stefan Metzmacher
bbc056e067 r19196: merge from samba3:
pass always a mem_ctx to functions and a ldb_context where needed

metze
(This used to be commit 67a6a41ba3af840cd8226de73576a90ecf602caa)
2007-10-10 14:20:52 -05:00
Stefan Metzmacher
47f90dde40 r19146: merge from samba3:
talloc_reference() can fail

metze
(This used to be commit 542cd5d029e97c2e0c7c006a1ced12114c1bb6da)
2007-10-10 14:20:43 -05:00
Volker Lendecke
109bf77ea3 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
(This used to be commit e946717bf600f4ff922dc55a9a5d259535d0d1c9)
2007-10-10 14:20:38 -05:00
Andrew Tridgell
31e50ccae7 r19114: fixed another checker warning and a possible error on allocation
failure
(This used to be commit bc02f7ef96e164a59441e3fd9429221be83fc7e4)
2007-10-10 14:20:36 -05:00
Simo Sorce
118dae99de r19069: The sequence number is a 64 bit unsigned integer
Well spotted Volker
(This used to be commit f4239ef5983cfc06fd5cab42448564faed676944)
2007-10-10 14:20:33 -05:00
Andrew Tridgell
4c3b07b654 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)
(This used to be commit 7e2ec875908c112d5c3b0f6d18f9a8bbacf33539)
2007-10-10 14:20:22 -05:00
Andrew Tridgell
4e7c9367a7 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
(This used to be commit 1a42f38dfdc55d7429a1f8d3e811f3d857195a58)
2007-10-10 14:20:22 -05:00
Andrew Tridgell
45ca27699c r18834: get the log context code right
(This used to be commit b6bb5d7b772467042cee6ea372119781c42b91c1)
2007-10-10 14:19:16 -05:00
Andrew Tridgell
0b5e01c19b r18832: fixed standalone build
(This used to be commit 1ebc098b6776d38451e441280ac13664d64569f4)
2007-10-10 14:19:15 -05:00
Andrew Tridgell
58619eebc1 r18831: minor build changes for samba3. The logging changes will be removed
when the tdb api is updated
(This used to be commit 6ace943fac101839e35cbc83dc54fde2068f704b)
2007-10-10 14:19:15 -05:00
Andrew Bartlett
77db3973c4 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
(This used to be commit 72858f859483c0c532dddb2c146d6bd7b9be5072)
2007-10-10 14:19:11 -05:00
Andrew Tridgell
05cdd9ccaf 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.
(This used to be commit 254cbf09dee5a1e20c47e47a298f1a8d172b41b9)
2007-10-10 14:18:29 -05:00
Andrew Tridgell
7f63cebd33 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
(This used to be commit c0d9e7d473b8e3eb2524a9fc29cf88680f994b36)
2007-10-10 14:18:29 -05:00
Andrew Tridgell
66337169f1 r17771: add a comment explaing the odd cast
(This used to be commit 47e695ed88d364a7d423e804fe5340006ebf7c18)
2007-10-10 14:16:39 -05:00
Stefan Metzmacher
48c7cfcb74 r17756: I don't know why but this only works with the standalone
ldb build...I'll test more tomorrow.

metze
(This used to be commit aeee1b4655620154a8fefe471ac6327c5ccb8798)
2007-10-10 14:16:37 -05:00
Stefan Metzmacher
7852524532 r17748: make the casts much easier to understand
metze
(This used to be commit 5992f3b918967ff478ad24333cfe583e0b14a4c9)
2007-10-10 14:16:36 -05:00
Andrew Tridgell
309ef90690 r17738: solving the seemingly trivial problem of timegm() being missing on
some systems requires quite a large change in ldb. The core problem is
that ldb doesn't have its own equivalent of lib/replace/, so we have
no sane place to put things like timegm.c

This patch moves part of lib/replace/ from Samba4 into ldb, and the
next patch will remove those parts from Samba4. We will probably need
to similarly move parts of lib/replace/ into lib/talloc/ and lib/tdb/,
so that at each level the libraries have replacements for the
functions they need, but higher level libraries don't need to
re-include replacements if a lower level library already replaces the
function
(This used to be commit c2f6c217fb4a5c84499246480f00df40b0711074)
2007-10-10 14:16:34 -05:00
Andrew Tridgell
5b9633e40d r17724: don't rely on strnlen() as MacOSX 10.4 doesn't have it. Someday apple
will realise that buffer overflows are bad ....
(This used to be commit 0a6968b71b3cc492edfc3d46bd7e0c66c7ed8557)
2007-10-10 14:16:32 -05:00
Stefan Metzmacher
cc973cbd77 r17711: fix compiler warnings
metze
(This used to be commit f3dc51fef53287cc2e2af7ed4a9f3f52a5cd06ed)
2007-10-10 14:16:29 -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
eb16bc612a r17370: Fix tdb searches, we need to return an LDAP_REPLY_DONE packet when done.
Awesome how this didn't break everything around...
(This used to be commit 1b3b6176592314e91af9ed911e8a244519dea9aa)
2007-10-10 14:15:20 -05:00