1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-20 14:03:59 +03:00

153 Commits

Author SHA1 Message Date
Simo Sorce
0b4c61a05a r5670: simplify and clarify ldb_modules.c code
rectify the test schema
correct a glitch in schema module
(This used to be commit 0579b5f7adfe160be8ecf124934b6593a02ed06f)
2007-10-10 13:10:58 -05:00
Andrew Tridgell
2f9e1650f9 r5665: the data within el2->values can still be used at this point, so don't free
(This used to be commit 12d03f96637b9298e0cbc7ee544ca97fffcab9f8)
2007-10-10 13:10:57 -05:00
Andrew Tridgell
ec97506a51 r5664: simo, please look into this. It is possible for the number of elements
in msg[0] to be 0, in which case we crash. This is a workaround.

Also, if you could please split up this function into readable
pieces. It's a bit of a mess at the moment.
(This used to be commit 19a22f78c28a4b265f59df1b43c1bb6c9e58f736)
2007-10-10 13:10:57 -05:00
Simo Sorce
b1b14817ea r5585: LDB interfaces change:
changes:
- ldb_wrap disappears from code and become a private structure of db_wrap.c
  thanks to our move to talloc in ldb code, we do not need to expose it anymore

- removal of ldb_close() function form the code
  thanks to our move to talloc in ldb code, we do not need it anymore
  use talloc_free() to close and free an ldb database

- some minor updates to ldb modules code to cope with the change and fix some
  bugs I found out during the process
(This used to be commit d58be9e74b786a11a57e89df36081d55730dfe0a)
2007-10-10 13:10:55 -05:00
Andrew Tridgell
5a88d5211b r5374: - changed the dn key code in the ldb tdb backend to correctly honor
the case sensitive/insensitive flags on sections of a dn. So if a dn
  is made up of 4 attributes, and 2 of those are case insensitive and 2
  are case sensitive, then all the attribute names are uppercases, but
  only the values of the case insensitive attributes are uppercased when
  forming the tdb key.

- added code to canonicalise the dn, removing leading and trailing
  spaces from attribute names and values

- when the @ATTRIBUTES record changes, fix the dn keys of any records that should now have new
  dn keys due to changes in the case sensitivity of the record

I really did this to allow me to make the WINS database properly case
insensitive, but it is also the correct general fix for ldb, as it
matches the LDAP specification (and w2k LDAP server behaviour)
(This used to be commit 0f034dc5636d182a1d9207ad662b3fc8df7ca3e4)
2007-10-10 13:09:48 -05:00
Andrew Tridgell
ff4797a9e4 r5357: added ldb_msg_add_fmt(), for creating formatted ldb record values
(This used to be commit 18fb48204f4c0e22ea7e61575b3f174f30ff035c)
2007-10-10 13:09:45 -05:00
Andrew Bartlett
c8ca613e93 r5330: Remove #include <sys/time.h> from includes.h.
Add #include "system/time.h" back (it was removed in some of these
places because the definitions were provided by <sys/time.h> on tridge's
platform.)

Andrew Bartlett
(This used to be commit 34b1da730304bed7fee5bae7cbde7fbccecb6af5)
2007-10-10 13:09:43 -05:00
Andrew Tridgell
e82aad1ce3 r5298: - got rid of pstring.h from includes.h. This at least makes it a bit
less likely that anyone will use pstring for new code

 - got rid of winbind_client.h from includes.h. This one triggered a
   huge change, as winbind_client.h was including system/filesys.h and
   defining the old uint32 and uint16 types, as well as its own
   pstring and fstring.
(This used to be commit 9db6c79e902ec538108d6b7d3324039aabe1704f)
2007-10-10 13:09:38 -05:00
Andrew Tridgell
fedf0b0d91 r5296: - only include the tdb headers where they are needed
- removed the u32 hack in events.c as I think this was only needed as
  tdb.h defines u32. Metze, can you check that this hack is indeed no
  longer needed on your suse system?
