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

778 Commits

Author SHA1 Message Date
Michael Adam
aa089b80de dsdb: the samba3 ldap schema has no sambaAccountPolicy (any more at least)
Michael
2009-09-14 14:51:21 +02:00
Andrew Tridgell
02c9a7e4b6 s4-repl: use the new dsdb partition uSN helper fns 2009-09-13 16:40:00 -07:00
Andrew Tridgell
80c575923f s4-sam: allow a search to specify a partition
You can now attach a partition control to searches to search within a
specific partition. This is used to get at the per-partition
@REPLCHANGED object
2009-09-13 16:40:00 -07:00
Andrew Tridgell
73e380deec s4-repl: keep a @REPLCHANGED object on each partition
This object tracks the highest uSN in each partition. It will be used
to allow us to efficiently detect changes in a partition for sending
DsReplicaSync messages to our replication partners.
2009-09-13 16:39:59 -07:00
Stefan Metzmacher
db26c00c55 s4:repl_meta_data: increment the attribute version with each change
metze
2009-09-12 10:39:52 +02:00
Andrew Tridgell
5c0cf012a7 s4-samdb: make it possible to ask for the sequence number of a partition
The partition module normally makes the sequence number extended op
operate across all partitions. It will be useful in the repl task to
be able to ask for the sequence number of one partition
2009-09-12 15:24:31 +10:00
Andrew Tridgell
b00518cf7a s4-repl: don't be too eager to allocate new sequence numbers
we only need to allocate a new sequence number when
replPropertyMetaData is changing or being created on an object
2009-09-12 12:07:06 +10:00
Andrew Tridgell
733fa19bc1 s4-samdb: internal s4 ldb modules should be GPL not LGPL
I think these modules ended up LGPL because someone based the module
on an existing LGPL module in the core ldb, and it spread from
there. Certainly there is no reason for the ldb modules that are not
distributed as part of ldb to be LGPL.
2009-09-12 11:21:21 +10:00
Andrew Tridgell
94183eb7e6 s4-repl: we should only update uSNChanged when replication data changes
When changing non-replicated attributes we should not update the
uSNChanged attribute on the record, otherwise the DRS server will
think this record needs replicating.
2009-09-12 11:15:27 +10:00
Jelmer Vernooij
97338168e8 repl_meta_data: Fix include path when building with standalone ldb. 2009-09-12 00:49:51 +02:00
Andrew Tridgell
9da4933804 s4-vampire: cope with no invocationID when vampiring the schema 2009-09-11 23:26:39 +10:00
Andrew Tridgell
fd3a77839c s4-repl: don't update replPropertyMetaData for non-replicated attributes
thanks to Metze for spotting this
2009-09-11 22:13:45 +10:00
Andrew Tridgell
c6647bfd17 s4-repl: on every ldb modify we need to update replPropertyMetaData
Every time we change a ldb object with the repl_meta_data module
loaded we need to update the replPropertyMetaData attribute to fix the
timestamps and USNs of the attributes being changed.
2009-09-11 19:07:38 +10:00
Stefan Metzmacher
2bc8e57201 s4:repl_meta_data: remove unused code
metze
2009-09-08 22:06:07 +02:00
Matthias Dieter Wallnöfer
076ca26cfe s4:templates - Remove the latest relics (in "dcesrv_lsa_CreateSecret") 2009-09-07 14:36:39 +02:00
Matthias Dieter Wallnöfer
44872096fb s4:simple_ldap_map - "primaryGroupId"
Previous patch was incomplete regarding the "primaryGroupId" attribute. Complete it.
2009-09-07 09:00:46 +02:00
Matthias Dieter Wallnöfer
1d9a95e310 s4:samldb - Fix typo 2009-09-07 08:37:26 +02:00
Matthias Dieter Wallnöfer
5107f6fd0a s4:subtree delete module - Cosmetic adaptions 2009-09-07 08:37:25 +02:00
Matthias Dieter Wallnöfer
5f2832a5dc s4:samldb - Major rework
This fixes up the change of the primary group of a user when using the ADUC
console:
- When the "primaryGroupId" attribute changes, we have to delete the
  "member"/"memberOf" attribute reference of the new primary group and add one
  for the old primary group.
- Deny deletion of primary groups according to Windows Server (so we cannot
  have invalid "primaryGroupID" attributes in our AD).
- We cannot add a primary group directly before it isn't a secondary one of a
  user account.
- We cannot add a secondary reference ("member" attribute) when the group has
  been chosen as primary one.

