1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-04 05:18:06 +03:00
Commit Graph

5037 Commits

Author SHA1 Message Date
Andrew Tridgell
5573d04941 s4-messaging: use auto-close on the socket 2010-03-05 11:54:36 +11:00
Matthias Dieter Wallnöfer
3d94b28441 s4:ldap.py - give the "primaryGroupToken" test a better name
It tests also some other constructed attributes in a basic way.
2010-03-04 18:16:24 +01:00
Matthias Dieter Wallnöfer
4546b6b7df s4:ldap.py - add test for "tokenGroups" 2010-03-04 18:16:24 +01:00
Nadezhda Ivanova
8cb416a0b5 Refactored ACL python tests
Made each type into a separate class to be easily run individually,
removed code duplication
2010-03-04 15:22:30 +02:00
Matthias Dieter Wallnöfer
8a8c2de29f s4:ldif_handlers - Use "unsigned int" for counting purposes
I changed "uint32_t" to "unsigned int" since the LDB specification prescrives
"unsigned (int)" for counter variables (number of attributes,
number of values...).
2010-03-04 10:38:31 +01:00
Kamen Mazdrashki
5338e42182 s4/ildap: fine tune ildb_callback()
Actually ildb_context pointer is not supposed to be
valid after calling ildb_request_done().
This is due to the fact that when calling ildb_request_done()
caller will (most probably) free any locally built
ldap_request objects - thus rendering ildb_context invalid.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-03-03 13:18:38 +11:00
Matthias Dieter Wallnöfer
e50c982679 LDB:NSS - make LDB "signed-safe" on counter variables
"i" needs to be unsigned on both places since it counts till a "count" variable
of a "struct ldb_result" object which itself is unsigned.

I see counting variables much better as "unsigned" since in most cases we don't
use negative values at all. We've only to be careful on binary searches and
downto counts regarding them.
2010-03-02 18:02:00 +01:00
Matthias Dieter Wallnöfer
c103fbc919 s4:LDB - cosmetic fix for a "for" loop 2010-03-01 16:48:03 +01:00
Stefan Metzmacher
b28afd2bcc s4:ldb_dn: fix an uninitialized variable (found by make valgrindtest)
metze
2010-02-26 23:26:35 +01:00
Stefan Metzmacher
47fafe801b s4:ldb_dn: remove dn->ext_linearized when ext_components is modified.
metze
2010-02-26 23:26:34 +01:00
Stefan Metzmacher
c7432e4950 s4:ldb_dn: reset dn->ext_comp_num in ldb_dn_explode()
metze
2010-02-26 23:26:33 +01:00
Andrew Bartlett
3c202519ec s4:ldb Fix segfault in ldbsearch store_referral callback
sctx->refs_store was not initialised, and that made talloc_realloc
grumpy once we started actually returning referrals regularly from
Samba4's partitions module (0be57c7478
by mdw).

We now just use talloc_zero() and forget about this manual
initialisation work.  Tracking down use of uninitialised variables
with valgrind was the grand idea when this started, but in practice we
just get segfaults in unusual places.

Andrew Bartlett
2010-02-25 12:56:19 +11:00
Simo Sorce
6c0cd488e5 ldb:web Fix typo 2010-02-22 18:48:36 -05:00
Matthias Dieter Wallnöfer
91bf841c2e s4:registry/regf.c - specify the context when freeing the "regf" variable
Otherwise we get a "talloc_free with references" warning.
2010-02-22 22:15:03 +01:00
Brad Hards
3eacc83b35 Spelling fixes for source4/lib/registry.
Signed-off-by: Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
2010-02-22 21:45:37 +01:00
Brad Hards
7def87cb17 Typo fix.
Signed-off-by: Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
2010-02-22 21:45:36 +01:00
Brad Hards
1683d090cc LDB related spelling fixes.
Signed-off-by: Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
2010-02-22 21:45:36 +01:00
Kamen Mazdrashki
8078614814 s4/ldap: Refactor the fix for ldap nested searches
Current implementation synchronizes processing for
all types of LDAP request, not only LDAP_Search ones.

Synchronization for ldap replies processing is done
locally in ldb_ildap module as this concerns only
ildb_callback() function.

Signed-off-by: Anatoliy Atanasov <anatoliy.atanasov@postpath.com>
2010-02-17 18:03:31 +02:00
Andrew Tridgell
3035c7c2ad s4-ldb: fixed permissions on urgent_replication.py 2010-02-15 21:57:08 +11:00
Andrew Tridgell
1ca2bd78b9 s4-test: minor fixes to urgent_replication.py
- fix usage name
- remove unnecessary python functions
- remote unused gc ldb
2010-02-15 21:57:08 +11:00
Fernando J V da Silva
f5de126b85 s4-drs: Test situations for Urgent Replication
Checks if the partition's uSNUrgent is updated or not, depending
on the class of the object which is created, modified or deleted.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-02-15 21:57:08 +11:00
Andrew Tridgell
282cc79454 s4-ldb: use TYPESAFE_QSORT() in the rest of the ldb code 2010-02-14 18:44:20 +11:00
Matthias Dieter Wallnöfer
3598409951 s4:popt_common.c - fix intendation 2010-02-13 19:19:02 +01:00
Andrew Tridgell
3ae75a4248 s4: use LDB_TYPESAFE_QSORT() instead of ldb_qsort() 2010-02-13 22:36:12 +11:00
Andrew Tridgell
46dfa9dfbd s4-ldb: added LDB_TYPESAFE_QSORT()
Like TYPESAFE_QSORT() but for the ldb_qsort() function
2010-02-13 22:36:12 +11:00
Andrew Tridgell
828b5cd451 s4-socket: use TYPESAFE_QSORT() in netif code 2010-02-13 22:36:12 +11:00
Matthias Dieter Wallnöfer
14c4c2c735 ldb_match - Ignore ":dn" part of extended matches for now
It's not fully clear what this ":dn" part means for us. What we know is that
older AD implementations (Windows Server 2000, 2003) need it to have extended
matches working in the expected way.

To be able to interoperate with s3's winbind and other tools I and gd decided
to transform this into a warning until we know what to do.

This should fix bug #6511.
2010-02-11 15:51:56 +01:00
Andrew Tridgell
9ba0d105cc s4-pyldb: null terminate string ldb message elements from python
We need to eventually get rid of ldb_msg_find_attr_as_string() (or add
a mem_ctx to it), but meanwhile we have too many places that break if
we don't add a nul to the end of ldb msg strings from python.
2010-02-12 01:08:11 +11:00
Andrew Tridgell
32809bd8c1 util: rewrite dlinklist.h so that DLIST_ADD_END() is O(1)
This changes the meaning of the ->prev pointer in our doubly linked
lists to point at the end of the list from the front of the list. That
allows us to implement DLIST_ADD_END() and related functions in O(1)
time, which can be a huge saving in many places in Samba.