(This used to be commit 6f79432fe656164d4770dbce114a30dda5e7bf9a)
2007-10-10 13:09:38 -05:00
Andrew Tridgell
df9d1a3709 r5189: fixed a double free bug in the ltdb indexing code
(This used to be commit 7be0bc93bd6757e52fd10bd3d3b3d1a8f5221452)
2007-10-10 13:09:29 -05:00
Andrew Bartlett
ea2209e3db r5092: Add a bit more const - moving it further into the LDB layer.
Andrew Bartlett
(This used to be commit ffad9b22be595279b247fa72d51145830fecbb06)
2007-10-10 13:09:22 -05:00
Andrew Tridgell
b808d49cd5 r4863: schema_find_attribute() should be static
(This used to be commit e7262dccce1ccc563fad48023c733c1d13929b4b)
2007-10-10 13:09:01 -05:00
Simo Sorce
bc2ae4e4cd r4862: - better structure schema tests
- fix check for deletion of required attributes on modify
  removed by mistake with the previous commits
(This used to be commit 0315159daf157b64ef3452372dd74199600e24b8)
2007-10-10 13:09:00 -05:00
Simo Sorce
23f92c1634 r4859: changed a numbe rof things:
- Try to no tcopy memory if not necessary
- let the searches hang around until we finish the operation
- greatly simplify the modify operation

still todo:

- check attributes syntax
- check objectclasses type, we cannot allow to add a new structural
  objectclass to an exixting entry unless the existing one is a parent
- more tests
(This used to be commit c6257379e094881987cd11e05502129b2ce1c5a0)
2007-10-10 13:09:00 -05:00
Simo Sorce
f19049c9c9 r4844: - Remove the unused attrsyn structure
- Change 0 to NULL when checking allocations
- Introduce the schema_attr_cmp hepler function
- Do not allow auxiliary classes to be missing
- Try to ease code readability and try to get
  main code out of loops when possibile.
(This used to be commit a30f647b8abe6b77ef73018f58af2f8a11689b91)
2007-10-10 13:09:00 -05:00
Andrew Tridgell
ec6f6aeda1 r4801: remove the two bogus ctype.h includes
(This used to be commit b221c3dbb9a7af88f917562b6f907fd0617eb05f)
2007-10-10 13:08:57 -05:00
Simo Sorce
9f3d734308 r4786: forgot to commit the exclusion for schema checking against our control entries
(This used to be commit e895fcf4a33aeaf228d8b4b367c4e768506275bb)
2007-10-10 13:08:55 -05:00
Simo Sorce
63f79d11b8 r4784: finally make schema module use a single ldb
add the new test-schema test
(This used to be commit 42a20f6fa4073fc5ea1ca6254137a4ef53caee01)
2007-10-10 13:08:54 -05:00
Andrew Tridgell
5dbebbe2ad r4781: the tolower() in schema.c is a premature optimisation. I suspect the
"distinguishedName" checking in that module is incorrect and should be
removed, but meanwhile, lets not make it slow down the compile of
every other module.
(This used to be commit 6534ce650bef7405e0926c9b75b185943429ed18)
2007-10-10 13:08:54 -05:00
Simo Sorce
1e233e9053 r4775: use schema_attr_cmp wrapper to check for the special dn/distinguishedName case alias
(This used to be commit 18cd6cb67404830b8a5d28fa4106dadb275a5222)
2007-10-10 13:08:53 -05:00
Simo Sorce
a7bbb190d9 r4759: use ldb_attr_cmp() to compare attribute names
check required attributes are not deleted on modify operation
if the objectclass is deleted then deny the operation if
orphan atributes are left behind
(This used to be commit 8c11038d67c495f8d5f06cf1fdfe976088864b45)
2007-10-10 13:08:51 -05:00
Andrew Tridgell
9f676afe3a r4744: until we decide what to do about attribute aliasing (see my recent
samba-technical posting), this is an interim solution that makes us
work pretty much like w2k3 does.
(This used to be commit 789325145651f2f6fc8716aa4bced83a2eb31994)
2007-10-10 13:08:49 -05:00
Simo Sorce
a2f77f979d r4714: move the ldb code to the new talloc interface (eg remove _p suffix)
this helps standalone building of ldb

renew the schema module
split code into functions to improve readability and code reuse

