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

17717 Commits

Author SHA1 Message Date
Andrew Bartlett
3ef91c9b02 s4:torture: add ldb tests
These tests are for both the new extended DN functionality (and were
vital in finding bugs during implementation) and for the normal DN
parsing and comparison routines.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2008-12-17 12:29:26 +11:00
Andrew Bartlett
e4ccd69d49 s4:ldap_server: return the extended dn to the LDAP client if available
This uses an early peek at the extended_dn_control (in the request) to see what output
format to use.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2008-12-17 12:29:26 +11:00
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
1107021f3a s4:samldb: make use of dom_sid_split_rid()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2008-12-17 12:29:26 +11:00
Andrew Bartlett
b65f1a0977 s4:samldb: improve error strings
When things go wrong with LDB, this routine seems to be particularly
sensitive to it.  This extra debugging should help the next poor soul who
breaks LDB.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2008-12-17 12:29:25 +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
30ae74d399 s4:dsdb: add support for DSDB_OPENLDAP_DEREFERENCE_CONTROL
Encode and decode the OpenLDAP dereference control (draft-masarati-ldap-deref-00)

At this time, the ldb_controls infrustructure does not handle request
and reply controls having different formats, so this is purely the
client implementation (ie, there is no decode of the client->server
packet, and no encode of the server->client packet).

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2008-12-17 12:29:24 +11:00
Andrew Bartlett
fc61ef2afc s4:libcli/ldap: split out a ldap_decode_attribs_bare() function
The OpenLDAP dereference control (draft-masarati-ldap-deref-00) uses
an attribute list, as found in the search reply, but without one
enclosing ASN1_SEQUENCE(0)

This allows the dereference control parsing code to use this as a
helper function.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2008-12-17 12:29:24 +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 Bartlett
8ce5640fbf Add hint to use passwordAttributes in @KLUDGE_ACL in future
This module is not used at the moment, but if we do use it again, we
should try to avoid duplicate lists.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2008-12-17 12:29:23 +11:00
Andrew Bartlett
56d39e1711 Make greater use of 'GUID_from_data_blob'
This avoids accidentily running off the end of a string, and uses a
single 'guess which type of GUID I have' algorithm.

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2008-12-17 12:29:23 +11:00
Andrew Bartlett
d2ec925c63 Fix sequence number generation against OpenLDAP
It seems that in 2deeb99fff adding the
partition control to this request was missed out.

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2008-12-17 12:29:23 +11:00
Jelmer Vernooij
b3c926376c Fix header installation after move of gen_ndr headers. 2008-12-16 22:20:21 +01: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
53c82ae7a3 Remove use of C++ keywords. 2008-12-16 19:07:02 +01:00
Jelmer Vernooij
b5a0c4cefe Share object files for gen_ndr. 2008-12-16 18:56:21 +01:00
Jelmer Vernooij
4c7293feae Simplify idl-deps.pl script a bit. 2008-12-16 16:46:13 +01: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
b09d2edf26 s4/provision: Upper case default realm, use only first part of realm as default domain name. 2008-12-16 16:17:30 +01:00
Kai Blin
91a7c8b01b nsswitch: Fix paths for Samba4 blackbox wbinfo test 2008-12-16 15:46:03 +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
Kai Blin
5ee0392a55 nsswitch: Move nsswitch files from source4 to top level nsswitch dir 2008-12-16 13:03:05 +01:00
Kai Blin
6821d898d7 nsswitch: Move source3 files to top level dir.
Don't move source4 files yet to not confuse git's rename tracking too much.
2008-12-16 13:02:45 +01:00
Andrew Bartlett
5f20d219c3 Merge branch 'master' of ssh://git.samba.org/data/git/samba into abartlet-devel 2008-12-16 16:23:10 +11: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
f448fde4e3 Merge branch 'master' of ssh://git.samba.org/data/git/samba 2008-12-16 11:41:20 +11:00
Andrew Bartlett
9057c2522a A more-commented version of rpc_server crash fix, matching closer the
previous behaviour for the 'bad bind' case.