This also means that the 'type' argument to various DLIST_*() macros
is no longer needed, but I have left it in for now to keep the
patchset small, which will make it easier to revert if any problems
are found. In the future we should remove the 'type' arguments.

(jra. Move the one use of DLIST_TAIL over to the new macros).
2010-02-10 15:53:58 -08:00
Andrew Tridgell
a5d2fb752c s4-ldb: update ldb_tdb to use new DLIST_ macros
(cherry picked from commit 6ede911654566a7e21ded70dacac68df3b6a1bca)
2010-02-10 15:36:20 -08:00
Jeremy Allison
32575ed70f Temporary changes to dlinklist to keep the implementation static whilst
uses of (list)->prev are moved over to DLIST_PREV. This will be replaced
when the final (new) version of the dlinklist.h header is added.

Jeremy.
2010-02-10 15:30:59 -08:00
Matthias Dieter Wallnöfer
e34637b2a6 s4:Remove "Py_RETURN_NONE" compatibility code
This was needed only by Python 2.3 which we no longer support.
2010-02-09 17:53:09 +01:00
Andrew Tridgell
5ab6a8d077 s4-registry: fixed byte order assumptions
the registry tests were broken on big-endian systems
2010-02-07 18:41:59 +11:00
Matt Kraai
d8071e7ed7 Change uint_t to unsigned int in source4
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2010-02-02 07:18:18 +01:00
Kamen Mazdrashki
93142e4a3a s4/ldif: Handle Schema:prefixMap blobs in W2K3 and W2K8
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2010-02-01 15:23:31 +01:00
Kamen Mazdrashki
83068b42ae s4/ldif: Better control on ldif_write_NDR() errors processing
Current implementation mask NDR_ errors implicitly.
Thus the caller has no opportunity handle such an error.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2010-02-01 15:23:31 +01:00
Simo Sorce
08a20006c8 s4:ldb quiet down rootdse control registration 2010-01-31 13:25:17 -05:00
Simo Sorce
772d808ac8 s4:ldb Fix check made conditional by mistake 2010-01-30 02:57:33 -05:00
Simo Sorce
df7be036d7 s4:ldb add support for permissive modify control 2010-01-30 01:04:12 -05:00
Kamen Mazdrashki
a4d0ed5a10 s4/ldap: Fix nested searches SEGFAULT bug
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2010-01-29 14:09:53 +01:00
Andrew Tridgell
2fdff7f596 s4-ldbtest: fixed python import 2010-01-28 18:45:04 +11:00
Eduardo Lima
882feb39a2 s4-drs: implementation of some delete test cases
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-01-28 18:45:03 +11:00
Jelmer Vernooij
f679def4f2 s4: Fix a few warnings. 2010-01-21 16:15:11 +13:00
Matthieu Patou
0cdc39e730 Add a comment to tdb_wrap to explain why it should be used instead of directly using tdb 2010-01-21 07:11:18 +13:00
Wilco Baan Hofman
8067bf629c Fix unintentional free of the last value when adding a new value to a key.
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
2010-01-20 09:59:18 +13:00
Jelmer Vernooij
aa1fce645a ldap: Fix test failure that seemed to go unreported previously. 2010-01-17 12:35:26 +13:00
Jelmer Vernooij
a18889fd77 ldap.py: Remove unused imports. 2010-01-17 12:26:53 +13:00
Jelmer Vernooij
28577aae92 Import testtools as well, required for subunit. 2010-01-16 19:53:49 +13:00
Andrew Tridgell
a56ede9027 s4-ldb: cope with bad ptr alignment in ldb_index.c
We can't assume that a rec_ptr will come back from a tdb traverse with
alignment sufficient for a pointer.
2010-01-16 09:34:27 +11:00
Stefan Metzmacher
7d41afece7 s4:ldb/tests: do a "schemaUpdateNow" after creating a new attribute in ldap_schema.py
It seems that windows doesn't need that.

And we should think about a check for reloading the schema
at the start of each "write" operation.

metze
2010-01-13 16:03:52 +01:00
Stefan Metzmacher
ca9bc96b96 s4:ldb_msg: first try to decode integers as signed and then fallback to unsigned
LDAP only knowns about signed integers, so let
ldb_msg_find_attr_as_uint() and ldb_msg_find_attr_as_uint64() cope
with it.

metze
2010-01-13 14:52:00 +01:00
Stefan Metzmacher
8d4b913ce2 s4:ldb: be more strict in parsing ldb time strings
metze
2010-01-13 14:51:59 +01:00
Andrew Tridgell
a3e089db19 s4-ldb: display security descriptors with correct SDL for known SIDs
This makes it much easier to compare SDs
2010-01-10 13:23:38 +11:00
Andrew Tridgell
651ddb720a s4-messaging: remove only usage of debug_ctx() 2010-01-09 10:15:13 +11:00
Andrew Tridgell
6a36799d30 s4-messaging: fixed a memory leak in messaging_path()
It is a bit convoluted to fix, as cluster_id_string() may return a
const string.
2010-01-09 10:15:12 +11:00
Andrew Tridgell
39a4e2a38d s4-ldb: validate the type of the ldb argument to ldb_dn_new()
It has been a common bug to get the first two arguments the wrong way
around
2010-01-09 10:15:12 +11:00
Andrew Tridgell
66f161dee1 s4-acl: fixed acl.py test to use correct ldif
same problem as sec_descriptor.py
2010-01-08 13:03:07 +11:00
Andrew Tridgell
81c0b01585 s4-secdesc: fixed the sec_descriptor.py test
The test was using a "changetype: add" to try and add a member to a
group, where it should use a "changetype: modify" with a "add: member"

Also fixed the recovery when the test fails part way through (delete
the test users at the start as well as the end)

