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

3237 Commits

Author SHA1 Message Date
Amitay Isaacs
bee55a2957 s4-dsdb: Check if metadata.tdb exists, before trying to open it
This fixes the error output from tdb2 when metadata module tries
to create metadata.tdb first time. This error is reported since
metadata module tries to check if tdb exists by trying to open
tdb file.

Autobuild-User: Amitay Isaacs <amitay@samba.org>
Autobuild-Date: Mon Feb 13 03:02:09 CET 2012 on sn-devel-104
2012-02-13 03:02:09 +01:00
Andrew Tridgell
204c07501d Revert "s4-drs: do not try to contact for replication servers that are not anymore in reps*"
This reverts commit 5bfd6251eb.

This change has been causing regular segfaults in the build farm since
it was applied. I also think it may be unnecessary as
dreplsrv_refresh_partitions() should already be achieving the same
thing (removing stale replication targets).

I think the segfaults were caused by freeing an in-flight DSA, but I
have been unable to reproduce it outside of the build farm

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Wed Feb  1 07:49:42 CET 2012 on sn-devel-104
2012-02-01 07:49:41 +01:00
Rusty Russell
641beb35bf samdb: use compat wrappers for tdb_fetch().
TDB2's tdb_fetch() returns an error code; use tdb_fetch_compat() for now.
Similarly, tdb_errorstr() -> tdb_errorstr_compat().

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-01-30 10:07:17 +10:30
Andrew Bartlett
1a9ee7cbd5 dsdb: Allow DSDB_CONTROL_PASSWORD_BYPASS_LAST_SET_OID to be specified as a flag 2012-01-24 18:36:49 +11:00
Amitay Isaacs
1f0298dd1b python: Change except: statement to except Exception:
This way we only catch true exceptions and keyboard interrupts
are not caught here.

Autobuild-User: Amitay Isaacs <amitay@samba.org>
Autobuild-Date: Tue Jan 24 03:32:40 CET 2012 on sn-devel-104
2012-01-24 03:32:40 +01:00
Stefan Metzmacher
13182e792a s4:dsdb/password_hash: require a "Primary:Kerberos" blob in supplementalCredentials
If this is missing a w2k8r2 server will reboot, when someone tries to
change a password.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Mon Jan 16 17:10:07 CET 2012 on sn-devel-104
2012-01-16 17:10:07 +01:00
Dave Craft
aff8dad076 Intersite KCC flags for python
Add NTDSSITELINK options to dsdb class for use
in python samba_kcc

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2012-01-14 06:13:08 +01:00
Matthias Dieter Wallnöfer
6857a588f3 s4:repl_meta_data LDB module - set "isRecycled" time correctly
"unix_to_nt_time()" which is based on "time_t" behaves differently for
literals > 32 bit on 32 and 64 bit platforms.

Reviewed-by: ekacnet

Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Thu Jan  5 11:59:20 CET 2012 on sn-devel-104
2012-01-05 11:59:20 +01:00
Matthieu Patou
34d549de34 s4-kcc: Remove also deleted objects that are not in the Deleted Object container
For the configuration container we do a full scan at every run of the
kcc-delete service. For the base DN we introduce a new parameter that
avoid the full scan to kick just when samba starts.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-12-23 07:57:21 +01:00
Matthieu Patou
ea9fb5cad8 s4-ldb: Add isRecycled when is defined in the schema
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-12-23 07:57:21 +01:00
Matthieu Patou
f39426c8ae s4-dsdb: Relax the conditions where we can't do a subtree delete
If the parent object is a SAM object (as defined in 3.1.1.5.2.3
Special Classes and Attributes of MS-ADTS) then we can use the subtree
delete control even if the object is a critical one.

Autobuild-User: Matthieu Patou <mat@samba.org>
Autobuild-Date: Mon Dec 19 14:32:19 CET 2011 on sn-devel-104
2011-12-19 14:32:18 +01:00
Stefan Metzmacher
fbcdaa6a45 s4:pydsdb: remove unused variable from py_dsdb_am_pdc()
metze
2011-12-13 12:36:34 +01:00
Matthias Dieter Wallnöfer
1b741b2bcc s4:dsdb/common/util.c - test LDB result against LDB_SUCCESS as we are always doing
Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Fri Dec  9 12:00:03 CET 2011 on sn-devel-104
2011-12-09 12:00:03 +01:00
Dave Craft
0a4746a200 Invocation of samba_kcc from KCC task
Modification to periodic and explicit invocation
paths of the KCC topology generation code.  Managed
via samba_runcmd_send() API.  The samba_kcc script
is invoked if (kccsrv:samba_kcc = true) appears in smb.conf

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-12-08 11:48:17 +11:00
Dave Craft
0a181217bd Add subreq and status to kcc_service struct
The subreq and status fields in the kcc_service struct
are added for execution management of the external samba_kcc
python script.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-12-08 11:48:17 +11:00
Andrew Bartlett
d8f98933fd pydsdb: provide a am_pdc hook like am_rodc to python scripts 2011-12-07 03:09:08 +01:00
Matthieu Patou
5bfd6251eb s4-drs: do not try to contact for replication servers that are not anymore in reps*
Servers connection can be removed from repsTo and respFrom either due to
DC demote or topology change by the KCC, if a server is removed from the
reps* it must be effectivly removed from the list of server that we will
contact for getNcChanges and for replicaSync.

Autobuild-User: Matthieu Patou <mat@samba.org>
Autobuild-Date: Mon Dec  5 19:56:09 CET 2011 on sn-devel-104
2011-12-05 19:56:09 +01:00
Matthieu Patou
059523e203 s4-resolver: do not use all the A and AAAA records, those after a NS are not the one we want to use 2011-12-05 18:23:08 +01:00
Matthieu Patou
2f8a84bb7b s4-drs: mark WERR_DS_DRA_BUSY as a non error in DsReplicaUpdateRefs 2011-12-05 18:23:07 +01:00
Amitay Isaacs
2e4bf8bfcd s4-repl: Check if GC SPN exists before using it for replication
Sometimes windows DC will set up dNSHostname before setting up
GC SPN and that causes replication errors since samba tries to
use GC SPN, which does not yet exist locally.