add and modify works correctly but we need a proper testsuite

Simo
(This used to be commit a681ae365ff1b5a2771b42ebd90336651ce1e513)
2007-10-10 13:08:47 -05:00
Andrew Bartlett
cec158231b r4678: Add some const to LDB.
Andrew Bartlett
(This used to be commit d4da9fb1600dba5daca9acb83f528c8f5f42f0ce)
2007-10-10 13:08:42 -05:00
Andrew Tridgell
cc55aef7c1 r4547: - added talloc_new(ctx) macro that is a neater form of the common talloc(ctx, 0) call.
- cleaned up some talloc usage in various files

I'd like to get to the point that we have no calls to talloc(), at
which point we will rename talloc_p() to talloc(), to encourage
everyone to use the typesafe functions.
(This used to be commit e6c81d7c9f8a6938947d3c1c8a971a0d6d50b67a)
2007-10-10 13:08:20 -05:00
Simo Sorce
8d8c21f8d0 r4513: add experimental modification attribute checking
still not complete but works with add and replace, not tested with delete
lot of duplicated code to remove
(This used to be commit ea051f6cd39d0e729bb425eb08034a0eee0996dc)
2007-10-10 13:08:17 -05:00
Stefan Metzmacher
bb71b37f70 r4506: fix compiler warnings
metze
(This used to be commit 1c6accd7cbf9ccb7f642b85200671b9d4fe23f47)
2007-10-10 13:08:16 -05:00
Simo Sorce
b92afa3838 r4505: Add a first very basic schema module
To use it you should provide a schema.ldb file where the schema is stored
and load the module in the ldb you want to have schema check activated

more info soon.

currently schema checks are performed only on new object creation not on modifications

Simo.
(This used to be commit b8bb62f14419efd434a344606fb3f753384761a0)
2007-10-10 13:08:16 -05:00
Simo Sorce
8164d24428 r4503: add an error reporting function (fixes)
(This used to be commit d11732f4f7f9bc535222aa7a6dd2f15cf5002a4d)
2007-10-10 13:08:16 -05:00
Simo Sorce
ab4e92ab21 r4502: add an error reporting function
(This used to be commit 985a58a16d04f3b92b4bbff86f6c466385f01321)
2007-10-10 13:08:15 -05:00
Andrew Tridgell
022bc635ef r4493: change name of README.gcov so it doesn't get deleted by "make clean" :-)
(This used to be commit 209ba7b889823f1badb0337412b2b9b34c5e23de)
2007-10-10 13:08:12 -05:00
Andrew Tridgell
7eeeb4a727 r4488: removed an unused variable
(This used to be commit 1dfc41c9a3b6418236a1f04b5cf3f9ef9e8b608e)
2007-10-10 13:08:11 -05:00
Andrew Tridgell
3e5235a568 r4486: fixed some memory leaks in the new ldb code, by ensuring that memory is always
allocated as a child of the right context
(This used to be commit 1071712cf5951fa2e94f314bd7678cfa51b2dbcd)
2007-10-10 13:08:11 -05:00
Andrew Tridgell
09a76e204c r4477: expanded the test suite to increase code coverage a lot
(This used to be commit 4edbd1b18ee38e584cf844b64c7fcb2645921837)
2007-10-10 13:07:56 -05:00
Andrew Tridgell
62ffbdb9f1 r4476: added a little gcov howto for ldb
(This used to be commit 5dc1995118c7d25adf89b6cc6156b1e6fc281e9b)
2007-10-10 13:07:56 -05:00
Andrew Tridgell
1a988ec9af r4474: - converted ldb to use talloc internally
- added gcov flags to Makefile.ldb

- expanded ldb test suite to get more coverage
(This used to be commit 0ab98f50a7e0fe15347a99e5c29a6590a87729a0)
2007-10-10 13:07:55 -05:00
Andrew Tridgell
65f96eba32 r4473: - moved talloc into its own lib/talloc/ area
- added gcov flags to Makefile.talloc

- expanded talloc testsuite to add a test for realloc with a child ptr