Nadya, please check!
2010-01-08 13:03:07 +11:00
Andrew Tridgell
fdf12a607d s4-ldb: improve error handling in indexing code
When we get an indexing failure we want a clear error message
2010-01-08 13:03:03 +11:00
Andrew Tridgell
dcbba583d9 s4-event: added s4_event_context_set_default()
we're still not weaned off event_context_find()
2010-01-08 13:03:02 +11:00
Andrew Tridgell
805ab0ef15 s4-messaging: added a new msg type MSG_DREPL_ALLOCATE_RID
This will be used to ask the drepl task for a new RID pool

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-01-08 13:03:01 +11:00
Andrew Tridgell
bd6d0e9379 s4-ldb: added nice ldif display of 64 bit ranges for RIDs 2010-01-08 13:02:58 +11:00
Matthias Dieter Wallnöfer
bbf9885013 s4:ldap_schema.py - add an additional check for validity of "defaultObjectCategory" 2010-01-05 20:55:45 +01:00
Matthias Dieter Wallnöfer
d8ca002a8c s4:ldap_schema.py - Move generated attributes check
Make more clear that they're created before the "schemaUpdateNow".
2010-01-05 20:55:32 +01:00
Jeremy Allison
2a66db8f93 Fix the merged build. Probably not strictly correct but allows us to "make test".
Jeremy.
2010-01-04 13:27:48 -08:00
Jelmer Vernooij
a214ebc3d6 ldb: Fix the standalone ldb build. 2010-01-02 02:40:30 +01:00
Andrew Tridgell
00b39c70f5 s4-dsdb: switched to using RMD_FLAGS instead of DELETED in extended DNs
This allows for more flags in the future
2010-01-02 08:16:57 +11:00
Andrew Tridgell
335af02218 s4-ldb: fixed valgrind error: ares can be freed by callback 2010-01-02 08:16:56 +11:00
Andrew Tridgell
1c5a268f34 s4-ldaptest: need to use MessageElement for modify messages
Without MessageElement() the flags are not set, which is invalid
2010-01-02 08:16:56 +11:00
Andrew Tridgell
e410a91ff4 s4-ldb: show an error string, as well as error message
This makes it easier to track down error mismatches from the test
suite
2010-01-02 08:16:56 +11:00
Andrew Tridgell
98d94cca6f s4-ldbtest: fixed message element in modify
a flags value of zero is not valid
2010-01-02 08:16:55 +11:00
Andrew Tridgell
81e8a18181 s4-ldb: allow modules to override error return values
The samldb module overrides the error code for some returns when
handling primaryGroupID. We need to take the error from the async
callback to allow this to work reliably
2010-01-02 08:16:55 +11:00
Andrew Tridgell
302dcd0226 s4-ldbmodify: show the error code as well as error string 2010-01-02 08:16:55 +11:00
Andrew Tridgell
1ab5020ef2 s4-ldb: declate ldb_val_to_time() 2010-01-02 08:16:55 +11:00
Andrew Tridgell
53e86ac5b2 s4-ldb: use safe length limited conversions for int64 and time 2010-01-02 08:16:55 +11:00
Andrew Tridgell
708ad42b0b s4-dsdb: use safe length limiting in string->integer conversion
The ldap.py test suite could trigger a read past the end of the struct
ldb_val buffer
2010-01-02 08:16:55 +11:00
Andrew Tridgell
baae6ef9d2 s4-ldb: added ldb_val_to_time()
This is intended as a replacement for ldb_string_to_time() for ldb_val
inputs. This ensures it is length limited and includes additional
validity checks
2010-01-02 08:16:55 +11:00
Andrew Tridgell
36f8ece9de s4-ldb: show the error code as well as errstr
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-01-02 08:16:54 +11:00
Andrew Tridgell
e1ffcfc783 s4-ldb: added ldb_module_get_ops()
This is needed to support DSDB_FLAG_OWN_MODULE

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-01-02 08:16:51 +11:00
Andrew Tridgell
b34db0840d s4-ldb: use the RELAX control to disable single value checking on replace
When using w2k3 linked attributes we are allowed to have multiple
values on a single valued attribute. This happens when the other
values are deleted.

Setting the RELAX control tell the ldb-tdb backend to not check for
this on replace, which means the caller has to check for single valued
violations.
2010-01-02 08:16:51 +11:00
Andrew Tridgell
f1b6484232 s4-dsdb: split RMD_USN into RMD_LOCAL_USN and RMD_ORIGINATING_USN
We need a separate RMD_LOCAL_USN to allow us to tell what attributes
need to be sent in a getncchanges request. Thanks to Metze for
pointing this out.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-01-02 08:16:50 +11:00
Jelmer Vernooij
ea5af6e30c pyldb: Add dom_sid.split in favor of less powerful dom_sid_to_rid().
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2009-12-31 17:33:30 +11:00
Matthias Dieter Wallnöfer
1aed373b11 s4:lib/registry/util.c - Reintroduce "FIXME"s
Jelmer suggested to put them in again.
2009-12-30 12:39:55 +01:00
Stefan Metzmacher
d3ee0f021b s4:lib/socket: add socket_get_{remote|local}_addr() to get a tsocket_address instead of a socket_address
metze
2009-12-24 17:38:33 +01:00
Stefan Metzmacher
445baf53a9 s4:lib/socket: add helpers functions to convert between socket_address and tsocket_address
metze
2009-12-24 17:38:32 +01:00
Simo Sorce
7e8b042b07 s4:ldb Fix declaration in the middle of the code 2009-12-23 10:33:26 -05:00
Simo Sorce
4cc0bb7d04 s4: Fix the build 2009-12-23 10:28:44 -05:00
Matthieu Patou
8dc636ad67 s4: tests controls parsing and using for ldbadd/ldbedit/ldbmodify 2009-12-23 08:09:19 -05:00
Matthieu Patou
3bd4f6792c s4: make ldbadd/ldbmodify/ldbdelete really use the --controls switch 2009-12-23 08:09:19 -05:00
Andrew Bartlett
551ea65c96 Samba4 and LDB requires talloc 2.0.1
reported by ewoud@kohlvanwijngaarden.nl
2009-12-22 17:27:03 +11:00
Jelmer Vernooij
5b9e98a382 provision/pyldb: Avoid linking in static python ldb module. 2009-12-21 23:40:12 +01:00
Jelmer Vernooij
1d9a243d68 ldb_wrap: Fix compilation when using system ldb. 2009-12-21 23:40:12 +01:00
Kamen Mazdrashki
ee48f583b5 s4-tort: Tests for "msDS-IntId" attribute implemented
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2009-12-21 23:44:13 +11:00
Kamen Mazdrashki
c113be8526 s4-tort: Move Schema tests from ldap.py into separate module
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2009-12-21 23:44:05 +11:00
Nadezhda Ivanova
39616c0ea2 Added oid for AS_SYSTEM control, used to bypass access checks for system operations. 2009-12-18 15:40:11 +02:00
Andrew Tridgell
cb841c363a s4-ldb: fixed a valgrind error in ldbtest
we were using msg->dn after the ldb it contained had been freed

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2009-12-18 21:03:40 +11:00
Andrew Tridgell
b3c69e76ec s4-dsdb: declare ldb_dn_update_components() 2009-12-18 21:03:39 +11:00
Andrew Tridgell
82bf0d8bc6 s4-dsdb: added ldb_dn_update_components()
This is used to udpate just the DN components of a ldb_dn, leaving the
other extended fields alone. It is needed to prevent linked attribute
updates from removing other extended components.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2009-12-18 21:03:39 +11:00
Andrew Tridgell
f392ae5169 s4-ldb: display msDS-OptionalFeatureGUID as a GUID
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2009-12-18 21:03:39 +11:00
Andrew Tridgell
20869a0bf0 s4-ldb: canonicalise the message on ldb_add
This canonicalise avoids a problem with an add that has multiple
elements with the same el->name. That is allowed by MS servers, and by
ldb, but it breaks things like the tdb backend and the repl_meta_data
RPMD handling.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2009-12-18 21:03:39 +11:00
Brendan Powers
7cb858e151 s4-dsdb: Add a test for adding, deleting, and appending a posixAccount objectClass to a user
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2009-12-18 14:27:44 +11:00
Nadezhda Ivanova
c0883fb451 Fixed incorrect checking of PRINCIPAL_SELF permissions.
If an ace has the PRINCIPAL_SELF as trustee, this sid has to be replaced with
the onjectSid of the object being checked. PRINCIPAL_SELF is the way to grant rights
to an account over itself.
2009-12-17 17:25:11 +02:00
Andrew Tridgell
9955756314 s4-ldb: show the OID of any unhandled critical controls
It isn't very useful just saying that a control is not supported,
without saying which one is the problem

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2009-12-16 20:56:23 +11:00
Andrew Tridgell
f8320b3559 s4-ldb: fixed a transaction error on prepare_commit
when a prepare commit fails, we need to give a cancel to all modules,
not a commit!

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2009-12-16 20:56:23 +11:00
Andrew Tridgell
e14c72877f s4-ldb: added --show-deactivated-link command line option
this adds the SHOW_DEACTIVATED_LINK control
2009-12-16 20:56:23 +11:00
Nadezhda Ivanova
4330efe0f2 Removed ldb_modify_ctrl from ldb, implemented as a static in ldap_backend. 2009-12-15 20:29:20 +02:00
Brian Lu
f346079083 s4:tls: fix the build on Solaris
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2009-12-15 12:56:50 +01:00
Andrew Tridgell
e3c2309dcd s4-ldb: added new ldb_dn extended components for linked attributes
These will store linked attribute replication meta data
2009-12-14 22:29:57 +11:00
Andrew Tridgell
0d76df9953 s4-ldb: added a function to filter extended components of a ldb_dn
We need to be able to filter out components that should not be exposed
to users
2009-12-14 22:29:57 +11:00
Andrew Tridgell
725e25a206 s4-ldb: added a new "reveal" control
This control will allow inspection of internal ldb values, which would
normally be stripped before being presented to users. The first use
will be stripping linked attribute meta data extended components.
2009-12-14 22:29:57 +11:00
Andrew Tridgell
56b90acbf6 s4-ldb: sort the linearized extended DN by component name
This will make life easier when handling deleted linked attributes
2009-12-14 22:29:57 +11:00
Nadezhda Ivanova
56b754e09a Implementation of sDRightsEffective, allowedAttributesEffective and allowedChildClassesEffective.
Behavior as documented in WSPP and tested. Needs optimisation though.
2009-12-10 15:49:53 +02:00
Andrew Tridgell
c59372b0b8 s4-ldb: fixed 2 bugs in ldb_dn_set_extended_component()
The first bug was that setting a component twice could cause it to
appear twice in the DN.