Pair-Programmed-With: Andrew Tridgell <tridge@samba.org>
2011-11-29 16:00:36 +11:00
Amitay Isaacs
49926a2ac6 s4-dsdb: Added metadata to partition module for global sequence number
This adds support for global sequence number which is independent of
partition information.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-11-29 16:00:35 +11:00
Amitay Isaacs
349c54528b s4-dsdb: use dsdb_module_extended instead of duplicate code
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-11-29 16:00:35 +11:00
Amitay Isaacs
422fcbbe72 s4-dsdb: Return ldb_result context in dsdb_module_extended
The result of the extended operation is now available in the calling
routine.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-11-29 16:00:35 +11:00
Amitay Isaacs
c199b35dd4 s4-dsdb: Remove LDB_SEQ_HIGHEST_TIMESTAMP sequence number support
This was a hack for LDAP backends to store a sequence number as a
timestamp. It is still supported in standalone ldb tdb backend.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-11-29 16:00:35 +11:00
Matthias Dieter Wallnöfer
83c039378b s4:update_keytab LDB module - no need to filter for the DN
We launch a search request with base scope on exactly the same DN (see
downwards).

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-11-26 10:17:18 +01:00
Matthieu Patou
6d29581637 s4-dsdb: Modify the repl_meta_data behavior to allow Metadata change on attribute interSiteTopologyGenerator even if the value didn't change
Autobuild-User: Matthieu Patou <mat@samba.org>
Autobuild-Date: Sat Nov 19 16:47:53 CET 2011 on sn-devel-104
2011-11-19 16:47:53 +01:00
Amitay Isaacs
9318e00a1f dsdb: Fix the password expiry calculation
As per Section 3.1.1.4.5.26 [MS-ADTS.pdf], password is expired if

  pwdLastSet = null, or
  pwdLastSet = 0, or
  (maxPwdAge != 0x8000000000000000 and (ST - pwdLastSet) > maxPwdAge)
2011-11-18 14:38:28 +11:00
Amitay Isaacs
3bb5af5244 s4-dsdb: Remove unsed variable 2011-11-17 03:49:07 +01:00
Matthieu Patou
b91dd516b5 s4-dsdb: rework the NC detection for the descriptor calculation
This checks if instanceType attribute is available, and if
INSTANCE_TYPE_IS_NC_HEAD bit is set. If the bit is set, then
the DN is NC root and security descriptor is not inherited
from parent SD.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
2011-11-16 17:16:30 +11:00
Matthias Dieter Wallnöfer
ec38098c29 s4:partition LDB module - fix handling regarding special DNs on searches
Normally they should always be passed to the main backend unless
something different has been specified.

Reviewed-by: abartlet

Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Tue Nov 15 22:43:06 CET 2011 on sn-devel-104
2011-11-15 22:43:06 +01:00
Stefan Metzmacher
c1fd56fdd4 s4:dsdb/schema_data: reject schema update unless they're allowed
"dsdb:schema update allowed = yes" is now needed in smb.conf
to enable schema updates, as schema updates are a currenty a good
way to prevent samba from startup again, because of errors in
the schema definition.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue Nov 15 13:00:07 CET 2011 on sn-devel-104
2011-11-15 13:00:07 +01:00
Stefan Metzmacher
e7e9f1e2dd s4:dsdb/schema: add "dsdb:schema update allowed" option to enable schema updates
By default schema updates are not allowed anymore, as we don't have
complete validation code to prevent database corruption.

metze
2011-11-15 09:46:30 +01:00
Stefan Metzmacher
be091eddec s4:dsdb/schema_data: reject changes to schemaInfo, msDs-Schema-Extensions, msDS-IntId
As windows we return CONSTRAINT_VIOLATION now.

metze
2011-11-15 09:46:29 +01:00
Stefan Metzmacher
38868c8b7f s4:dsdb/schema_data: make sure we reject schema changes if we're not the schema master
metze
2011-11-15 09:46:29 +01:00
Stefan Metzmacher
76b99bb379 s4:dsdb/schema_data: make sure we only allow objects one level below the schema base
The objectclass module should also check for this, but make sure
we also reject it on things like provision.

metze
2011-11-15 09:46:29 +01:00
Stefan Metzmacher
28d573168c s4:param/provision: pass schema_dn to provision_get_schema()
metze
2011-11-15 09:46:27 +01:00
Stefan Metzmacher
75ae19422b s4:dsdb/schema: pass and remember the schema_dn in dsdb_set_schema_from_ldif()
metze
2011-11-15 09:46:27 +01:00
Stefan Metzmacher
e6a9e1dda9 s4:dsdb/pydsdb: pass down schema_dn to _dsdb_set_schema_from_ldif()
metze
2011-11-15 09:46:26 +01:00
Stefan Metzmacher
54a9a47a91 s4:dsdb/samldb: use DSDB_FLAG_AS_SYSTEM in samldb_schema_info_update()
We should only be able to update the schemaInfo internaly.

metze
2011-11-15 09:46:26 +01:00
Jelmer Vernooij
f625d362d7 Remove broken code - these lines use undefined symbols. 2011-11-14 15:49:36 +01:00
Matthieu Patou
85af1ed9b8 s4-dsdb: initialize correctly the value of originating_change_time for the Deleted Object Container 2011-11-13 14:11:26 +01:00
Andrew Tridgell
ba41389d3d test: fixed several tests to use samba.tests
this fixes error checking. Test failures were not being detected
otherwise

Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>
2011-11-10 14:24:21 +11:00
Dave Craft
a5d6e427c5 python dsdb flag addtions (NTDSSETTINGS, NTDSCONN)
Add missing flags present in C code base to python
code base dsdb/pydsdb.c
   INSTANCE_TYPE...
   DS_NTDSSETTINGS_OPT...
   NTDSCONN_OPT...
These are consumed by the python KCC scripts

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-11-07 10:02:45 +11:00
Matthieu Patou
2db221c384 s4-sites: Document, fix under optimal coding, use exceptions
Autobuild-User: Matthieu Patou <mat@samba.org>
Autobuild-Date: Wed Nov  2 22:35:00 CET 2011 on sn-devel-104
2011-11-02 22:35:00 +01:00
Matthieu Patou
37703892bd s4-selftest: add unit tests for sites's function in python 2011-11-02 13:37:18 +01:00
Amitay Isaacs
a6ed9071b9 dsdb: Handle the case when extended rights string is NULL
Pair-Programmed-With: Andrew Tridgell <tridge@samba.org>

