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

1308 Commits

Author SHA1 Message Date
Andrew Tridgell
0fca76e577 s4-dsdb: added dsdb_functional_level() helper function 2009-12-09 18:18:26 +11:00
Andrew Tridgell
33976711e3 s4-dsdb: use dsdb_module_search_dn in repl_meta_data
This allows us to search below the current module. That
will be important when we start using the results of this
search to get the linked attributes meta data right
2009-12-09 18:18:25 +11:00
Andrew Tridgell
707cd30cda s4-dsdb: fixed steal of parentGUID for empty msg
msg->elements could be NULL before we add parentGUID
2009-12-09 18:18:25 +11:00
Andrew Bartlett
9b0780cf00 s4:dsdb Use ldb_match_msg_objectclass in operational.c
This avoids not only a possibly non-portable compiler expression, but
also the need to look up the schema each time.

Andrew Bartlett
2009-12-07 15:28:51 +11:00
Andrew Bartlett
354b80b3ae s4:dsdb Make primaryGroupToken calculation more efficient and correct
The original code here would do a subtree search under each object,
attempting to determine if it was a group.  This was incorrect, and
inefficient - we just need to ask for the objectClass attribute, and
check that value before returning the group's RID.

(Much of this patch reworks operational.c to allow a search for 2
attributes for this calculation).

Andrew Bartlett
2009-12-07 13:07:56 +11:00
Andrew Bartlett
45cd4c93fb s4:dsdb Make parentGUID handler use dsdb_module_search_dn()
This avoids doing a new search from the top of the module stack.

This also removes the helper function dsdb_find_parentguid_by_dn()
which is now unused.

Andrew Bartlett
2009-12-07 13:07:03 +11:00
Andrew Bartlett
972ee4b97b s4:dsdb Hide the LM password by default too 2009-12-07 13:07:03 +11:00
Andrew Tridgell
be78d4a70d s4-ldb: fixed show_deleted module not to corrupt parse trees
The show_deleted module was using a static private ptr in the module
to hold a parse tree to save on parsing. The code caused this
static ptr to change with each search, which caused incorrect
searches and numerous valgrind errors.

This patch replaces it with a hand-built parse tree.
2009-12-04 17:49:19 +11:00
Andrew Tridgell
ced3eef776 s4-drsutil: fixed a memory leak in samdb_search_count
In general functions that don't return any memory should not take a memory context.
Otherwise it is too easy to have a bug like this where memory is leaked
2009-12-04 17:49:19 +11:00
Matthias Dieter Wallnöfer
80e066112c s4:operational LDB module - Fix usage of LDB constants 2009-12-03 12:51:16 +01:00
Andrew Tridgell
b65b88740c s4-drs: fixed updating of uSNChanged in replmd_modify
Updating of uSNChanged broke in a recent change
2009-12-03 10:27:59 +11:00
Matthias Dieter Wallnöfer
7be99d3735 s4:schema - Make some more (result) variables const and fix up warnings with "discard_const_p" 2009-12-01 16:48:02 +11:00
Fernando J V da Silva
71e29cbf56 s4-drs: Using dsdb_msg_add_guid() utility function
Uses the dsdb_msg_add_guid() to add any kind of GUID attribute
to a ldb_message in several places of samba4 code.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2009-11-30 21:17:27 +11:00
Crístian Deives
1cf48022af s4-drs: add deletion of old connections
the nTDSConnection objects that are not needed anymore will be deleted.
the function kccsrv_delete_connection wasn't tested yet.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2009-11-30 20:22:13 +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
Crístian Deives
7ca2ceb333 s4-drs: Create connection obejct (nTDSConnection)
create nTDSConnection objects to match the list of servers

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2009-11-30 20:22:13 +11:00
Andrew Tridgell
a5e0f433de s4-dsdb: don't call ldb_next_init() twice in objectclass module 2009-11-30 16:49:36 +11:00
Andrew Tridgell
1287c1d115 s4-drs: cope with bogus empty attributes from w2k8-r2
w2k8-r2 sometimes sends empty attributes with completely bogus attrid
values in a DRS replication response. This allows us to continue with
the vampire operation despite these broken elements.
2009-11-28 13:28:34 +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
Andrew Bartlett
e6c1608e90 s4:dsdb Don't segfault with ldb_transaction_prepare_commit() without begin()
It is up to other modules to complain if
ldb_transaction_prepare_commit() is called before
ldb_transaction_begin_transaction()

Andrew Bartlett
2009-11-27 16:05:05 +11:00
Matthias Dieter Wallnöfer
b6efbd5b4c s4:objectclass LDB module - Prevent write operations on constructed attributes 2009-11-26 11:21:01 +01:00
Matthias Dieter Wallnöfer
393b83979d s4:operational LDB module - Don't do the write checks here
Let this perform the schema in the "objectclass" module.
2009-11-26 11:21:01 +01:00
Andrew Bartlett
c16e96e46f s4:dsdb Make samba_dsdb easier to use in upgrades - assume default values 2009-11-25 19:19:32 +11:00
Andrew Bartlett
4062d2b376 s4:dsdb Handle LDAP backends correctly with new samba_dsdb system
The original code had the wrong module names, and use strcasecmp()
incorrectly.