The second bug was that using an existing ldb_val from a previous call
of ldb_dn_get_extended_component() as an argument to
ldb_dn_set_extended_component() would cause a valgrind error (as the
array the val pointed into will change).
2009-12-10 17:51:30 +11:00
Andrew Tridgell
215cc5a9ed s4-ldb: use GUID_to_ndr_blob() 2009-12-10 17:51:29 +11:00
Andrew Tridgell
2493776f59 s4-ldb: simplify ldif handlers using new GUID functions 2009-12-10 17:51:27 +11:00
Andrew Tridgell
4bb2958f16 s4-ldb: fixed nested searches inside ldb modules
We need to keep a search count in ltdb to allow for nesting
of searches inside a module

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2009-12-09 18:18:25 +11:00
Andrew Tridgell
e5a478d3a2 s4-ldb: added a missing ltdb_unlock_read() 2009-12-09 18:18:25 +11:00
Andrew Tridgell
ff984cdfac s4-ldb: fixed ldbdel with -r (recursive deletion)
We need to delete the deepest DNs first
2009-12-08 14:43:50 +11:00
Andrew Bartlett
b2d8e1118d s4:build Bump ldb and tdb required versions.
Hopefully this will ensure we don't get an older version from the system.
2009-12-08 14:07:45 +11:00
Andrew Bartlett
54ea4b17f0 s4:ldb Add a function to match a message against an objectClass
(as objectClass will always be a case insensitive ascii string, we can
make a much simpler match function here than for the general case).

Andrew Bartlett
2009-12-07 15:27:43 +11:00
Andrew Bartlett
b2db28b634 s4:ldap.py Improve testsuite for primaryGroupToken behaviour
This tries to show that the domain object should not have a
primaryGroupToken, for example.  (This passes against the old and new
code, as the failure case requires an object with an objectSid, and
exactly one group in it's subtree.  Sadly I don't know of a valid structure
that I can construct to test this).

Andrew Bartlett
2009-12-07 13:08:06 +11:00
Kamen Mazdrashki
9b265a68cc s4-ldif: Fix memory leek in ldb_ldif_write() 2009-12-05 16:57:40 -05:00
Andrew Tridgell
83c106e084 s4-ldb: the '1' form of extended_dn search is easier to read
The '1' form gives GUIDs and SIDs in the ascii form as normally used
for display.
2009-12-01 12:36:23 +11:00
Andrew Bartlett
f65360840a s4:ldap.py Add test of namingContext behaviour after tridge found a bug
Tridge found that the partitions.c module was being initialised twice,
and setting the partitions into the rootDSE twice.

Andrew Bartlett
2009-12-01 12:17:00 +11:00
Fernando J V da Silva
7399c04fd0 s4-drs: Test situations for runtime constructed parentGUID
Includes the following verifications for the constructed parentGUID:
- Checks if it returns nothing when there is no parent object
- Ensures that attributes mentioned after the parentGUID
are returned correctly (this avoid a bug pointed out by Tridge
during sync constructed parentGUID development)

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2009-11-30 21:17:28 +11:00
Crístian Deives
bed9efa6cd s4-ldb: changed ldb_msg_add_dn() to ldb_msg_add_linearized_dn()
this makes the usage clearer

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2009-11-30 20:22:13 +11:00
Andrew Tridgell
8331b4c4f8 s4-ldb: check for -ve value for page size
This comes from a tip from Howard Chu. Apparently some clients
will send a -ve page size value.
2009-11-30 18:15:31 +11:00
Matthias Dieter Wallnöfer
51bedf9395 lib/registry/util.c - Reorder the registry datatypes of the conversion functions
This is absolutely cosmetic and makes the code easier to comprehend.
2009-11-29 14:58:41 +01:00
Matthias Dieter Wallnöfer
df1d42fc1b Revert "s4:registry/util - Don't include the trailing '\0' in the internal data format but add it on the back-conversion to a string"
This reverts commit 7d400715e9.