Signed-off-by: Andrew Tridgell <tridge@samba.org>

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Wed Nov  2 07:03:40 CET 2011 on sn-devel-104
2011-11-02 07:03:40 +01:00
Amitay Isaacs
c8ac3678ad s4-drepl: Search for application partitions in addition to main ones
To replicate application partitions (e.g. DNS partitions) consult
msDs-hasMasterNCs attribute as well. Also, make sure we don't add
same partition twice in the list. hasMasterNCs and msDs-hasMasterNCs
have domain, configuration and schema partitions common.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-11-02 15:26:55 +11:00
Andrew Bartlett
aabda85a2f s4-dsdb Remove LDAP backend credentials support
The error message from this causes confusion, for a feature
that we have never finished and have agreed to remove.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Tue Nov  1 06:32:52 CET 2011 on sn-devel-104
2011-11-01 06:32:52 +01:00
Matthias Dieter Wallnöfer
673be97f1e s4:repl_meta_data LDB module - don't intercept the partition LDB module referrals
Reviewed-by: abartlet
2011-10-27 18:52:29 +02:00
Matthias Dieter Wallnöfer
2ee42ebab3 s4:repl_meta_data LDB module - rename operation - do not overwrite error messages
"ldb_error" could overwrite possibly useful error messages.

Reviewed-by: abartlet
2011-10-27 18:52:29 +02:00
Matthias Dieter Wallnöfer
57b8bc74c4 s4:repl_meta_data LDB module - remove pointless debug messages
These are displayed when an object just doesn't exist!

Reviewed-by: abartlet
2011-10-27 18:52:29 +02:00
Matthias Dieter Wallnöfer
45b4b8264a s4:repl_meta_data LDB module - always return the original LDB result codes on failure
And add "ldb_operr()" before the "return ret" to point out the position
where it failed (for "add_time_element" and "add_uint64_element")

Reworked after a suggestion by abartlet.
2011-10-27 18:52:29 +02:00
Matthias Dieter Wallnöfer
3fe747538b s4:repl_meta_data LDB module - "dsdb_search_module_dn" already checks if len(res) == 1
No need to perform an additional check here. As a return value we should
always give back the original error code and not generate a new one (to
let the caller know what is going on).

Reviewed-by: abartlet
2011-10-27 18:52:29 +02:00
Matthias Dieter Wallnöfer
d95b4c9497 s4:ldap.py - fix up the dSHeuristics test to check for the right behaviour
Reviewed-by: abartlet
2011-10-27 18:52:29 +02:00
Matthias Dieter Wallnöfer
6287d0d61c s4:objectclass_attrs LDB module - implement the dSHeuristics length checks correctly
Consider bug #8489

Reviewed-by: abartlet
2011-10-27 18:52:29 +02:00
Matthias Dieter Wallnöfer
bb02aa5e00 s4:ldap.py - we test the creation of secrets already in the "systemOnly" testcase
Reviewed-by: abartlet
2011-10-27 18:52:29 +02:00
Matthias Dieter Wallnöfer
6fc55cb9f2 s4:ldap.py - enhance and fix up the object class test
Also address the problem described in bug #8486.

Reviewed-by: abartlet
2011-10-27 18:52:29 +02:00
Matthias Dieter Wallnöfer
751bab4fb2 s4:objectclass LDB module - objectclass modify op. - remove superflous "talloc_strdup"
We are adding strings embedded in the schema structure which is basically
global and lives longer than the request - hence no duplication needed.

Reviewed-by: abartlet
2011-10-27 18:52:29 +02:00
Matthias Dieter Wallnöfer
184c17587c s4:objectclass LDB module - objectclass modify operations
According to bug #8486 the modification to direct related structural
object classes is possible (equal, child, parent).

Reviewed-by: abartlet
2011-10-27 18:52:29 +02:00
Matthias Dieter Wallnöfer
68b3770c45 s4:objectclass LDB module - forbid to add unrelated objectclasses
E.g. unsatisfied abstract objectclasses, additional top-most structural
classes

Reviewed-by: abartlet
2011-10-27 18:52:29 +02:00
Matthias Dieter Wallnöfer
730257f4c0 s4:objectclass LDB module - "objectclass_add" - small optimisation
This saves us from doing one "ldb_msg_find_element".

Reviewed-by: abartlet
2011-10-27 18:52:29 +02:00
Matthias Dieter Wallnöfer
82d9c9e5a0 s4:objectclass LDB module - "check_rodc_ntdsdsa_add"
For convention use "ldb_attr_cmp()".

Reviewed-by: abartlet
2011-10-27 18:52:29 +02:00
Matthias Dieter Wallnöfer
3756508fec s4:objectclass LDB module - update copyright
Reviewed-by: abartlet
2011-10-27 18:52:28 +02:00
Matthias Dieter Wallnöfer
7161bb4b37 s4:password_hash LDB module - fix compiler warning due to unsatisfied "switch"
Bail out on other LDB request types (only add and modify allowed).
2011-10-27 18:52:28 +02:00
Matthias Dieter Wallnöfer
c9ac028951 s4:ldap.py - fix up the UTF8 tests
Reviewed-by: abartlet
2011-10-27 18:52:28 +02:00
Matthias Dieter Wallnöfer
5875661cf2 s4:ldap.py - reactivate some assertions in "test_all"
There should always be one result on both s4 and Windows.

Reviewed-by: abartlet
2011-10-27 18:52:28 +02:00
Andrew Tridgell
3712006faa dsdb: improve debug message
show the reply type in "Invalid reply type" messages

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Thu Oct 20 00:57:05 CEST 2011 on sn-devel-104
2011-10-20 00:57:05 +02:00
Andrew Bartlett
3cdb1fe440 s4-messaging: Pass the loadparm context, not just the messaging path
This will allow the TDB layer to get at the lp_ctx for tdb options.