Andrew Bartlett
2009-11-24 11:36:34 +11:00
Andrew Bartlett
625856f2cf s4:provision Move secrets.ldb over to .c file module lists, like sam.ldb 2009-11-24 10:41:45 +11:00
Andrew Bartlett
dcee196f3e s4:operational LDB module - Prevent the modification of operational attributes
(merged by Andrew Bartlett)

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2009-11-24 10:41:15 +11:00
Andrew Bartlett
cfad782c9e s4:dsdb Use new helper function to obtain CN=Aggregate schema DN in schema_data 2009-11-24 10:39:10 +11:00
Andrew Bartlett
e0b1edf013 s4:dsdb Return the subSchemaSubEntry operational attribute on every object 2009-11-24 10:39:09 +11:00
Andrew Bartlett
7b2bd93635 s4:dsdb Add function to return the CN=Aggregate schema DN 2009-11-24 10:39:09 +11:00
Andrew Bartlett
401ba9c9cf s4:dsdb Move module configuration from each ldb into samba_dsdb.c
This makes getting the module order correct, the obligation of Samba4
developers, and not system administrators.  In particular, once an ldb
is updated to use only the 'samba_dsdb' module, no further changes to the
ldb should be required when upgrading to later Samba4 versions.

(thanks to metze for the suggestion of samba_dsdb as a long-term
stable name for the module)

Andrew Bartlett
2009-11-23 14:15:07 +01:00
Kamen Mazdrashki
83b41aa959 s4/schema(tort): Refactor DSDB-SYNTAX test for better performance
Test was implemented as a test fixture so that setup/teardown
occurs only once.
This should impact test performace as long as provision_get_schema()
is a slow function (especially when debugging)
2009-11-23 14:15:06 +01:00
Kamen Mazdrashki
cf2bb28014 s4/schema: Handle Object(OR-Name) syntax in extended_dn_out module
Windows displays attribute values with Object(OR-Name) syntax
in plain DN format when queried through LDAP.
Hence, we need to post-process such values specially
in extended_dn_out.c module so they are always shown as plain DN,
no matter what controls are passed for search request.
2009-11-23 14:15:06 +01:00
Kamen Mazdrashki
1bf31f343c s4/schema: Object(OR-Name) syntax handling for DRS calls
OR-Name syntax through DRS calls looks like DN-Binary syntax
2009-11-23 14:15:05 +01:00
Kamen Mazdrashki
bef4e25b1f s4/schema(tort): Inject authOrig attribute into schema loaded for tests 2009-11-23 14:15:05 +01:00
Kamen Mazdrashki
d03d15d0cb s4/schema(tort): Add test for Object(OR-Name) syntax 2009-11-23 14:15:05 +01:00
Kamen Mazdrashki
aa238ff6ea s4/schema(tort): Test LDB_SYNTAX_DN with extended_dn in [GUID;SID;DN] form 2009-11-23 14:15:05 +01:00
Nadezhda Ivanova
54991cd2e1 Fixed incorrect indentation. 2009-11-22 13:36:35 +02:00
Nadezhda Ivanova
e00281d1f1 Implemented LDAP_SERVER_SD_FLAGS_OID on search requests. 2009-11-21 18:40:51 +02:00
Nadezhda Ivanova
4abd85898d Cosmetic patch - fixed case of attribute name. 2009-11-20 14:55:31 +02:00
Nadezhda Ivanova
7c8b34657a Implementation of LDAP_SERVER_SD_FLAGS_OID on modify requests. 2009-11-20 13:25:13 +02:00
Andrew Tridgell
92eff41ca5 s4-dsdb: some more attribuutes that we should only give if asked for 2009-11-20 15:19:35 +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
Andrew Tridgell
f3f0c8e2ce s4-dsdb: removed attributes that should not be displayed by default
Some attributes (like ntSecurityDescriptor) are stored in our db, but
should only be displayed if asked for. This also applied to parentGUID
from old installs, which is now generated.
2009-11-20 14:19:18 +11:00
Fernando J V da Silva
086fa79d4d s4-drs: Removes stored parentGUID's creation and renaming
parentGUID is now created on demand in operational.c

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2009-11-20 13:58:31 +11:00
Fernando J V da Silva
70d8db86b9 s4-drs: Synchronous Implementation of generated parentGUID
This generated parentGUID on demand, rather than getting it from the
database

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2009-11-20 13:56:50 +11:00
Fernando J V da Silva
8481581dc4 s4-drs: Utility functions to deal with GUID
dsdb_find_parentguid_by_dn() returns the parentGUID for a given DN
dsdb_msg_add_guid() adds a GUID value to a given message (either
objectGUID or parentGUID).

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2009-11-20 13:53:47 +11:00
Andrew Tridgell
dda28a9a78 s4-dsdb: make sure mod_usn list is zeroed on each transaction 2009-11-20 12:23:55 +11:00
Matthias Dieter Wallnöfer
dea569dc86 s4:SAMLDB DSDB module - Add "\n"s on debug messages 2009-11-17 19:22:00 +01:00
Matthias Dieter Wallnöfer
c4a70550b3 s4:SAMLDB DSDB module - Remove "\n" in LDB error messages
abartlet suggested me to not use anymore "\n"s in those kind of outputs.
Plus, enhance a search filter to consider also "builtinDomain" objects which
are basically domain objects too.
2009-11-17 18:45:17 +01:00
Stefan Metzmacher
4532f683a7 s4:dsdb/schema: let schema_supclasses() return the correct pointer
str_list_unique() changes the pointer via talloc_realloc().

metze
2009-11-17 09:00:50 +01:00