"convert_string_talloc_convenience" does always add the NULL termination. Didn't
know that. Thanks Jelmer for pointing out!
2009-11-29 14:51:50 +01:00
Andrew Tridgell
8a34cf6f51 s4-ldb: make it much easier to use common ldb controls 2009-11-28 21:58:04 +11:00
Matthieu Patou
db41a0afc6 s4: fix SD update and password change in upgrade script
- reserve a new Samba OID for recalculate SD control
- fix the update SD function
- fix handling of kvno in the update_machine_account_password function
- fix handling of handles in RPC winreg server

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2009-11-28 09:56:06 +11:00
Matthias Dieter Wallnöfer
7d400715e9 s4:registry/util - Don't include the trailing '\0' in the internal data format but add it on the back-conversion to a string
As far as I know the registry library saves all data (including) strings without
the null termination. So do it also here in a similar way.
2009-11-27 21:17:59 +01:00
Andrew Tridgell
d5387edb88 s4-ldb: improve detection of whether the server has a GC port
We were trying to open $SERVER:3268 regardless, which could result in
creating a file called "localdc1:3268", which led to subsequent test
failures
2009-11-27 16:05:06 +11:00
Andrew Tridgell
7ea485a1d2 s4-ldb: better to test for valid arguments in ldb library than commandline
We were testing for valid DNs in ldbrename in the command line
tool. This hid a bug in the ldb library where we caught a bad DN in
the objectclass module rather than in the main ldb code. It is better
to do validation of the DNs passed on the command line in the library
code, as this gives us more consistent error handling between the
programming APIs for ldb and the command line.
2009-11-27 16:05:06 +11:00
Andrew Bartlett
2fd831407d s4:ldb Provide bindings for ldb_transaction_prepare_commit() 2009-11-27 16:05:04 +11:00
Matthias Dieter Wallnöfer
97553373d1 s4:ldap.py - add a test for the enhanced operational attributes check
(Deny creation of entries with operational attributes specified)
2009-11-26 11:21:02 +01:00
Matthias Dieter Wallnöfer
4825df8323 s4:ldap.py - fix the schema update test on Windows Server
Apparently Windows Server (2003) doesn't like the comma delimiter here. I got
always error 16 ("LDB_NO_SUCH_ATTRIBUTE"). With this change the test works
again.
2009-11-24 19:44:18 +01:00
Matthias Dieter Wallnöfer
9aeaf31cfe s4:ldap.py - activate test for operational attributes
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2009-11-24 10:41:36 +11:00
Andrew Bartlett
cec473e728 s4:ldap.py Add tests for subSchemaSubEntry 2009-11-24 10:39:10 +11:00
Matthias Dieter Wallnöfer
81c46686db s4:ldap.py - Add a check for the generated "schemaIDGUID"
I've forgotten to add this when checking in the reworked SAMLDB module
2009-11-23 16:21:10 +01:00
Nadezhda Ivanova
e00281d1f1 Implemented LDAP_SERVER_SD_FLAGS_OID on search requests. 2009-11-21 18:40:51 +02:00
Stefan Metzmacher
e53e23a7dd s4:lib/ldb: change version to 0.9.9 after some critical index fixes
metze
2009-11-20 13:49:15 +01:00
Nadezhda Ivanova
7c8b34657a Implementation of LDAP_SERVER_SD_FLAGS_OID on modify requests. 2009-11-20 13:25:13 +02:00
Nadezhda Ivanova
a760f169f4 Some changes to allow processing of ldap controls on modify requests.
ldap_backend used to filter out ldap controls on modify. Also, modified
python binding for ldap_modify to allow writing tests for such controls.
2009-11-20 13:22:38 +02:00
Andrew Tridgell
51a59e8f9e s4-ldb: added a warning about ldb_msg_add_dn
ldb_msg_add_dn does not copy the dn linearized string
2009-11-20 14:41:27 +11:00
Crístian Deives
1169dd3b50 added new function "ldb_msg_add_dn"
a helper function to a DN element to an ldb_msg using ldb_msg_add_string.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2009-11-20 14:39:01 +11:00
Matthias Dieter Wallnöfer
a2707a3248 ldb:ldb_tdb backend/indexes - Outside API
- The outside API contains "DN" string arguments: Bad. Since in this way we
  fully rely on the outside calls regarding the right DN format. Solution: Use
  always a "struct ldb_dn" entry. Since this one is interchangeable and we can
  handle it in our preferred way.
2009-11-20 12:30:44 +11:00
Matthias Dieter Wallnöfer
afb70f9176 ldb:ldb_tdb backend/indexes - DN comparison
- DN comparison: The function doesn't seem that efficient. I "upgraded" it a bit
  to be more powerful (added a second length check and do both before the string
  comparison)
2009-11-20 12:26:37 +11:00
Andrew Tridgell
47923ea507 s4-ldb: added a double-rename test
This tests the fix for double rename/add and indexing
2009-11-20 12:23:46 +11:00
Andrew Tridgell
c99b310063 s4-ldb: when -v is specified, show progress of ldbadd/ldbmodify
This is useful for speed tests with large numbers of records.
2009-11-20 11:34:39 +11:00
Andrew Tridgell
79a43fb743 s4-ldb: make ldb tools line buffered
this prevents output being buffered when redirected to a file. Useful
for larger ldb command line operations
2009-11-20 11:34:39 +11:00
Andrew Tridgell
3b96d08b29 s4-ldb: fixed an issue in rename/modify indexing
When we rename or modify a record, we need to update the indexes at
the same time. It is important that we use the DN of the actual
message that is stored in the database to do this, not the DN that was
passed in by the user. If the two differ in case then the index
records needs to use the 'real' record DN, as index handling is
currently case sensitive.
2009-11-20 11:34:39 +11:00
Andrew Tridgell
2e46df492c s4-ldb: allow ldap.py test suite to run directly against a file
This makes it much easier to debug (as you can break in the ldb
modules by running gdb on /usr/bin/python)
2009-11-20 11:34:38 +11:00
Nadezhda Ivanova
6178c17e09 Added control copying for message types other than ldb_search.
When ildap created a new message to forward, it only copied controls for ldb_search
requests. This caused controls for add and modify to be lost in transition
and tests for them could not be implemented.
2009-11-18 18:47:29 +02:00
Endi S. Dewata
8e5f5e3f05 s4:provision - Removed dependency on full Samba 3 schema from FDS 2009-11-16 07:57:40 +11:00
Wilco Baan Hofman
df3451aec0 Fix writing corrupt registries because of hardcoded version string in IDL.
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
2009-11-15 19:26:51 +01:00
Wilco Baan Hofman
5a7d48f82b Fix writing corrupt REG_SZ to the registry.
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
2009-11-15 19:26:50 +01:00
Wilco Baan Hofman
45bb24e939 Fix trailing garbage in the hbin block.
This specifically fixes a problem showing extra bytes of garbage in list and
print in regshell, even though the vk.data_length has the correct size.

Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
2009-11-15 19:26:50 +01:00
Zahari Zahariev
1e984e6630 Added tests for descriptor inheritance on ldap modify.
Fixed some expected owners and groups.