Andrew Bartlett
2011-10-13 14:06:07 +02:00
Gregor Beck
85b145d745 s3:utils change data_blob_dup_talloc() to take a DATA_BLOB by value
Signed-off-by: Michael Adam <obnox@samba.org>
2011-10-12 22:45:53 +02:00
Jelmer Vernooij
1417ea1eed Remove pointless exception catching in tests.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sun Oct  9 00:00:26 CEST 2011 on sn-devel-104
2011-10-09 00:00:25 +02:00
Stefan Metzmacher
bcb02129c3 s4:dsdb/password_hash: add DSDB_CONTROL_PASSWORD_BYPASS_LAST_SET_OID
Which allows the caller to pass a given 'pwdLastSet' value
(every useful for migrations).

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Fri Oct  7 15:28:13 CEST 2011 on sn-devel-104
2011-10-07 15:28:13 +02:00
Stefan Metzmacher
ff1ce6521b s4:dsdb: fix the order of DSDB_CONTROL_* defines in samdb.h
This makes clear that struct dsdb_control_password_change
belongs to DSDB_CONTROL_PASSWORD_CHANGE_OID.

metze
2011-10-07 12:20:45 +02:00
Andrew Tridgell
83f0dc44a7 s4-dsdb: special case for deleted objects one way link
we show wellknown links to the deleted objects container

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Fri Oct  7 07:58:08 CEST 2011 on sn-devel-104
2011-10-07 07:58:08 +02:00
Andrew Tridgell
9b981ff1e8 s4-dsdb: don't display links to deleted objects
unless the user asks for the display of deactivated links, we should
not display DNs that link to deleted objects

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-10-07 13:20:44 +11:00
Andrew Tridgell
a729dbb269 s4-dsdb: fixed one_way_link calculation
we need to check for the other end of the link, not the current linkID

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-10-07 13:20:44 +11:00
Andrew Tridgell
a5f311d469 s4-dsdb: fixed behaviour of show_deleted and show_recycled control
to correctly implement the show_deleted and show_recycled control we
need to know if the recyclebin is enabled. When not enabled, the
isRecycled attribute is ignored, and only isDeleted is used.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-10-07 13:20:44 +11:00
Andrew Tridgell
365f705345 s4-dsdb: fixed the check_optional_feature() call
the dsdb_check_optional_feature() call should look on our own NTDS DN
for the enabled feature. This should work for all features, not just
for forest wide fetaures.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-10-07 13:20:44 +11:00
Andrew Tridgell
d7f617e2e1 s4-dsdb: allow deletion of backlinks if DSDB_CONTROL_DBCHECK given
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-10-06 14:34:22 +11:00
Andrew Tridgell
c2d70af1a7 s4-dsdb: added DSDB_CONTROL_DBCHECK
this will be used for overrides by the dbcheck validator

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-10-06 14:34:22 +11:00
Andrew Tridgell
2d63789e48 s4-dsdb: allow groupType update on deleted objects
this allows dbcheck to fix groupType on objects that have been deleted

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-10-06 14:34:21 +11:00
Andrew Tridgell
8976e1d50d s4-rodc: use the rodc_replica flag on the partition
this sets DSDB_REPL_FLAG_PARTIAL_REPLICA when replicating a RODC
partition, which tells the replication code to map instanceType to
remove the INSTANCE_TYPE_WRITE bit

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-10-06 14:34:21 +11:00
Andrew Tridgell
2a2deeb3b4 s4-rodc: ensure we load replicated partitions for RODCs
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-10-06 14:34:21 +11:00
Andrew Bartlett
e717af0301 s4-dsdb: Do not assume that all deleted objects have an objectCategory and sAMAccountType
Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Thu Oct  6 03:43:13 CEST 2011 on sn-devel-104
2011-10-06 03:43:13 +02:00
Andrew Bartlett
f55328a295 dsdb: Do not attempt to resolve conflicts on an RODC 2011-10-06 02:11:34 +02:00
Andrew Bartlett
55054182b2 dsdb: fix double-free in replication failure case on RODC 2011-10-06 02:11:34 +02:00
Andrew Bartlett
5c5d869975 s4-dsdb Allow repl server to start even when no master NCs are present 2011-10-06 02:11:34 +02:00
Andrew Tridgell
8905344bad s4-dsdb: fixed re-join of subdomain
if we repeat the join of a subdomain then we try to re-create the NC
for the subdomain during a DsAddEntry(). This allows that re-creation
to succeed if the NC already exists
2011-10-04 15:08:58 +11:00
Andrew Tridgell
e9758ef94d s4-dns: add all forest DCs to named.conf.update
this allows all DCs to update DNS entries
2011-10-04 15:08:58 +11:00
Andrew Tridgell
6356f4c255 s4-kcc: if we are a GC, auto-add partial replicas
when we are a global catalog server, the KCC needs to add partial
replicas for all domain partitions that we don't have copies of
2011-10-04 15:08:57 +11:00
Andrew Tridgell
278e44cf9f s4-dsdb: simplify samdb_is_gc()
we already have a function for returning the NTDS options
2011-10-04 15:08:57 +11:00
Andrew Tridgell
f469369fdf s4-dsdb: add the DSDB_CONTROL_PARTIAL_REPLICA when needed
when we are adding an object via DRS, we need to add the
DSDB_CONTROL_PARTIAL_REPLICA control if we are replicating a partial
replica, so ensure the partition module creates new NCs as partial
replicas
2011-10-04 15:08:57 +11:00
Andrew Tridgell
b930b1e1fc s4-repl: try harder to find the right SPN in replication server
when doing DRS between domains, using the right SPN is essential so
the KDC can generate referrals to point us at the right DC.  We prefer
the GC/hostname/DNSDOMAIN form if possible, but if we can't find the
hostname then this changes the code that generates the target
principal name to use either the msDS-HasDomainNCs or hasMasterNCs
attributes to try to find the target DC domainname so we can use the
E3514235-4B06-11D1-AB04-00C04FC2DCD2/GUID/DNSDOMAIN SPN form.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-10-04 15:08:57 +11:00
Andrew Tridgell
60cbc98051 s4-dsdb: added new control DSDB_MODIFY_PARTIAL_REPLICA
this control tells the partition module that the DN being created is a
partial replica, so it should modify the @PARTITION object to add the
partialReplica attribute

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-10-04 15:08:57 +11:00
Andrew Tridgell
1870fc49dd s4-dsdb: added DSDB_REPL_FLAG_ADD_NCNAME flag 2011-10-04 15:08:57 +11:00
Andrew Tridgell
50d6a76a14 s4-dsdb: fixed formatting of a debug message
another missing newline
2011-10-04 15:08:57 +11:00
Andrew Tridgell
d12309dc1a s4-partition: allow creation of uninstantiated partitions
this is needed for a subdomain join by a new NC. The NC is initially
uninstantiated
2011-10-04 15:08:56 +11:00
Andrew Tridgell
f52d8ca023 s4-dsdb: allow uninstantiated NC heads
this allows INSTANCE_TYPE_WRITE to be not set if
INSTANCE_TYPE_UNINSTANT is set
2011-10-04 15:08:56 +11:00
Andrew Tridgell
faf8581e38 s4-repl: support creation of new NCs via DsAddEntry
this adds a flag to dsdb_origin_objects_commit that tells it to create
a new NC based on the nCName in a crossRef object
2011-10-04 15:08:56 +11:00
Andrew Tridgell
df3cc35f74 s4-repl: fixed formatting of some debug messages 2011-10-04 15:08:56 +11:00
Andrew Tridgell
761fd4af2e s4-repl: update instanceType in partial_replica replication
when we receive objects to a partial replica, we need to change the
incoming instanceType to not include the INSTANCE_TYPE_WRITE
flag. Partial replicas unset this flag.
2011-10-04 15:08:56 +11:00
Andrew Tridgell
f37e81bbc5 s4-repl: add FULL_SYNC and PARTIAL_REPLICA flags
this sets the appropriate flags for replication with FULL_SYNC and
partial replica replications
2011-10-04 15:08:56 +11:00
Andrew Tridgell
bdc93190fe s4-dsdb: implement DSDB_REPL_FLAG_PRIORITISE_INCOMING
With this set, we accept changes even if they have the same tuple as
the local copy. This can be used by a FULL_SYNC replication to recover
a replica that is corrupt
2011-10-04 15:08:56 +11:00
Andrew Tridgell
f45147b2d9 s4-dsdb: disallow changes based on instanceType
if instanceType does not include INSTANCE_TYPE_WRITE, then disallow
changes to any replicated attributes. This ensures partial replicates
are not alterered
2011-10-04 15:08:56 +11:00
Andrew Tridgell
d3fa49663f s4-dsdb: added DSDB_REPL_FLAG* to replication
this allows the replication server to control replication via a set of
flags. Initial flags will allow control for partial replications and
full_sync support
2011-10-04 15:08:55 +11:00
Andrew Bartlett
d40fe50a67 build: avoid util.h as a public header name due to conflict with MacOS 2011-09-23 09:24:03 +02:00
Andrew Tridgell
516f32654a s4-repl: remove unused principal_name element 2011-09-22 10:00:49 +10:00
Andrew Tridgell
aba856c666 s4-dsdb: load the partialReplica attribute in the @PARTITION object
this modifies the partition module to honor a partialReplica attribute
on the @PARTITION module, marking partiations as partial replicas so
the NO_GLOBAL_CATALOG control can be honoured
2011-09-22 10:00:49 +10:00
Andrew Tridgell
8c3d77d84c s4-repl: fill in GUID and SID from partition information
when we find a NC via a DN string, fill in the GUID and SID so the
caller can properly report them
2011-09-22 10:00:49 +10:00
Andrew Tridgell
783ff68628 s4-kcc: return partial replica NCs in drs showrepl
the showrepl operation should return all our replicated NCs, including
partial replicas
2011-09-22 10:00:48 +10:00
Andrew Tridgell
00ef18f19c s4-dsdb: added NO_GLOBAL_CATALOG control
this control is used to ask samdb to not return searches with a basedn
in partial repica partitions, which is needed to support the
difference between a search on the 3268 GC ldap port and the non-GC
389 port
2011-09-22 10:00:48 +10:00
Andrew Tridgell
7da636f33a s4-dsdb: get GUID and SID for DSA from extended DN
this allows us to use the DN from a hasPartialReplicaNCs attribute to
create a reps1 object
2011-09-22 10:00:48 +10:00
Andrew Tridgell
2b929b0b51 s4-dsdb: enable initial replication of partitions via DsReplicaSync
we need to create a temporary dsa object to allow the replication task
to replicate a NC that is not listed in a repsFrom attribute
2011-09-22 10:00:48 +10:00
Andrew Tridgell
86f5ecdc0c s4-repl: get NCs to replicate from our NTDS object
we need to use the hasMasterNCs and hasPartialReplicaNCs attributes on
our NTDS object to get the list of NCs to replicate, instead of using
the rootDSE. This is needed to support replicating of GC partial
replicas, which are not listed in the rootDSE
2011-09-22 10:00:48 +10:00
Andrew Tridgell
4efb4ebe63 s4-dsdb: added support for replicating with GC partial attribute set
if we are replicating a partial replica, then we need to supply the
partial attribute set we want to replicate to the server
2011-09-22 10:00:48 +10:00
Andrew Tridgell
677600fb7f s4-dsdb: failing to find the object is not an error in dsdb_loadreps()
we may not have replicated the partition yet, so this should be
considered the same as having no repsFrom/repsTo
2011-09-22 10:00:48 +10:00
Andrew Tridgell
9d98461150 s4-dsdb: cope with out of sync replication attributes in partition module
if the @ATTRIBUTES or other objects which are replicated between
partions become out of sync, then the ldb would fail to open. This
changes ensures that we can always fix those records, by running the
operation in the top level partition, and replicating the result to
the other partitions

Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Mon Sep 19 04:31:48 CEST 2011 on sn-devel-104
2011-09-19 04:31:48 +02:00
Andrew Tridgell
966b5d5de2 pyldb: fixed places where we try to concatenate a Dn with a string
you need to either use str(dn) or use %s in a format string
2011-09-19 10:57:03 +10:00
Andrew Tridgell
4577ee1f95 s4-dsdb: use get_config_basedn() in python tests
we can't just append CN=Configuration to the basedn, as that won't
give the right configuration DN for a subdomain of a forest

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-09-19 10:57:03 +10:00
Andrew Tridgell
cea37b0d6d s4-drs: cope with REPL_OBJ getncchanges call for new object
when we do a subdomain join we create a new object using a REPL_OBJ
getncchanges call for the partitions DN. This has a side effect of
creating that object. We need to skip the UDV update in that case

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-09-19 10:57:02 +10:00
Andrew Tridgell
e0c5f1c1ab s4-cracknames: use consistent search for crossRef objects
This matches the search in other places

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Thu Sep  8 05:02:54 CEST 2011 on sn-devel-104
2011-09-08 05:02:54 +02:00
Andrew Tridgell
de318e58b0 s4-dsdb: prevent crash on bad DN in construct_parent_guid()
this was found by a flakey test in autobuild
2011-09-08 03:35:27 +02:00
Andrew Tridgell
1e9573fe4d s4-dsdb: fixed compiler warning
sid can be const

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-09-08 03:35:27 +02:00
Amitay Isaacs
2fc233b78f s4-kcc: Fix the list of NCs for DRS replica information
AD DNS partitions (DomainDnsZones and ForestDnsZones) are listed
under msDs-hasMasterNCs attribute for post-2003 windows servers.
2011-09-07 12:16:40 +02:00
Andrew Tridgell
50648760e7 s4-cracknames: fixed cracknames to use more specific search
this uses the bitwise comparison ldap operators to ensure we only get
NC roots

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Mon Sep  5 12:48:39 CEST 2011 on sn-devel-104
2011-09-05 12:48:39 +02:00
Andrew Bartlett
1afeb4e391 s4-schema consolidate schema handling
It also creates a single routine dsdb_load_ldb_results_into_schema()
to handle cases where the schema is in the form of an ldb_result.

