1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

4252 Commits

Author SHA1 Message Date
Andrew Bartlett
408a752a63 s4:ldb-samba: register samba specific extended dn handlers
This provides the two extended DN handlers for the GUID and SID types,
and makes the parsing more strict (where possible, it uses
ndr_pull_struct_blob_all(), to cause an error if trailing data is
found).

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2008-12-17 12:29:26 +11:00
Andrew Bartlett
ced158d250 s4:ldb.i: hang the dn on the NULL context as the python destructor will free it
This fixes a bug in the ldb.i python wrapper, that showed up under valgrind.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2008-12-17 12:29:25 +11:00
Andrew Bartlett
f7c53e0add s4:ldb: use try to print the extended dn in the ldif output
This allows searches with the extended DN control to still print the
extended DN in ldif output (it would otherwise be parsed and hidden in
the structure).

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2008-12-17 12:29:25 +11:00
Andrew Bartlett
7a7573d570 s4:ldb_ildap: try to pass extended DNs to the server
Whenever we pass a DN to the LDAP server, we now use
ldb_dn_get_extended_linearized().  This allows us to send the extended
DN if set, and therefore allows searches of the form
'<GUID=aaa45ea0-94cd-45e9-8753-abe455d9a8f1>'.

We actually use the '0' format (GUID=aaa45ea094cd45e98753abe455d9a8f1)
because it is more widely supported (by Win2k in particular).

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2008-12-17 12:29:24 +11:00
Andrew Bartlett
aa3eab70d5 s4:ldb: add infrastructure for extended dn handlers
This introduces a new set of pluggable syntax, for use on the
extended DN, and uses them when parsing the DN.

If the DN appears to be in the extended form, we no longer return the
full DN 'as is', but only return the normal part from
ldb_dn_get_linearized().

When validating/parsing the DN we validate not only the format of the
DN, but also the contents of the GUID or SID (to ensure they are
plausable).

We also have functions to set and get the extended components on the DN.

For now, extended_dn_get_linearized() returns a newly constructed and
allocated string each time.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2008-12-17 12:29:23 +11:00
Andrew Tridgell
1b3a084d60 Merge branch 'master' of ssh://git.samba.org/data/git/samba 2008-12-17 07:17:54 +11:00
Andrew Tridgell
e294c4799b an experimental patch for fixing ldb bloat
ldb indexing can cause huge files, and huge memory usage. This
experiment allows us to keep indexes in memory during a transaction,
then to write the indexes to disk when the transaction completes. The
result is that the db is much smaller (we have seen improvements of
about 100x in file size) and memory usage during large transactions is
also greatly reduced

Note that this patch uses the unusual strategy of putting pointers
into a ldb (and thus into a tdb). This works because the pointers are
only there during a transaction, so the pointers are not exposed to
any other users of the database. The pointers allow us to avoid some
really bad allocation problems with tdb record allocation during the
re-indexing.
2008-12-17 07:15:29 +11:00
Jelmer Vernooij
5317dd50c0 Add new script for building IDL files in librpc/idl, generating both
Samba 3 and Samba 4 output.
2008-12-16 16:32:18 +01:00
Jelmer Vernooij
a7109b183b Merge branch 'master' of ssh://git.samba.org/data/git/samba 2008-12-16 15:36:53 +01:00
Jelmer Vernooij
0f04beff33 Rename dom_sid.idl -> server_id.idl (since it no longer actually contains the dom_sid). No longer include it from security.idl. 2008-12-16 15:36:18 +01:00
Andrew Tridgell
4380a374c1 repack the ldb after re-indexing
re-indexing in ldb is triggered on any modification to the @ATTRIBUTES
or @INDEXLIST records. This happens to produce a worst-case
fragmentation of the database, as all @INDEX records are deleted then
re-created. By repacking after re-indexing we ensure that the database
ends up without extreme fragmentation.
2008-12-16 14:41:21 +11:00
Andrew Tridgell
f320e3a659 use transactions in ldbadd, ldbmodify and ldbedit
The command line tools ldbadd, ldbmodify and ldbedit should operate
within a transaction to make them more efficient. The ldbadd tool in
particular is much faster when adding a large number of records if all
the adds happen within a transaction. Previously there was a
transaction per record.
2008-12-16 14:39:42 +11:00
Andrew Tridgell
a226d86dce Merge branch 'master' of ssh://git.samba.org/data/git/samba 2008-12-03 17:47:39 +11:00
Andrew Bartlett
16a3a2da78 Remove timeout event once we are calling the callback.
(Even if the callback takes some time, this isn't a ldb_tdb timeout
any more)

Andrew Bartlett
2008-11-17 10:07:24 +11:00
Andrew Bartlett
5b796adb12 Print unconvertable ldb element values as base64.
If an LDB element cannot be converted into a printable form, we should
still print it, just with safety applied.