Signed-off-by: Nadezhda Ivanova <nadezhda.ivanova@postpath.com>
2009-11-15 19:26:02 +02:00
Matthias Dieter Wallnöfer
cc080742bd ldb:python bindings - add a context on "py_ldb_delete"
So the converted DN will be freed after usage.
2009-11-15 14:26:41 +01:00
Matthias Dieter Wallnöfer
6cf43db7fc s4:ldap.py - enhance schema addition test
Don't add only a new objectclass but also a new attribute. Plus let now the
server itself calculate the "lDAPDisplayName" attribute and compare the result.
2009-11-15 14:26:41 +01:00
Matthias Dieter Wallnöfer
8e320aea71 s4:ldap.py - Deactivates some at the moment pointless test parts
I think those parts should be deactivated since they're result set checks for
lookups which are commented out already.
2009-11-15 10:38:30 +01:00
Andrew Tridgell
dbae29de1c s4-ldb: make DN escaping/unescaping consistent
The DN escape function was using the form \c where c is any
character. The unescape function was using \XX where XX is a 2 digit
hex number. The asymmetry led to quite a few problems when we start to
deal with DNs containing escape chars, such as CN=foo\0ADEL:XXX. The
result was a DN that was not accessible.

This patch changes the escaping to follow RFC2253 much more
closely. We accept either type of escape, and produce the two types of
escape, depending on the character being escaped
2009-11-13 19:32:46 +11:00
Andrew Bartlett
ae72153daa s4:ldb Allow ldb_msg_canonicalize to handle empty elements
(These are deliberately there in DRS replication).

Andrew Bartlett
2009-11-12 16:34:15 +11:00
Andrew Bartlett
5940ca60e2 s4:ldb Don't segfault if we somehow get an unknown extended dn element 2009-11-12 16:34:14 +11:00
Andrew Bartlett
716bba5457 s4:ldb Change ldb_request_add_control to the normal 'for loop' pattern 2009-11-12 16:34:14 +11:00
Andrew Bartlett
d6d0c23d49 s4:ldb Add Well Known GUID (WKGUID) tests to ldap.py 2009-11-12 16:34:06 +11:00
Andrew Bartlett
f5890ddd83 s4:ldb Remove DN+Binary code from the core ldb_dn
This is now in dsdb_dn.  Removing this to a specific wrapper avoids a
number of bugs where Binary DNs were being handled incorrectly.

This reverts much of tridge's commit
fd22e03047

Andrew Bartlett
2009-11-12 16:34:05 +11:00
Andrew Bartlett
f0d43e9e56 s4:dsdb Use new dsdb_dn code in LDB modules and Samba4 schema
This converts the code from using the binary DN code in ldb_dn to
using a special Samba-specfic wrapper around ldb_dn.

We also use the dsdb_dn code for DN+Binary and DN+String comparisons
(changed from treating them as Binary blobs)

Andrew Bartlett
2009-11-12 16:34:04 +11:00
Andrew Bartlett
973197cd9d s4:ldb-samba Use new ldb_any_comparison helper function in ldb-samba 2009-11-12 16:34:04 +11:00
Andrew Bartlett
3abc3e7a3a s4:ldb Add a helper function for 'canonicalise' both strings base compares
This will help simplify boilerplate comparison functions where we
don't have a shortcut way to compare.

Andrew Bartlett
2009-11-12 16:34:02 +11:00
Andrew Bartlett
fd5174e88c lib/util Split data_blob_hex_string() into upper and lower
Rather than have a repeat of the bugs we found at the plugfest where
hexidecimal strings must be in upper or lower case in particular
places, ensure that each caller chooses which case they want.

This reverts most of the callers back to upper case, as things were
before tridge's patch.  The critical call in the extended DN code is
of course handled in lower case.

Andrew Bartlett
2009-11-12 16:34:01 +11:00
Nadezhda Ivanova
cee83ac34a Fixes for some tests not eorking against Windows or Samba. 2009-11-10 15:58:52 +02:00
Andrew Tridgell
932cda330a s4-samdb: remove the rDN size constraint of 64
This size constraint is not correct in it's current form, as windows
does send us rDN values for CN with lengths longer than 64. Once we
know how this constraint really works we can add it back in.
2009-11-09 22:19:52 +11:00
Matthias Dieter Wallnöfer
f6eacfcf1d s4:lib/messaging - fix up the python bindings
This fixes up the broken "send" method of the python bindings and corrects some
other parameter lists in parsing functions (this is only cosmetic). The reason
for the bug was a superfluous "|"!
2009-11-07 18:02:05 +01:00
Matthias Dieter Wallnöfer
843be3bcd9 ldb_init: use constant for result of "ldb_setup_wellknown_attributes" 2009-11-07 10:18:26 +01:00
Kamen Mazdrashki
716eb62b5d s4/ldb: Fix double allocation for "ldb_url"
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2009-11-06 14:05:36 +01:00
Zahari Zahariev
5fb9d06607 Python tests for the acl module.
Signed-off-by: Nadezhda Ivanova <nadezhda.ivanova@postpath.com>

Author:    Zahari Zahariev <zahari.zahariev@postpath.com>
2009-11-05 17:40:54 +02:00
Endi S. Dewata
bf01937549 s4:dsdb - Store SID as string in FDS. 2009-11-02 16:36:54 +11:00
Andrew Bartlett
f1f1bdada6 s4:ldb Remove debug traces duplicated by the new generic trace code 2009-11-02 16:36:51 +11:00
Matthias Dieter Wallnöfer
90862a55fd ldb:tdb backend - be also here more careful with the result value
"msg_delete_attribute" doesn't return an LDB result constant.
2009-10-27 19:42:12 +01:00
Matthias Dieter Wallnöfer
4c79fbfbe5 ldb:python bindings - make the intention by Jelmer ("int" vs. "enum") more clear 2009-10-27 19:11:15 +01:00
Matthias Dieter Wallnöfer
aa46400cb2 Revert "ldb python bindungs - better use the "enum ldb_scope" for the search scope rather than "int""
This reverts commit 4f8826ff7f.

Jelmer pointed out that the "enum"s don't work so well in combination with python.
2009-10-27 19:07:53 +01:00
Andrew Tridgell
798b05a974 s4-dsdb: call dsdb_make_schema_global() from ldb_wrap
Calling it from samdb_connect() can cause a stale schema to be put
into the global schema.

Thanks to Andrew Bartlett for spotting this.
2009-10-27 20:30:53 +11:00
Andrew Tridgell
6afac82e4b s4-ldb: '+' can also happen in base64 encoded index DNs 2009-10-27 11:44:05 +11:00
Andrew Bartlett
8ae0abc65f s4:ldb Add detail to failures in the indexing code 2009-10-27 11:32:21 +11:00
Andrew Bartlett
3c6c230b2d s4:ldb Add additional tracing of the ldb API
This helps pin down where errors occour, by printing a call stack and
setting error strings and trace messages in the transaction case.