(It is only close, not matching - Windows 2008 sends a different,
non-zero, assoc_group_id each time)

Andrew Bartlett
2008-12-16 11:25:29 +11:00
Jelmer Vernooij
530758dc2a Add python extensions for dom_sid. 2008-12-16 00:16:02 +01:00
Jelmer Vernooij
1e419cd31b Rename ldap.h to ldap-util.h to avoid clashing with the system ldap.h 2008-12-14 19:08:22 +01:00
Jelmer Vernooij
573441ff9b Merge branch 'master' of ssh://git.samba.org/data/git/samba 2008-12-14 17:17:55 +01:00
Jeremy Allison
3c5c3aaa74 Added torture test for doing an openX over a directory
to ensure we get the correct error message.
Jeremy.
2008-12-13 13:10:48 -08:00
Jelmer Vernooij
cd25b6245f Move dom_sid to the Samba 3 IDL file, remove the old definition. 2008-12-12 20:20:01 +01:00
Jelmer Vernooij
c4fc0b49f0 Manually marshall dom_sid, so we can use a fixed size array for
dom_sid.sub_auths rather than a dynamically allocated one.

This makes it possible to use the same DCE/RPC object code for Samba 3
and Samba 4's DCE/RPC parsers and allows copying sids more easily
(since they no longer contain any pointers). The cost of having additional
manual marshalling code is limited (~35 additional lines of C code).
2008-12-12 19:52:06 +01:00
Jelmer Vernooij
d1101dba79 Remove noejs property, which is no longer used. 2008-12-12 11:48:42 +01:00
Stefan Metzmacher
370cc9c776 s4:fix segfault in rpc-server, when client binds to unsupported service.
Signed-off-by: Michael Adam <obnox@samba.org>
2008-12-12 09:56:51 +01:00
Jelmer Vernooij
52571a0333 Add interactive flag to setup/provision (also the default when no arguments are given). 2008-12-11 18:51:28 +01:00
Stefan Metzmacher
2026b34ebf s4:selftest: samba4 fails the changed delete test
metze
2008-12-11 17:58:31 +01:00
Stefan Metzmacher
4a3ae3831d s4:libcli/resolve: add resolve_name_all*() which return all addresses not only the first one
metze
2008-12-11 17:58:31 +01:00
Günther Deschner
9ea4b5aac2 s4-smbtorture: skip ServerGetTrustInfo for samba4.
Guenther
2008-12-10 12:47:05 +01:00
Günther Deschner
c4a5788e82 s4-smbtorture: add simple netr_ServerGetTrustInfo test.
Guenther
2008-12-10 11:58:28 +01:00
Günther Deschner
9fa4dfc4ea s4-netlogon: fix the build of netlogon server.
Guenther
2008-12-10 11:58:28 +01:00
Andrew Bartlett
cbe6e2a776 Add AD schema from Microsoft's WSPP documentation.
This schema is *NOT* licenced under a standard Free Software licence,
but does provide us the freedoms we need to use the schema, and the
requirement to distribute as 'part of an implemenation' is similar to
common Free font licences that are accepted by major linux distributions.

Andrew Bartlett
2008-12-10 17:54:06 +11:00
Tim Prouty
4a9b092eb4 s4: [2/3] Fix a delete on close divergence from windows and the associated torture test
This second patch fixes the deltest17 BASE-DELETE torture test to pass
against win2k3/win2k8/winXPsp2
2008-12-09 18:02:31 -08:00
Matthias Dieter Wallnöfer
6e4cc12604 s4-samr: Fix Bug #5946. userparameters handling in torture test.
Signed-off-by: Günther Deschner <gd@samba.org>
2008-12-10 00:07:25 +01:00
Matthias Dieter Wallnöfer
91bfd5f201 s4-samr: Fix Bug #5946. userparameters handling in samr server.
Signed-off-by: Günther Deschner <gd@samba.org>
2008-12-10 00:07:25 +01:00