Andrew Bartlett
2011-09-05 11:19:25 +02:00
Andrew Bartlett
fe754cc7ac s4-dsdb Print clearer error messages when invalid account flags are specified on add 2011-09-05 11:25:38 +10:00
Andrew Bartlett
f81bb8df67 s4-dsdb Return ACL errors as ldb_errstring()
This string is reported to the caller, which makes debugging much easier.

Andrew Bartlett
2011-08-26 14:06:07 +02:00
Andrew Tridgell
68a42bd762 s4-dsdb: fixed use of RMD flags in ldb search in dirsync module
I'm pretty sure a SHOW_DELETED was wanted here

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Thu Aug 25 01:10:13 CEST 2011 on sn-devel-104
2011-08-25 01:10:13 +02:00
Andrew Tridgell
345220b762 s4-dsdb: fixed newlines in DEBUG() calls in cracknames
Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>
2011-08-25 07:39:39 +10:00
Andrew Tridgell
4f421d0406 s4-acl: use dnsforest not dnsdomain for GC names 2011-08-25 07:39:39 +10:00
Andrew Tridgell
5a9dc1d216 s4-repl: fixed _msdcs DNS name
another multi-domain fix
2011-08-25 07:39:38 +10:00
Andrew Tridgell
484fb303ff s4-kcc: fixed _msdcs DNS name
we need to base this DNS name on the forest DNS name for multi-domain
support

Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>
2011-08-25 07:39:38 +10:00
Andrew Tridgell
9784fbc378 s4-dsdb: added samdb_ntds_msdcs_dns_name()
this gets the DNS name for a NTDS GUID, based on the forest DNS name

Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>
2011-08-25 07:39:38 +10:00
Andrew Tridgell
27656e9123 s4-dsdb: fixed calls to ldb_val_string_cmp()
wrong order of arguments
2011-08-25 07:39:38 +10:00
Andrew Tridgell
9f404b3dea s4-dsdb: added samdb_dn_to_dns_domain()
this converts a DC into the equivalent DNS domain. It is used when
forming t_msdcs NTDS DNS names

Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>
2011-08-25 07:39:38 +10:00
Andrew Tridgell
bcbb35b088 s4-dsdb: assert that base DNs are used correctly
this will catch future programmer errors with incorrect base DNs

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-08-25 07:39:38 +10:00
Andrew Tridgell
1216649772 s4-dsdb: enforce NULL DN validity in partition module
windows does not allow a search on the empty DN except for rootDSE
searches or for phantom_root searches (ie. with --cross-ncs). By
enforcing this in Samba we make it more likely that our tests and
utilities will work against windows

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-08-25 07:39:38 +10:00
Andrew Tridgell
171c3cdd4a s4-dsdb: fixed basedn in extended_dn_in module
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-08-25 07:39:38 +10:00
Andrew Tridgell
68ff9ecd01 s4-dsdb: cleanup use of NULL vs base DN in samldb
NULL should be used when doing all partition searches. The default
basedn should be used when wanting just the domain NC

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-08-25 07:39:37 +10:00
Andrew Tridgell
4744c12d2c s4-dsdb: removed unused function in ACL module
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-08-25 07:39:37 +10:00
Andrew Tridgell
559d92a8df s4-dsdb: fixed all partitions search in cracknames
when searching all partitions we must use the NULL basedn, or we will
miss partitions in multi-domain setups

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-08-25 07:39:37 +10:00
Jelmer Vernooij
c292599240 samdb: Install header file. 2011-08-21 03:22:05 +02:00
Jelmer Vernooij
292fe74971 credentials: Rename library to samba-credentials to avoid name clashes.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Thu Aug 18 22:16:38 CEST 2011 on sn-devel-104
2011-08-18 22:16:38 +02:00
Andrew Tridgell
46a76bc229 s4-dsdb: fixed deletion of backlinks for fl2000 DCs
when in FL 2000 we were not correctly deleting backlinks as we uses
dsdb_find_dn_by_guid() which doesn't find deleted objects. Modules
should use dsdb_module_dn_by_guid() which prevents going to the top
level, and finds deleted objects

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-08-18 09:26:59 +10:00
Andrew Tridgell
c5dc26b976 s4-dsdb: added comments and fixed backlink check in repl_meta_data
added comments explaining the backlink deletion code, plus fix a use
of a bitwise operation in a boolean expression, and avoid calling
dsdb_functional_level() inside a loop

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-08-18 09:26:59 +10:00
Andrew Tridgell
16fa0f68bd s4-dirsync: use dsdb_module_dn_by_guid() not dsdb_find_dn_by_guid() in modules
this prevents us going to the top level of the module stack

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-08-18 09:26:59 +10:00
Simo Sorce
f364daed22 s4:dsdb: use tevent_ fn names instaed of legacy event_ ones 2011-08-13 09:54:15 -04:00
Amitay Isaacs
ae65b971ac s4-dsdb: Provide additional method to connect to specified database path
samdb_connect() now calls samdb_connect_url() with default "sam.ldb".

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-08-13 12:30:50 +10:00
Andrew Bartlett
11698a287e s4-dsdb ensure we honour the hash_values control, even for really odd hashes 2011-08-13 12:30:49 +10:00
Andrew Bartlett
2d6e98e5c8 s4-dsdb Give a less worrying error message on failure to get a transaction 2011-08-13 12:30:49 +10:00
Andrew Bartlett
2993113a56 s4-dsdb Add ability to force a particular SID in the upgrade case 2011-08-13 12:30:49 +10:00
Andrew Bartlett
c5e41a21dd s4-dsdb Add flag to set DSDB_BYPASS_PASSWORD_HASH control 2011-08-13 12:30:48 +10:00
Andrew Tridgell
fb490d88c1 s4-dsdb: don't cache the NTDS settings DN
this DN can change due to a server rename, so we cannot cache it. It
is set by provision, but not anywhere else.