- fixed a bug in talloc_realloc() with realloc of a ptr that has child ptrs
(This used to be commit 98b5f73c1ba34d7576c5995069b485c1c5ede324)
2007-10-10 13:07:55 -05:00
Andrew Tridgell
f9e507980e r4466: rather than defining "STANDALONE" for building tdb, ldb and talloc
outside the tree, instead defined _SAMBA_BUILD_ inside the Samba
build. This makes it easier to pull code out of Samba for external
use.
(This used to be commit 09e98c8745cca7ccb1ad7134c0c09b8e4c0f4f06)
2007-10-10 13:07:54 -05:00
Andrew Tridgell
09c1b9cbe5 r4427: - added ldb_msg_*() functions for sorting, comparing and copying messages
- added a ldb_msg_canonicalize() function that fixes a record to not have any duplicate
  elements

- changed ldbedit to use ldb_msg_canonicalize(). This fixes a bug when you rename multiple
  elements in a record in one edit
(This used to be commit f006e724400843419c8b6155cbeae1876983855e)
2007-10-10 13:07:48 -05:00
Andrew Tridgell
c5fa6f7516 r4424: fixed a simple bug in the '|' handling in indexed ldb searches. I'm
amazed we got along for so long with this bug!
(This used to be commit 937159cf2c6ae08808bd10946fcdbd8741e1a560)
2007-10-10 13:07:47 -05:00
Volker Lendecke
91abe814d1 r4397: Fix a bug where '(&(objectclass=domain)(!(objectclass=builtindomain)))' fell
back to a full search.

Volker
(This used to be commit 55c9fbd4f4afdde30a0d92bfd31f5c9ebb98c59b)
2007-10-10 13:07:42 -05:00
Volker Lendecke
b29b10e48e r4366: Fix ldb_modify_internal: Adding values to an existing attribute you could end
up with a corrupt data structure on disk, namely with two attribute structures
for the same attribute name.

Volker
(This used to be commit 284044b5b20102894a8128f84ab41d59cfcc9285)
2007-10-10 13:07:38 -05:00
Andrew Tridgell
04e1d5f77c r4282: removed a spurious error message now we remove index entries in the modify call
(This used to be commit 58fcc326241e73cc8a122e6130b5ff0d6a3b9232)
2007-10-10 13:07:31 -05:00
Andrew Tridgell
cf4298874c r4281: fixed an ldb indexing bug in ldb found by volker.
index entries were not always being removed on modify
(This used to be commit 9c668e7b43dc2d82d3d639b64c53e887723ccba7)
2007-10-10 13:07:31 -05:00
Andrew Tridgell
a42dba94d0 r4071: - ldap does allow adding additional attribute values with a modify
operation, but not if the value already exists

- fixed syntax of test.ldif for ldap backend
(This used to be commit 29225d0bec39038e42e68849bd9378898f062081)
2007-10-10 13:06:22 -05:00
Andrew Tridgell
9012a50153 r4059: moved the ldb -o option parsing to a common routine
(This used to be commit ee52c1e38c9bac852458196ffbd677cca62a3965)
2007-10-10 13:06:20 -05:00
Stefan Metzmacher
785e7eb452 r4040: sorry today is not my day...
uint32 != uint8_t ...

metze
(This used to be commit a8a3b8ee341fda041383df225ea2b7f9b589fc04)
2007-10-10 13:06:17 -05:00
Andrew Tridgell
4754082fea r4039: added a test for an element > 128 bytes in length, to ensure we test
for sign extending errors in element length
(This used to be commit 07378fca6c12ffffcd3fe5e91f4d70ef838a45d5)
2007-10-10 13:06:17 -05:00
Stefan Metzmacher
7ea3540763 r4038: fix sign/unsign bug I introduced in -r 4022
this caused new ldb record to be corrupt if the length was > 12b byte

thanks tridge for finding this

metze
(This used to be commit 6998c37b473d8efeb2ed5285f10f469a29ad787a)
2007-10-10 13:06:16 -05:00
Stefan Metzmacher
b6c4b63dc5 r4022: fix compiler warnings
metze
(This used to be commit 79d0eb2f677f9e985ba476a9680f68537d41be6f)
2007-10-10 13:06:15 -05:00