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

151 Commits

Author SHA1 Message Date
Andrew Tridgell
19a22f78c2 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.
2007-10-10 13:10:57 -05:00
Simo Sorce
d58be9e74b 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
2007-10-10 13:10:55 -05:00
Andrew Tridgell
0f034dc563 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)
2007-10-10 13:09:48 -05:00
Andrew Tridgell
18fb48204f r5357: added ldb_msg_add_fmt(), for creating formatted ldb record values 2007-10-10 13:09:45 -05:00
Andrew Bartlett
34b1da7303 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
2007-10-10 13:09:43 -05:00
Andrew Tridgell
9db6c79e90 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.
2007-10-10 13:09:38 -05:00
Andrew Tridgell
6f79432fe6 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?
2007-10-10 13:09:38 -05:00
Andrew Tridgell
7be0bc93bd r5189: fixed a double free bug in the ltdb indexing code 2007-10-10 13:09:29 -05:00
Andrew Bartlett
ffad9b22be r5092: Add a bit more const - moving it further into the LDB layer.
Andrew Bartlett
2007-10-10 13:09:22 -05:00
Andrew Tridgell
e7262dccce r4863: schema_find_attribute() should be static 2007-10-10 13:09:01 -05:00
Simo Sorce
0315159daf r4862: - better structure schema tests
- fix check for deletion of required attributes on modify
  removed by mistake with the previous commits
2007-10-10 13:09:00 -05:00
Simo Sorce
c6257379e0 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
2007-10-10 13:09:00 -05:00
Simo Sorce
a30f647b8a 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.
2007-10-10 13:09:00 -05:00
Andrew Tridgell
b221c3dbb9 r4801: remove the two bogus ctype.h includes 2007-10-10 13:08:57 -05:00
Simo Sorce
e895fcf4a3 r4786: forgot to commit the exclusion for schema checking against our control entries 2007-10-10 13:08:55 -05:00
Simo Sorce
42a20f6fa4 r4784: finally make schema module use a single ldb
add the new test-schema test
2007-10-10 13:08:54 -05:00
Andrew Tridgell
6534ce650b 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.
2007-10-10 13:08:54 -05:00
Simo Sorce
18cd6cb674 r4775: use schema_attr_cmp wrapper to check for the special dn/distinguishedName case alias 2007-10-10 13:08:53 -05:00
Simo Sorce
8c11038d67 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
2007-10-10 13:08:51 -05:00
Andrew Tridgell
7893251456 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.
2007-10-10 13:08:49 -05:00
Simo Sorce
a681ae365f 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
2007-10-10 13:08:47 -05:00
Andrew Bartlett
d4da9fb160 r4678: Add some const to LDB.
Andrew Bartlett
2007-10-10 13:08:42 -05:00
Andrew Tridgell
e6c81d7c9f 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.
2007-10-10 13:08:20 -05:00
Simo Sorce
ea051f6cd3 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
2007-10-10 13:08:17 -05:00
Stefan Metzmacher
1c6accd7cb r4506: fix compiler warnings
metze
2007-10-10 13:08:16 -05:00
Simo Sorce
b8bb62f144 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.
2007-10-10 13:08:16 -05:00
Simo Sorce
d11732f4f7 r4503: add an error reporting function (fixes) 2007-10-10 13:08:16 -05:00
Simo Sorce
985a58a16d r4502: add an error reporting function 2007-10-10 13:08:15 -05:00
Andrew Tridgell
209ba7b889 r4493: change name of README.gcov so it doesn't get deleted by "make clean" :-) 2007-10-10 13:08:12 -05:00
Andrew Tridgell
1dfc41c9a3 r4488: removed an unused variable 2007-10-10 13:08:11 -05:00
Andrew Tridgell
1071712cf5 r4486: fixed some memory leaks in the new ldb code, by ensuring that memory is always
allocated as a child of the right context
2007-10-10 13:08:11 -05:00
Andrew Tridgell
4edbd1b18e r4477: expanded the test suite to increase code coverage a lot 2007-10-10 13:07:56 -05:00
Andrew Tridgell
5dc1995118 r4476: added a little gcov howto for ldb 2007-10-10 13:07:56 -05:00
Andrew Tridgell
0ab98f50a7 r4474: - converted ldb to use talloc internally
- added gcov flags to Makefile.ldb

- expanded ldb test suite to get more coverage
2007-10-10 13:07:55 -05:00
Andrew Tridgell
98b5f73c1b 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
2007-10-10 13:07:55 -05:00
Andrew Tridgell
09e98c8745 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.
2007-10-10 13:07:54 -05:00
Andrew Tridgell
f006e72440 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
2007-10-10 13:07:48 -05:00
Andrew Tridgell
937159cf2c r4424: fixed a simple bug in the '|' handling in indexed ldb searches. I'm
amazed we got along for so long with this bug!
2007-10-10 13:07:47 -05:00
Volker Lendecke
55c9fbd4f4 r4397: Fix a bug where '(&(objectclass=domain)(!(objectclass=builtindomain)))' fell
back to a full search.

Volker
2007-10-10 13:07:42 -05:00
Volker Lendecke
284044b5b2 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
2007-10-10 13:07:38 -05:00
Andrew Tridgell
58fcc32624 r4282: removed a spurious error message now we remove index entries in the modify call 2007-10-10 13:07:31 -05:00
Andrew Tridgell
9c668e7b43 r4281: fixed an ldb indexing bug in ldb found by volker.
index entries were not always being removed on modify
2007-10-10 13:07:31 -05:00
Andrew Tridgell
29225d0bec 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
2007-10-10 13:06:22 -05:00
Andrew Tridgell
ee52c1e38c r4059: moved the ldb -o option parsing to a common routine 2007-10-10 13:06:20 -05:00
Stefan Metzmacher
a8a3b8ee34 r4040: sorry today is not my day...
uint32 != uint8_t ...

metze
2007-10-10 13:06:17 -05:00
Andrew Tridgell
07378fca6c r4039: added a test for an element > 128 bytes in length, to ensure we test
for sign extending errors in element length
2007-10-10 13:06:17 -05:00
Stefan Metzmacher
6998c37b47 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
2007-10-10 13:06:16 -05:00
Stefan Metzmacher
79d0eb2f67 r4022: fix compiler warnings
metze
2007-10-10 13:06:15 -05:00
Andrew Tridgell
b4fd76f78e r4010: fixed parsing of null attributes in the ldb ldif parser 2007-10-10 13:06:13 -05:00
Stefan Metzmacher
a9cbaa3cff r3926: fix compiler warnings
metze
2007-10-10 13:06:06 -05:00