This also removes the LDB templates which are basically overhead now.

This should also fix bug #6599.
2009-09-07 08:37:24 +02:00
Matthias Dieter Wallnöfer
03e84a22a8 s4:simple_ldap_map - Enhance it for supporting "primaryGroupID" in the right way 2009-09-06 12:35:22 +02:00
Matthias Dieter Wallnöfer
f82dd192ee s4:"linked attributes" modules - correct the comments 2009-09-06 12:31:13 +02:00
Andrew Tridgell
d3d6713c59 another large change to the linked_attribute module
This one copes with deleted objects where linked attributes have been
set on the module. We hit this when we do the ldb wipe at the start of
a provision, which trigers linked attribute updates, but for objects
that have disappeared. We need to ensure that the linked attribute
updates only happen on the right object, and if the object gets
re-created (as happens with a provision) then it is not the right
object.

To cope with this we record the GUID of the object when the operation
that triggered the linked attribute update comes in, and then find the
DN by suing that GUID when we apply the change in the prepare commit
hook.
2009-09-03 18:36:10 +10:00
Andrew Tridgell
b72b8f6e7d hook on prepare_commit instead of transaction_end
This allows for safe transaction end aborts
2009-09-03 18:36:10 +10:00
Andrew Tridgell
47f52e7a33 greatly simplify the transaction processing in the partition module
Now that ldb is calling prepare commit separately, the job of the
partition module on transaction end is much simpler (and more robust!)
2009-09-03 18:36:09 +10:00
Andrew Tridgell
348824da75 change repl_meta_data to process linked_attributes structures in end_transaction
When running at functional level 2 or above, the repl_meta_data module
can receive linked attribute structures from the repl replication
task. These attributes can come through DRS before the associated
objects have been created. To cope with this, we need to process
linked attributes in the end_transaction hook.
2009-09-03 18:36:09 +10:00
Andrew Tridgell
aff1e623aa fixed transaction handling in linked_attributes module
We need to call down to the next transaction function when we finish
in linked_attributes.

This also changes linked_attributes to use the common
dsdb_find_dn_by_guid() function
2009-09-03 18:36:09 +10:00
Andrew Tridgell
e6257d94de add the the linked attributes elements to the repl structure
This exposes the linked_attributes to the repl_meta_data module
2009-09-03 18:36:08 +10:00
Andrew Tridgell
9f031352c6 traverse the ac list in reverse order
items are added to the linked attribute list using DLIST_ADD(), which
means to commit them to the database in the same order they came from
the server we need to walk the list backwards when we traverse it
2009-09-02 18:19:56 +10:00
Andrew Tridgell
ca45847eda s4:dsdb rewrite the linked_atrributes code to commit in the end_transaction hook
linked attribute changes can come in any order. This means it is
possible for a forward link to come over the wire in DRS before the
target even exists. To make this work this patch changed the linked
attributes module to gather up all the changes it needs to make in a
linked list, then execute the changes in the end_transaction hook for
the module.

During that commit phase we also fix up all the DNs that we got by
searching for their GUID, as the objects may have moved after the
linked attribute was sent, but before the end of the transaction
2009-09-02 18:19:56 +10:00
Andrew Tridgell
29320bc6e0 add the partition_control control to replication requests
We know the partition DN from the DRS objects, we need to pass this
down the modules below us to ensure they operate on the right
partition
2009-09-02 18:19:55 +10:00
Andrew Tridgell
79255a9384 change the dsdb_control_current_partition to not include internal variables
This structures was used in two ways. In one way it held variables
that are logically internal to the partition module, and in the other
way it was used to pass the partition DN down to other modules. This
change makes the structure contain just the dn which is being passed
down.

This change is part of the support for linked attributes. We will be
passing this control down from above the partition module to force
which partition a request acts upon. The partition module now only
adds this control if it isn't already there.
2009-09-02 18:19:55 +10:00
Andrew Tridgell
4b336fed94 Display ldif formatted versions of all DRS changes at log level 4
This helps a lot with debugging the DRS replication code
2009-09-02 18:19:55 +10:00
Andrew Tridgell
90b694bc61 fixed spelling 2009-09-02 18:19:54 +10:00
Andrew Bartlett
cda99a202d s4:dsdb Use helper function to add 'show deleted' control
This revises tridge's commit 61ca4c491e
to use ldb_request_add_control() instead of a manual construction.