Andrew Bartlett
2008-11-17 10:06:58 +11:00
Andrew Bartlett
9abd45979e Always validate a DN when constructing from a string in python 2008-11-17 10:05:37 +11:00
Stefan Metzmacher
1290b1d3d3 s4:librpc/ndr: integrate NDR_MISC into LIBNDR
metze
2008-11-16 16:24:34 +01:00
Stefan Metzmacher
45cf68ce8f s4:torture: fix the build with auto dependencies
metze
2008-11-16 16:21:25 +01:00
Jelmer Vernooij
badfac4412 Move libtorture to top-level. 2008-11-16 00:55:35 +01:00
Jelmer Vernooij
2e6bf03e51 Regenerate SWIG output. 2008-11-11 17:22:16 +01:00
Andrew Bartlett
853909bf94 It is not valid to talloc_free() ldb_dn_get_linearized() 2008-11-11 09:47:23 +11:00
Andrew Tridgell
30eff4f31b fixed options argument to ldb connect in python
The options argument to ldb connect() needs to be marked for the same
special handling as attrs in search
2008-11-06 14:02:40 +11:00
Andrew Tridgell
41a1c882d4 don't give errors when an empty modules list is given to ldb 2008-11-06 11:13:37 +11:00
Andrew Bartlett
9381a78c39 Use ldb_dn_from_ldb_val to avoid possible over-run of the value.
The ldb_val is length-limited, and while normally NULL terminated,
this avoids the chance that this particular value might not be, as
well as avoiding a cast.

Andrew Bartlett
2008-11-04 16:06:56 +11:00
Jelmer Vernooij
4147ad1e98 Remove global_loadparm. 2008-11-02 19:33:34 +01:00
Jelmer Vernooij
28d374ec15 Use environment variable rather than loadparm parameter when testing
nonblocking sockets.
2008-11-02 17:21:46 +01:00
Jelmer Vernooij
a1cc278142 Remove use of global_loadparm during initialization of gensec. 2008-11-02 17:04:22 +01:00
Jelmer Vernooij
cb77fca1cd Remove use of global loadparm in python modules. 2008-11-02 16:50:11 +01:00
Jelmer Vernooij
ef915eff16 Move check of SMB_CONF_PATH to loadparm code. 2008-11-02 16:46:32 +01:00
Jelmer Vernooij
c537f7a914 Fix the build. 2008-11-02 05:49:36 +01:00
Jelmer Vernooij
9265cb02d0 Use a separate global for nonblocking socket testing rather than global_loadparm. 2008-11-02 01:15:42 +01:00
Jelmer Vernooij
5920667452 Split out torture results from torture context. 2008-11-01 00:24:55 +01:00
Jelmer Vernooij
c7cedd3a67 Add comments in torture code, allow creating subcontexts. 2008-10-31 16:37:02 +01:00
Jelmer Vernooij
c9f69f1436 Fix installation of Samba 4 during merged build. 2008-10-30 23:19:51 +01:00
Simo Sorce
9da4c3f830 Revert "Length comparison of the linearized version is not correct."
This reverts commit 753af36a3e.
2008-10-30 08:28:07 -04:00
Simo Sorce
753af36a3e Length comparison of the linearized version is not correct.
The linearized version is not casefolded so length might not match
and yet the strings be equivalent. This can happen if one component
is case-insensitive and a letter that have an uppercase version of
a multibyte character that differ in legth from the corresponding
lowercase one.
2008-10-29 18:07:29 -04:00
Jelmer Vernooij
23302413b3 Remove unused include param/param.h. 2008-10-24 16:37:56 +02:00
Jelmer Vernooij
a803525863 Regenerate SWIG files. 2008-10-24 15:30:43 +02:00
Jelmer Vernooij
27dce768d3 Remove more usages of global_loadparm. 2008-10-24 14:57:03 +02:00
Jelmer Vernooij
56a0b035c6 Remove more uses of global_loadparm. 2008-10-24 14:31:16 +02:00
Jelmer Vernooij
37d885c51a Remove iconv_convenience argument from convert_string{,talloc}() but
make them wrappers around convert_string{,talloc}_convenience().
2008-10-24 14:26:46 +02:00
Jelmer Vernooij
284f523ec7 Remove a few more usages of global_loadparm. 2008-10-24 13:22:12 +02:00
Jelmer Vernooij
8b06312f7e Eliminate another instance of global_loadparm. 2008-10-24 13:13:27 +02:00
Jelmer Vernooij
09a63accb8 Move charset library to top level. 2008-10-24 00:06:35 +02:00
Jelmer Vernooij
9d2d666109 Make lp_tls_* return absolute paths. 2008-10-23 21:49:40 +02:00
Jelmer Vernooij
6b5d0b32b6 Move subunit ui ops out of smbtorture to the torture library. 2008-10-23 21:30:41 +02:00
Jelmer Vernooij
fe36fe8c3e Use common net utility code (address and sockaddr manipulation). 2008-10-23 20:41:15 +02:00
Jelmer Vernooij
d1bc7e56d0 Rename same_net to same_net_v4 for consistency with Samba 3. 2008-10-23 19:56:09 +02:00
Jelmer Vernooij
55fd6b125c Remove support for obsolete data type "ipv4address" 2008-10-23 18:56:37 +02:00
Jelmer Vernooij
ea4f764322 Remove unused global variables. 2008-10-21 16:33:25 +02:00