Andrew Bartlett
2009-10-27 11:32:14 +11:00
Andrew Tridgell
98a3725252 Merge branch 'master' of ssh://git.samba.org/data/git/samba 2009-10-25 23:14:56 +11:00
Andrew Tridgell
12c9af7817 s4-ldb: allow for unescaped '=' in a index DN
The ldb_dn_explode code normally enforces all special characters,
including a '=', must be escaped. Unfortunately this conflicts with
the ltdb index DNs, which for binary attributes may be base64
encoded. This allows a unescaped '=' as a special case for index DNs.
2009-10-25 22:02:31 +11:00
Matthias Dieter Wallnöfer
1ea460b0b0 ldb:backend "connect" functions - convert result values to LDB constants
I think this is better since "ldb_backend_connect" and "ldb_connect" which
propagate those values should return only LDB constants. Therefore a conversion
(especially for "-1") would be needed.
2009-10-25 11:24:54 +01:00
Andrew Tridgell
b55a5adab9 s4-ldb: ensure DNs pass validity tests in indexing 2009-10-25 13:15:18 +11:00
Andrew Tridgell
2eca02a408 s4-ldb: fixed string length handling on index records 2009-10-25 13:15:18 +11:00
Andrew Tridgell
dffb572ce0 s4-ldb: don't allow modifies outside a transaction. 2009-10-25 13:15:18 +11:00
Andrew Tridgell
5002cddcb0 s4-ldb: fixed re-index during a complex transaction
We may have modified index objects in the in-memory index tdb
2009-10-25 13:15:18 +11:00
Matthias Dieter Wallnöfer
4f8826ff7f ldb python bindungs - better use the "enum ldb_scope" for the search scope rather than "int" 2009-10-23 14:26:41 +02:00
Andrew Tridgell
3050f83288 s4-python: we need to include Python.h first
If we don't include Python.h first then we get a pile of warnings due
to broken redefines of XOPEN_SOURCE in the Python includes.
2009-10-23 16:23:01 +11:00
Andrew Tridgell
890e7719cf s4-ldb: move the tdb_reopen_all() calls to ldb_wrap.c 2009-10-23 14:52:18 +11:00
Andrew Tridgell
906961cd8c s4-ldb: use ldb_wrap_fork_hook() to cancel child transactions 2009-10-23 14:52:18 +11:00
Andrew Tridgell
a32b338647 s4-ldb: added ldb_transaction_cancel_noerr()
This will be used to allow cancelling of transactions in a child after
a fork()
2009-10-23 14:52:18 +11:00
Andrew Tridgell
4ad0397d8a s4-ldbwrap: added re-use of ldb contexts in ldb_wrap_connect()
This allows us to reuse a ldb context if it is open twice, instead
of going through the expensive process of a full ldb open. We can
reuse it if all of the parameters are the same.

The change relies on callers using talloc_unlink() or free of a parent
to close a ldb context.
2009-10-23 14:52:17 +11:00
Andrew Tridgell
98e4393df9 s4-dsdb: create a static system_session context
This patch adds a system_session cache, preventing us from having to
recreate it on every ldb open, and allowing us to detect when the same
session is being used in ldb_wrap
2009-10-23 14:52:17 +11:00
Andrew Tridgell
a109ee71fb s4-ldb: added a TODO about checking the indexlist 2009-10-22 12:47:55 +11:00
Andrew Tridgell
f2988f5cad s4-ldb: fixed some memory leaks in new indexing code 2009-10-22 12:47:55 +11:00
Andrew Tridgell
0fb6e2a52c s4-ldb: don't try to index non-indexed attributes 2009-10-22 12:47:55 +11:00
Andrew Tridgell
1b48764f24 s4-ldb: ensure new dn_list elements are not owned by caller 2009-10-22 12:47:55 +11:00
Andrew Tridgell
129298c9b9 s4-ldb: over-allocate index records to save on realloc costs 2009-10-22 12:47:55 +11:00
Andrew Tridgell
d483c3bb96 s4-ldb: fixed tdb error handling in ldb_index.c 2009-10-22 12:47:55 +11:00
Andrew Tridgell
fcd16eab6c s4-ldb: delete empty index records 2009-10-22 12:47:54 +11:00
Andrew Tridgell
936c8f311a s4-ldb: do more validation of idxptr lists 2009-10-22 12:47:54 +11:00
Andrew Tridgell
74ae8b90ae s4-ldb: expose ltdb_err_map and ltdb_delete_noindex
These will be used by ldb_index.c
2009-10-22 12:47:54 +11:00
Andrew Tridgell
c4cb0c520c s4-ldb: fast path for equal pointers
We compare identical ldb_val values surprisingly often
2009-10-22 12:47:54 +11:00
Andrew Tridgell
5f3cbb5f0b s4-ldb: when taking a list intersection, the result can be as long as the first list
Intuitively you would think it couldn't be longer than the minimum of
the two lists, but we are deliberately allowing for duplicates at this
level of the indexing code, which means the result can be longer
2009-10-22 12:47:53 +11:00
Andrew Tridgell
859cf72692 s4-ldb: ldb indexing rewrite - part1
This gets rid of the @IDXPTR approach to in-transaction indexing,
instead using an in-memory tdb to hold index values during a
transaction. This also cleans up a lot of the internal indexing logic,
hopefully making it easier to understand.

One of the big changes is in memory management, with a lot more use
made of talloc tricks to avoid copying dn lists, and shortcuts used to
avoid high intersection and union calculation costs.

The overall result is that a re-provision on my laptop goes from 48s
to a bit over 10s.
2009-10-22 12:47:53 +11:00
Andrew Tridgell
c5de880c40 s4-ldb: ldb_oom() for modules 2009-10-22 12:47:53 +11:00
Matthias Dieter Wallnöfer
d120e7ebde s4:ldb_sort - Add some more "const"
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2009-10-22 10:02:43 +11:00
Torgeir Lerkerød
95ce7dff20 S4: ldb_map modules uses defines that are reserved
On OpenSolaris MAP_RENAME and friends are defined in <sys/mman.h> e.g. mmap and friends. So on these systems MAP_* have a meaning. Cleaned up LDB name space by adding LDB_ in front of MAP_* e.g. MAP_RENAME => LDB_MAP_RENAME

Signed-off-by: Torgeir Lerkerød <torgeir.lerkerod@gmail.com>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2009-10-21 15:46:38 +02:00
Andrew Tridgell
1467e5eaab s4-ldb: allow for non-null terminated ldb_val in ldb_dn_from_ldb_val
The strlen() could go past the end of a non-null terminated value
2009-10-21 22:43:58 +11:00
Andrew Bartlett
fa2e04b640 s4:ldb_map Fix use-after-free of memory in ldb_map
We need to keep the old 'ares' from the remote server around so we can forward
it back to the caller.  We can't send the same controls (from the last search
entry) twice (and it makes no sense anyway).

Andrew Bartlett
2009-10-21 22:43:57 +11:00
Andrew Bartlett
937140bf10 s4:ldb Put ltdb_private under the 'module'
This helps track the memory better, as we can then place it under the partition
hirarchy.

Andrew Bartlett
2009-10-21 22:43:56 +11:00
Andrew Bartlett
bd53628c7a s4:ldb Add new function to create a cut down list of controls
This I hope will be useful for removing controls from the ldb_reply