This seems to not have a large performance impact

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-08-12 04:00:07 +02:00
Andrew Tridgell
ccba16c4b8 s4-dsdb: expand dsServiceName from GUID form at runtime
this allows dsServiceName to be stored as an extended DN or GUID form
in @ROOTDSE, and its string form will be found at runtime.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-08-12 04:00:07 +02:00
Andrew Tridgell
f7902d766a s4-dsdb: remove the naming_fsmo and pdc_fsmo modules
these are not needed now that the rootdse modules calculates the
validFSMOs attribute at runtime

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-08-12 04:00:07 +02:00
Andrew Tridgell
f9d10a304d s4-dsdb: calculate validFSMOs at runtime instead of pre-computing
this changes the rootdse to compute the validFSMOs attribute at
runtime by checking the fSMORoleOwner attribute on the appropriate
DN. This avoids the need for the pdc_fsmo and naming_fsmo modules.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-08-12 04:00:07 +02:00
Matthias Dieter Wallnöfer
4a5e9cf0ed s4:subtree_rename LDB module - fix the move/rename constraints
s4:subtree_rename LDB module - fix the move/rename constraints

By the inspiration of an email request by ekacnet I have rechecked the
move/rename constraints and re-read the chapter 3.1.1.5.4.1 located in the
MS-ADTS technical documentation.
It really turns out that the constraint checking is only performed on
the root object of a request.

