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

5277 Commits

Author SHA1 Message Date
Andrew Tridgell
fd59a7c4af s4-ldb: fixed the ldb 'displayName=a,b' indexing bug
the problem was the inconsistency between the key form of DNs between
the itdb used for indexing and the on disk form

Thanks to Matthieu Patou for finding this bug!

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-08-17 08:44:28 +10:00
Andrew Tridgell
1cc471d69f s4-ldb: add some comments explaining the ltdb_index_idxptr() function
this function copes with alignment sensitive CPUs

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-08-17 08:44:28 +10:00
Andrew Tridgell
56db40d5fd s4-build: use @PACKAGE_VERSION@ in s4 pc.in files
this gets replaced by vnum from the build rule
2010-08-09 12:27:23 +10:00
Andrew Tridgell
febd35ecd2 s4-dns: fix dnsp for old build 2010-08-05 17:31:29 +10:00
Andrew Tridgell
1a701914fd s4-ldb: added ldif handler for the dnsRecord attribute 2010-08-05 17:31:29 +10:00
Kamen Mazdrashki
88f1798100 s4-ldb: use TALLOC_CTX type instead of 'void' 2010-07-29 00:53:49 +03:00
Kamen Mazdrashki
35b1e00ba3 s4: Remove trailing whitespaces
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-07-19 17:33:35 +10:00
Kamen Mazdrashki
11a44ce6f8 ldb: Mark _DEPRECATED_ ldb_msg_diff() and ldb_msg_canonicalize() functions
They are not quite safe to use (requires caller to steal
resulting message in own context) and may lead to holding
memory for too long.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-07-19 17:33:35 +10:00
Kamen Mazdrashki
31aeb841c9 s4-dsdb: use ldb_msg_normalize() in ldb_msg_difference()
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-07-19 17:33:35 +10:00
Kamen Mazdrashki
1e20dbd812 s4-test: Use ldb_msg_normalize() in sqlite3 backend
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-07-19 17:33:35 +10:00
Kamen Mazdrashki
d71b20e8dc s4-dsdb: use ldb_msg_normalize() in ldbadd-process_file()
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-07-19 17:33:35 +10:00
Kamen Mazdrashki
2ad701911e s4-dsdb: use ldb_msg_normalize() in source4/lib/ldb/common/ldb.c
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-07-19 17:33:34 +10:00
Kamen Mazdrashki
e5a9469a88 s4-ldb: Add ldb_msg_normalize() to accept a memory context from client
Previos implementation from ldb_msg_canonicalize()
was moved into this function and now ldb_msg_canonicalize()
is based on ldb_msg_normalize()

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-07-19 17:33:34 +10:00
Kamen Mazdrashki
48574ccc3f s4-ldb: Use _ldb_msg_add_el() in ldb_msg_add()
Previous implementation was 'leaking' attribute name
string, that is allocated by ldb_msg_add_empty()

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-07-19 17:33:34 +10:00
Kamen Mazdrashki
3944c81d08 s4-ldb: Use _ldb_msg_add_el() in ldb_msg_add_empty()
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-07-19 17:33:34 +10:00
Kamen Mazdrashki
8d523d46f5 s4-ldb: Add separate function to add empty element into ldb_msg
It just adds another element, nothing more.
Caller is responsible to fill-in the added element and
determine how to handle data allocation contexts.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-07-19 17:33:34 +10:00
Kamen Mazdrashki
a95fd4ef64 s4-ldb: Write more explanatory comment for ldb_msg_add()
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-07-19 17:33:34 +10:00
Kamen Mazdrashki
8deae13313 s4-pyldb: Use ldb_msg_difference() in py_ldb_msg_diff()
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-07-19 17:33:34 +10:00
Kamen Mazdrashki
fa0db46af1 s4-tools: use ldb_msg_difference() in ldbedit - modify_record()
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-07-19 17:33:33 +10:00
Kamen Mazdrashki
65b967a706 s4-ldb: Implement ldb_msg_difference() function to accept a memory context from client
Old implementation from ldb_msg_diff() was moved into
this this function but with changed interface
so that a memory context may be passed.

ldb_msg_diff() function is now based on ldb_msg_difference(),
which fixes a hidden leak - internal ldb_msg object
(returned from ldb_msg_canonicalize) wasn't freed
and stays attached to ldb_context for the connection lifetime.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-07-19 17:33:33 +10:00
Andrew Tridgell
6b266b85cf s4-loadparm: 2nd half of lp_ to lpcfg_ conversion
this converts all callers that use the Samba4 loadparm lp_ calling
convention to use the lpcfg_ prefix.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-07-16 18:24:27 +10:00
Andrew Bartlett
3e8dba1703 s4:pyldb whitespace fix 2010-07-15 22:08:22 +10:00
Andrew Bartlett
fcdf619b36 s4:pyldb Fix memory handling for ldb_message_element
The problem here is that we need to use the array, not the individual
message element as the memory context.

Andrew Bartlett
2010-07-15 22:08:22 +10:00
Matthieu Patou
b67a71f00b ldb: allow ldb_sequence_number to be called in python
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-07-15 22:08:20 +10:00
Matthias Dieter Wallnöfer
514c596561 ldb:common/ldb_dn.c - "ldb_dn_get_parent" - no need to manipulate the real DN
Since the parent DN is a duplication of the passed DN parameter.
2010-07-09 09:02:44 +02:00
Kamen Mazdrashki
6a0d3665e2 s4: fix warning: unused variable ‘i’ 2010-07-09 07:01:26 +03:00
Andrew Tridgell
fc68558ab9 s4-ldb: added ldb_error() and ldb_operr()
These will be used to help avoid the problem we have with hundreds of
places that do "return LDB_ERR_OPERATIONS_ERROR" without an
explanation. It is very difficult to track down ldb errors which don't
have any explanation.