Andrew Bartlett
2009-08-26 11:10:51 +10:00
Andrew Tridgell
61ca4c491e fixed DRS rename of deleted objects
The objectclass module checks that the target parent exists, and
refuses renames if it doesn't exist. For this to work for deleted
objects we have to do the search in the objectclass module with the
"show deleted" control enabled.
2009-08-25 17:00:27 +10:00
Andrew Bartlett
6542a084a5 s4:dsdb Rework show_deleted module not to liniearise the LDAP filter
Instead, use the fact that the ldb_parse_tree structure is public to
construct the 'and not deleted' clause as a structure, and apply each
filter tree to that template.

Andrew Bartlett
2009-08-25 16:28:44 +10:00
Andrew Bartlett
be9441ac3f s4:dsdb Use talloc_strndup() to ensure OIDs are null terminated
The OIDs are not NULL terminated by the python caller, in line with
the LDB API, but we need them to be here, as we were casting them to a
string.

Andrew Bartlett
2009-08-24 20:24:19 +10:00
Andrew Bartlett
bf54b419ae s4:dsdb remove unused variable 2009-08-24 20:24:18 +10:00
Andrew Tridgell
a0df109d66 added basic support for rename in DRS replication
Added simple DRS rename support in replication. This should be done
async, and I'm not sure if we should also do any repl data updates to
indicate the rename. I'm still learning how this stuff works, but at
least this allows a rename on a DC to propogate correctly
2009-08-19 15:53:19 +10:00
Matthias Dieter Wallnöfer
2cf897b10a s4: Make the int32 problem more clear - and fix another error 2009-08-17 20:29:11 +02:00
Matthias Dieter Wallnöfer
6cc9e4b900 s4: Fixed the int32 datatype support
Should finally fix bug #6136 ("groupType", "sAMAccountType" ... attributes).
2009-08-17 13:15:26 +02:00
Matthias Dieter Wallnöfer
6dab7c9dbe s4: cracknames.c: Change the handling of the NT_STATUS_NO_MEMORY status results
With the previous check I got random failures when trying to connect to the
LDAP server.
2009-08-14 00:14:14 +02:00
Matthias Dieter Wallnöfer
e96338bf2b s4:operational - Remove some outdated comments 2009-08-11 11:08:05 +02:00
Matthias Dieter Wallnöfer
9126b75aae s4:samldb module - Remove duplicate line 2009-08-11 12:59:16 +02:00
Matthias Dieter Wallnöfer
b255a41dca s4:operational module - move and enhancements
This moves the "operational" LDB module to the right place under "dsdb/samdb/ldb_modules"
(suggested by abartlet) and enhances it for supporting dynamic generated
"primaryGroupToken" for AD groups. This should fix bug #6466.
2009-08-11 12:59:15 +02:00
Andrew Tridgell
e2d4ae1510 fixed several places that unnecessarily take a reference to the event context
These references were triggering the ambiguous talloc_free errors from
the recent talloc changes when the server is run using the 'standard'
process model instead of the 'single' process model. I am aiming to
move the build farm to use the 'standard' process model soon, as part
of an effort to make our test environment better match the real
deployment of Samba4.

The references are not needed as the way that the event context is
used is as the 'top parent', so when the event context is freed then
all of the structures that were taking a reference to the event
context were actually freed as well, thus making the references
redundent.
2009-08-07 17:24:48 +10:00
Andrew Bartlett
43aa546ecc s4:dsdb Don't cast an ldb_val into a const char * for schema lookups
This removes a number of cases where we did a cast into a const char *
of an ldb_val.  While convention is to alway have an extra \0 at
data[length] in the ldb_val, this is not required, and does not occour
at least on build farm host 'svart'.

Andrew Bartlett
2009-08-05 08:56:06 +10:00
Matthias Dieter Wallnöfer
cb53b78080 [SAMBA 4] Some cosmetic changes for the LDB modules
Some corrections which make the code a bit more readable (no functional changes here)
2009-07-19 15:59:13 +02:00
Andrew Bartlett
271b5af92e s4:dsdb Handle dc/domain/forest functional levels properly
Rather than have the functional levels scattered in 4 different,
unconnected locations, the provision script now sets it, and the
rootdse module maintains it's copy only as a cached view onto the
original values.

We also use the functional level to determine if we should store AES
Kerberos keys.

Andrew Bartlett
2009-07-16 09:23:35 +10:00
Günther Deschner
05fbe0c7f7 libds: merge the UF<->ACB flag mapping functions.
Guenther
2009-07-13 15:36:07 +02:00