In addition add my copyright notice (I've written these constraint checks).

Autobuild-User: Matthieu Patou <mat@samba.org>
Autobuild-Date: Wed Aug 10 01:05:19 CEST 2011 on sn-devel-104
2011-08-10 01:05:19 +02:00
Matthieu Patou
dd902164d2 s4-dsdb: avoid printing a pointless debug line 2011-08-10 01:44:44 +04:00
Matthieu Patou
87e7802722 s4-drsuapi: crackname search also for deleted objects 2011-08-10 01:44:43 +04:00
Andrew Bartlett
e2733d362d s4-dsdb clarify that failure to load the schema items from DRS is expected
This happens if we have a custom schema - we need to build up the schema until
it loads, by converting more objects.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Tue Aug  9 13:10:25 CEST 2011 on sn-devel-104
2011-08-09 13:10:25 +02:00
Andrew Bartlett
b206a365ea move schema_fill_constructed() call to dsdb_setup_sorted_accessors() 2011-08-09 11:56:23 +02:00
Andrew Bartlett
dee678a7be s4-dsdb Remove unused schema function 2011-08-09 11:56:23 +02:00
Andrew Tridgell
0e9cf380ea s4-dsdb: added SAMDB_INDEXING_VERSION to @INDEXLIST
this can be used to force re-indexing of samdb when we change
something that affects index comparison, in this case the
canonicalisation of booleans

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-08-09 11:56:23 +02:00
Andrew Tridgell
6853b3a805 s4-dsdb: fixed booling conversion to check value length
this ensures we don't look past the end of the data

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-08-09 11:56:23 +02:00
Andrew Tridgell
4ede333f46 s4-dsdb: add auto-normalisation of attributes
this auto-normalises some attributes when they are added/modified. The
list that we auto-normalise is currently:

Boolean
INT32
INTEGER
UTC_TIME

This fixes a problem with groupType being stored in an unnormalised
form

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-08-09 11:56:23 +02:00
Andrew Tridgell
2ba18d89eb s4-dsdb: ensure rIDSetReferences is stored as an extended DN
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-08-09 11:56:23 +02:00
Andrew Tridgell
55b25e1e23 s4-dsdb: ensure we setup the dn_format field in schema attributes
this ensures we setup dn_format when we do runtime schema changes

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-08-09 11:56:23 +02:00
Andrew Tridgell
6ef36a0e6a s4-acl-test: use symbolic names for groupType
clearer than magic numbers
2011-08-09 11:56:23 +02:00
Andrew Tridgell
fd04a38d50 s4-dsdb: make extended_dn_in a bit more efficient
checking filter elements in the right order makes it a little faster
2011-08-09 11:56:23 +02:00
Andrew Tridgell
8ce8107a5b s4-dsdb: use dn_format shortcut to find DN format
this saves some string comparisons
2011-08-09 11:56:23 +02:00
Jelmer Vernooij
fdff105854 pyldb: Consistently use pyldb_ prefix. 2011-08-07 17:08:56 +02:00
Andrew Tridgell
37799b0644 s4-dsdb: extend the extended_dn_in module to handle DN links
this replaces DN components in incoming filter expressions with the
full extended DN of the target, which allows search expressions based
on <GUID=> and <SID=> DNs, as well as fixing the problem with one-way
links in search expressions

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-08-04 16:17:25 +10:00
Andrew Tridgell
7b5f0a7120 s4-dsdb: handle search expressions containing extended DNs
this allows for searches like member=<SID=S-1-2-3>

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>
2011-08-04 16:17:25 +10:00
Andrew Tridgell
d4a1f6a42b s4-dsdb: added dn_format attribute of a dsdb_attribute
this is faster than string comparisons during searches at runtime

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>
2011-08-04 16:17:25 +10:00
Andrew Tridgell
d669e83857 s4-dsdb: fixed outgoing one way link DNs
when we return a DN which is a one way link, fix the string DN
component by searching for the GUID and replacing the DN components

Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-08-04 16:17:24 +10:00
Andrew Tridgell
a74f4673ed s4-dsdb: setup a one_way_link attribute on schema attributes
this allows us to quickly determine if a DN is a one way link

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>
2011-08-04 16:17:24 +10:00
Andrew Tridgell
fc40769b64 s4-dsdb: fixed a warning on dsdb_delete()
struct ldb_dn is never const

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>
2011-08-04 16:17:24 +10:00
Andrew Tridgell
d10553a51c s4-dsdb: make requests for STORAGE_FORMAT control non-critical
this allows us to use dsdb_module_dn_by_guid() from levels below the
extended_dn_out module

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>
2011-08-04 16:17:24 +10:00
Andrew Bartlett
35b309fa0c gensec: clarify memory ownership for gensec_session_info() and gensec_session_key()
This is slightly less efficient, because we no longer keep a cache on
the gensec structures, but much clearer in terms of memory ownership.
Both gensec_session_info() and gensec_session_key() now take a mem_ctx
and put the result only on that context.

Some duplication of memory in the callers (who were rightly uncertain
about who was the rightful owner of the returned memory) has been
removed to compensate for the internal copy.

Andrew Bartlett
2011-08-03 18:48:02 +10:00
Jelmer Vernooij
cdc146d0c4 remove unnecessary dependency on 'events' from ldb modules. 2011-08-01 17:48:30 +02:00
Matthieu Patou
ff1907012a s4-kcc: correctly populate the neighbor object when taking information from repsTo
Autobuild-User: Matthieu Patou <mat@samba.org>
Autobuild-Date: Sun Jul 31 00:17:17 CEST 2011 on sn-devel-104
2011-07-31 00:17:17 +02:00
Matthieu Patou
326e2dd681 s4-dsdb: Improve the calculation of system flags according to 3.1.1.5.2.4 2011-07-26 23:34:24 +02:00
Andrew Tridgell
a2c425858b s4-kcc: use dsdb_delete() instead of ldb_delete()
this adds the DSDB_SEARCH_SHOW_DELETED flag, which fixes deletion of
deleted objects

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-07-21 11:44:36 +10:00
Andrew Tridgell
114377a91f s4-dsdb: added dsdb_delete() function
this gives us a delete function that takes the standard set of dsdb
flags

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-07-21 11:44:36 +10:00
Matthieu Patou
72ca5c39c9 s4-dsdb: Use controls provided during the request while searching for object to delete
If the parent request specify the show_deleted control we must use it in
order to be able to see the deleted objects.

Also we just allow to trusted connections with the system account to
remove deleted objects, others receive an unwilling to perform.
2011-07-21 11:44:35 +10:00
Matthieu Patou
6362c9c30d s4-dsdb: check group membership only for non deleted objects
Group membership has been already removed on deleted objects so there is
no mean doing something on this kind of object.
2011-07-21 11:44:34 +10:00
Matthieu Patou
930fa1ee46 update/add my copyright 2011-07-21 11:44:33 +10:00
Matthieu Patou
9a1dd24ced s4-dsdb: In rootdse add extended dn info on all values for a given attribute
And not only on the fist value as it was the case up to this changeset.
2011-07-21 11:44:33 +10:00
Matthieu Patou
245f4b22f4 s4-dsdb: add dsdb_module_extended function similar to other dsdb_module_* functions 2011-07-21 11:44:33 +10:00
Matthieu Patou
b1ffe82fac s4-schema: add systemFlags to dsdb classes objects 2011-07-21 11:44:33 +10:00
Dave Craft
1838e16f34 Add intrasite code test switch
kcc_service struct gets a intrasite_code
boolean that is filled in via parametric parameter
kccsrv:intrasite = [true/false] in smb.conf.   This
will allow us to continue to utilize old simple
KCC topology as continuing default while newer
intra-site topology matures further.

Signed-off-by: Andrew Tridgell <tridge@samba.org>

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Thu Jul 14 00:19:12 CEST 2011 on sn-devel-104
2011-07-14 00:19:12 +02:00
Dave Craft
c8413b3420 Add kccsrv_add_repsFrom() possibility of NULL res argument
We need the ability to utilize this function in a different
manner.  KCC intra-site topology has already vetted the
replica as being appropriate to produce a repsFrom from.
We do not want kccsrv_add_repsFrom() to produce further
checking as was the case for simple topology.   Thus if
we pass a NULL (res) parameter this extra check will
be skipped.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-14 07:05:10 +10:00
Dave Craft
4b19415f5b Remove static to allow availability to other KCC files
kccsrv_replica_flags() and
kccsrv_add_repsFrom() need to be available to functions
outside kcc_periodic.c

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-14 07:05:10 +10:00
Dave Craft
f6c90dfeba kcc_connection invocation_id added to struct
Utilized by KCC to carry the invocation id of the NTDSDSA
that we are replicating the name context from.  Utilized
when NTDSConnection is created (much like dsa_guid tracks
the NTDSDSA objectGUID that we are replicating the name
context from).

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-14 07:05:10 +10:00
Dave Craft
4dea78d508 KCC NTDSConnection should utilize NTDSCONN_OPT_IS_GENERATED
Previously this set an explicit (0x1) value whereas it
can now utilize NTDSCONN_OPT_IS_GENERATED from flags.h

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-14 07:05:09 +10:00
Dave Craft
0d1c54ecaf Standalone samdb_ntds_site_settings_options() helper
A helper function for retrieving the ntds site settings
via standalone function call.  Used within KCC

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-14 07:05:09 +10:00
Dave Craft
b52246bf2f NTDSConnection and NTDSA Site setting flags
Flags that were missing from flags.h or were incorrectly
defined inline to the kcc_topology.c code (and thus unusable
elsewhere).   These are the NTDSConnection and NTDSDSA Site
settings flags.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-14 07:05:09 +10:00
Andrew Tridgell
3dae32397a s4-dsdb: fixed the defaultObjectCategory to have a full GUID
this fixes the DN to have a full GUID for new objects

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Wed Jul 13 14:03:30 CEST 2011 on sn-devel-104
2011-07-13 14:03:30 +02:00
Andrew Tridgell
80c8f42f05 s4-dsdb: another special case for the "member" attribute
thanks to Matthias for his great test suite work!

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-07-13 12:51:05 +02:00
Andrew Bartlett
43c0a92d23 s4-dsdb Don't process deletion of member attributes here.
We don't need to compare the delete against the primaryGroupID check
here - that test is for adds.

Andrew Bartlett
2011-07-13 12:51:05 +02:00