By replacing "return LDB_ERR_OPERATIONS_ERROR;" with "return ldb_operr(ldb);"
we at least get a file:line message in the ldb error string. It isn't
an ideal error message, but it is much better than just "operations
error"

This change also makes ldb_oom() return the error code
(LDB_ERR_OPERATIONS_ERROR) so you can do:

  return ldb_oom(ldb);

instead of:

  ldb_oom(ldb);
  return LDB_ERR_OPERATIONS_ERROR;
2010-07-07 20:14:55 +10:00
Andrew Tridgell
9c3a9824a9 s4-ldb: added support for simple binds on ldb_ldap backend
this uses the options[] array to pass in bindMech, bindID and
bindSecret. Currently only "simple" is supported.
2010-07-07 17:26:03 +10:00
Andrew Tridgell
7f9153f7e8 s4-ldb: added ldb_options_find()
ldb_options_find() allows backends to find options in the options[]
array passed to the connect operation.

This will be used by the ldb_ldap bind code
2010-07-07 17:26:03 +10:00
Andrew Tridgell
84c5dd1e4b s4-ldb: fixed error handling in openldap backend
fixed several bugs in error handling. the ldb context was used without
being initialised in the error paths, and several error paths did not
set an ldb error string.
2010-07-02 12:49:04 +10:00
Andrew Tridgell
277a9b4aac s4-ldb: fixed the parsing of references in the openldap backend
We need to use ldap_parse_reference() not ldap_parse_result()
2010-07-02 12:49:04 +10:00
Matthias Dieter Wallnöfer
21c2155126 s4:lib/registry/ldb.c - free some "msg" objects earlier through explicit "talloc_free"s
No other functional change
2010-07-01 16:35:12 +02:00
Matthias Dieter Wallnöfer
de8a339cdf s4:registry - move some common constraint checks to the "local" backend
They should also be enforced when we don't use "ldb".
2010-07-01 15:48:06 +02:00
Matthias Dieter Wallnöfer
d81e2af69d s4:lib/registry/tests/registry.c - test recursive key generation 2010-07-01 15:48:05 +02:00
Matthias Dieter Wallnöfer
ae50385d52 s4:registry - on key add operations we have to handle with paths not always only a name
Recursive key generations are allowed.
2010-07-01 15:48:05 +02:00
Matthias Dieter Wallnöfer
781ea5be13 s4:lib/registry/local.c - support recursive key generation
Code taken from "local_open_key".
2010-07-01 15:48:05 +02:00
Matthias Dieter Wallnöfer
809c747900 s4:lib/registry/ldb.c - refactor "reg_path_to_ldb"
This makes it easier to understand and would also support splitting in more
DN components.
2010-07-01 15:48:04 +02:00
Matthias Dieter Wallnöfer
50ae292e60 s4:lib/registry/ldb.c - use "ldb_path" rather than "ldap_path" as LDB key varibale identifiers 2010-07-01 15:48:04 +02:00
Matthias Dieter Wallnöfer
d0e877e785 s4:lib/registry/ldb.c - "ldb_add_key" - fix talloc handling
- free "msg" when possible
- prevent "talloc_strdup"s where not necessary
2010-07-01 15:48:04 +02:00
Stefan Metzmacher
14f8953aa4 s4:dsdb: move dsdb python tests from lib/ldb/ to dsdb/
metze
2010-06-30 11:10:28 +02:00
Stefan Metzmacher
19d93c6a1e s4:ldb/python: make it possible to run tests standalone
metze
2010-06-30 10:59:57 +02:00
Matthias Dieter Wallnöfer
17a5c876a6 ldb:ldb_map_outbound.c - "ldb_parse_tree_collect_attrs" - remove unneeded return value 2010-06-29 22:21:22 +02:00
Matthias Dieter Wallnöfer
8e9d7e84f6 ldb:ldb_modules.c - "ldb_dso_load_symbol" - remove unneeded caste before "dlsym" 2010-06-29 22:16:15 +02:00
Matthias Dieter Wallnöfer
657045ca9a s4:ldb - "ldb_dn_update_components" - fix free of invalid DN parts
Use "LDB_FREE" for such free operations and in addition wipe also the casefolded
DN out.
2010-06-29 22:13:05 +02:00
Matthias Dieter Wallnöfer
f1e92c91b2 ldb:ldb_dn.c - "ldb_dn_set_extended_component" - free the linearized string when the components change 2010-06-29 22:07:51 +02:00
Matthias Dieter Wallnöfer
0f0d9aa9b5 s4:ldb_dn.c - make the code parts which free extended components consistent
Cosmetic
2010-06-29 22:07:01 +02:00
Matthias Dieter Wallnöfer
1e04f49ddb ldb:ldb_dn - "ldb_dn_explode" - move the "dn->comp_num" initalisation upwards and use "LDB_FREE" for freeing "dn->components"
Mostly cosmetic - no behaviour change
2010-06-29 21:59:37 +02:00
Andrew Bartlett
cc7c572b3d s4:secrets Ensure secrets.ldb uses the same hooks as the rest of Samba
This ensures that, for example, the utf8 functions are the same,
the GUID handler is the same and the NOSYNC flag is applied.

Andrew Bartlett
2010-06-29 16:59:31 +10:00
Matthias Dieter Wallnöfer
e6371246ef s4:lib/registry/ldb.c - add a missing brace
Sorry didn't check that earlier.
2010-06-28 23:13:04 +02:00
Matthias Dieter Wallnöfer
ba01b216e2 s4:lib/registry/ldb.c - fix memory handling in "ldb_open_key" 2010-06-28 23:02:56 +02:00