Andrew Bartlett
2009-10-21 22:43:56 +11:00
Andrew Bartlett
17237f18f0 s4:ldb Add function to add controls to an LDB reply 2009-10-21 22:43:53 +11:00
Andrew Tridgell
c45a81ecf3 s4-pyldb: fixed 64 bit issues
The python argument parse functions take standard C types, not enums
and time_t. This broken the python interface on PPC.
2009-10-19 21:36:41 +11:00
Matthias Dieter Wallnöfer
d673b49dfc s4:ldb_msg_check_string_attribute - add a comment about the result values 2009-10-18 18:16:31 +02:00
Matthias Dieter Wallnöfer
9d097fa0e0 Revert "s4:ldb_msg - Use LDB constants on results"
This reverts commit 56a8baff3d.
Simo pointed out that I was wrong here.
2009-10-18 18:15:55 +02:00
Matthias Dieter Wallnöfer
56a8baff3d s4:ldb_msg - Use LDB constants on results 2009-10-18 10:45:30 +02:00
Matthias Dieter Wallnöfer
a69f84fd2a s4:ldb_ldap - Fix intendation 2009-10-18 10:45:15 +02:00
Andrew Tridgell
81eb31f07b s4: spelling error 2009-10-18 15:56:16 +11:00
Endi S. Dewata
6cb652e05c s4:ldb - fixed dangling pointer in ldb_request_add_control() 2009-10-16 14:08:11 +02:00
Kamen Mazdrashki
40a8a22684 s4/drs: Propagate redefinition of drsuapi_DsReplicaOID into code base
The biggest change is that 'oid' field is transmited in binary format.
Also the field name is changed to 'binary_oid' so that
field format to be clear for callers.

After those changes, Samba4 should work the way it works before -
i.e. no added value here but we should not fail when
partial-oid is part of prefixMap transmited from Win server.

Also, thre is a bug in this patch - partial-binary-OIDs are
not handled correctly. Partial-binary-OIDs received during
replication will be encoded, but not handled correctly.
2009-10-16 12:54:14 +03:00
Andrew Tridgell
387e67d53f s4-ldaptest: "testgroup" is a bit too common
This failed on one of my test boxes that has a group called
"testgroup". using "testgroupXX" should be a bit better.
2009-10-15 20:02:59 +11:00
Andrew Tridgell
818d98acf1 s4-ldap: test the rDN size limit 2009-10-15 15:54:40 +11:00
Andrew Tridgell
4185e376f5 s4-ldb: removed bugus RDN length check
This isn't the rDN !
2009-10-15 10:01:10 +11:00
Andrew Tridgell
41ba2f8189 ldb: fixed display of replUpToDateVector 2009-10-15 08:20:37 +11:00
Matthias Dieter Wallnöfer
e9686985cb s4: Changes the old occurences of "lp_realm" in "lp_dnsdomain" where needed
For KERBEROS applications the realm should be upcase (function "lp_realm") but
for DNS ones it should be used lowcase (function "lp_dnsdomain"). This patch
implements the use of both in the right way.
2009-10-14 10:50:43 +02:00
Matthias Dieter Wallnöfer
a889303e3e s4:ldb_tdb - Revert some introduced "trivial gotos"
I hope that this makes abartlet & simo happy again (consider mailing list).
2009-10-12 23:43:20 +02:00
Matthias Dieter Wallnöfer
78ebc02146 Revert "s4:ldb - add a check which has to be done on beginning of a "modify" operation"
This reverts commit f9990e9b39.

abartlet claims that this behaviour is too AD specific to put here. Btw I had
also some doubts if this is clean enough. I put it only here to make "ldap.py"
pass.

I'll try to find a new solution soon.
2009-10-12 16:19:04 +02:00
Andrew Bartlett
a37efaf922 s4:ldb Allow a NULL module list 2009-10-12 23:33:22 +11:00
Andrew Bartlett
fa05abc8ff Allow (and ignore) distinguishedName on special records
They are not stored, so we can ignore them (makes copying records much
easier)

Andrew Bartlett
2009-10-12 16:51:27 +11:00
Andrew Bartlett
554791c49f s4:ldb Reload the 'ltdb_cache' when @OPTIONS changes
(Otherwise setting the check base on search option is not applied
until after a reload).

Andrew Bartlett
2009-10-12 16:51:03 +11:00
Andrew Bartlett
93ac2cdb54 s4:ldb Allow a module string of ""
(We may have no modules set)

Andrew Bartlett
2009-10-12 16:51:02 +11:00
Matthias Dieter Wallnöfer
91456b8dc5 s4:ldb - SQLite: port some constraints from the TDB backend also to the SQLITE one 2009-10-08 00:18:07 +02:00
Matthias Dieter Wallnöfer
30faff7567 s4:ldap.py - Further enhancements
- Enhance test for "distinguishedName"
- Add a test for single-valued attributes
- Add a test for multi-valued attributes
- Add a test for empty messages
- Add a test for empty attributes
2009-10-08 00:18:07 +02:00
Matthias Dieter Wallnöfer
f9990e9b39 s4:ldb - add a check which has to be done on beginning of a "modify" operation 2009-10-08 00:18:06 +02:00
Matthias Dieter Wallnöfer
32a7b82e87 s4:ldb_tdb - Rework/Various
- Unify the error handling method with "done" mark in all longer functions
- Fix up result codes to match more the real MS AD
- Some cosmetic fixups
2009-10-08 00:18:06 +02:00
Matthias Dieter Wallnöfer
8536e1b947 s4:various LDB modules - "build_request" functions - propagate result codes back
It's very useful to know the exact result code when something fails and not
only a generic (by the module) created one.
Sure, there are some exception cases with specific results (special message
constellations, attributes, values...) which shouldn't be changed at all
(examples of them are in the "ldap.py" test). Therefore I looked very
carefully to not change them.
2009-10-06 19:41:16 +02:00
Andrew Tridgell
9c1e230bc2 s4-ldb: fixed error on single value error
When you try to add a 2nd value to a single valued attribute you get 
LDB_ERR_ATTRIBUTE_OR_VALUE_EXISTS. w2k8-r2 join to s4 relies on this
error, doing a replace after it sees the error
2009-10-06 18:57:06 +11:00
Matthias Dieter Wallnöfer
6a4efccb38 s4:ldap.py - commented out the UTF8 tests (and fixed some deletion DNs) 2009-10-03 16:54:19 +02:00
Matthias Dieter Wallnöfer
957cc4b8b6 s4:ldb_tdb - fix memory leaks 2009-10-03 15:49:40 +02:00
Matthias Dieter Wallnöfer
817208090d s4:ldb.h - add constant for LDAP EXOP password change
Also enhance some other comments.
2009-10-03 13:27:50 +02:00
Matthias Dieter Wallnöfer
be938ab44b s4:ldap.py - add tests for valid parent and RDN 2009-10-03 12:48:51 +02:00