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

1916 Commits

Author SHA1 Message Date
Anatoliy Atanasov
7200c25646 Revert "s4-rodc: Fix provision warnings by creating ntds objectGUID in provision"
This reverts commit c3cbb846d0.
The fix is not correct, we should cache a bool to answer amIRODC
2010-05-11 12:54:18 +03:00
Stefan Metzmacher
8489934ce3 Revert "s4:password_hash LDB module - don't break the provision"
This reverts commit 6276343ce1.

This is not needed anymore.

metze
2010-05-11 08:38:26 +02:00
Stefan Metzmacher
ad5b9ae8dc Revert "s4:password hash LDB module - check that password hashes are != NULL before copying them"
This reverts commit fa87027592.

This check is done one level above now.

metze
2010-05-11 08:38:02 +02:00
Stefan Metzmacher
8ff38004e8 s4:dsdb/password_hash: only try to handle a hash in the unicodePwd field if it's given
Sorry, I removed this logic while cleaning up indentation levels...

metze
2010-05-11 08:37:03 +02:00
Matthias Dieter Wallnöfer
56421886de s4:password_hash LDB module - we might not have a cleartext password at all
When we don't have the cleartext of the new password then don't check it
using "samdb_check_password".
2010-05-10 23:50:03 +02:00
Matthias Dieter Wallnöfer
4f25baecc1 s4:password_hash LDB module - quiet a warning 2010-05-10 20:04:37 +02:00
Matthias Dieter Wallnöfer
fa87027592 s4:password hash LDB module - check that password hashes are != NULL before copying them 2010-05-10 20:02:21 +02:00
Matthias Dieter Wallnöfer
6276343ce1 s4:password_hash LDB module - don't break the provision
This is to don't break the provision process at the moment. We need to find
a better solution.
2010-05-10 19:51:31 +02:00
Matthias Dieter Wallnöfer
029351571a s4:samdb_set_password - adapt it for the user password change handling
Make use of the new "change old password checked" control.
2010-05-10 19:12:26 +02:00
Matthias Dieter Wallnöfer
6e8098b261 s4:samdb_set_password/samdb_set_password_sid - Rework
Adapt the two functions for the restructured "password_hash" module. This
means that basically all checks are now performed in the mentioned module.

An exception consists in the SAMR password change calls since they need very
precise NTSTATUS return codes on wrong constraints ("samr_password.c") file
2010-05-10 19:07:46 +02:00
Stefan Metzmacher
fc8e3ffb5f s4:password_hash - Implement password restrictions
Based on the Patch from Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de>.

metze
2010-05-10 18:06:54 +02:00
Matthias Dieter Wallnöfer
6a69ec2f5a s4:password_hash - Rework to handle password changes
- Implement the password restrictions as specified in "samdb_set_password"
  (complexity, minimum password length, minimum password age...).
- We support only (administrative) password reset operations at the moment
- Support password (administrative) reset and change operations (consider
  MS-ADTS 3.1.1.3.1.5)
2010-05-10 18:06:24 +02:00
Matthias Dieter Wallnöfer
12c4b09fd5 s4:password_hash - Rework unique value checks
Windows Server performs the constraint checks in a different way than we do.
All testing has been done using "passwords.py".
2010-05-10 17:54:16 +02:00
Matthias Dieter Wallnöfer
3ce4a0c5f2 s4:password_hash - Various (mostly cosmetic) prework
- Enhance comments
- Get some more attributes from the domain and user object (needed later)
- Check for right objectclass on change/set operations (instances of
  "user" and/or "inetOrgPerson") - otherwise forward the request
- (Cosmetic) cleanup in asynchronous results regarding return values
2010-05-10 17:54:15 +02:00
Matthias Dieter Wallnöfer
726fb35f9f s4:dsdb: add new controls
- Add a new control for getting status informations (domain informations,
  password change status) directly from the module
- Add a new control for allowing direct hash changes
- Introduce an addtional control "change_old password checked" for the password
2010-05-10 17:54:15 +02:00
Anatoliy Atanasov
c3cbb846d0 s4-rodc: Fix provision warnings by creating ntds objectGUID in provision 2010-05-10 17:24:02 +03:00
Matthias Dieter Wallnöfer
e2806f9e4d s4:acl ldb module - fix typos 2010-05-10 12:39:44 +02:00
Matthias Dieter Wallnöfer
946993238f s4:dsdb/util.c - Add a new function for retrieving password change attributes
This is needed since we have not only reset operations on password fields
(attributes marked with REPLACE flag) but also change operations which can be
performed by users itself. They have one attribute with the old value marked
with the REMOVE flag and one with the new one marked with the ADD flag.
This function helps to retrieve them (argument "new" is used for the new
password on both reset and change).
2010-05-10 12:20:27 +02:00
Matthias Dieter Wallnöfer
1cdc46a90a s4:samldb LDB module - make "samldb_member_check" synchronous again 2010-05-09 20:26:31 +02:00
Matthias Dieter Wallnöfer
4153da4069 s4:samldb LDB module - make "samldb_prim_group_users_check" synchronous again 2010-05-09 19:16:13 +02:00
Matthias Dieter Wallnöfer
d91ee0b095 s4:samldb LDB module - update the copyright notice 2010-05-09 19:16:12 +02:00
Andrew Bartlett
6dfa851ce9 s4:dsdb Provide an intelegent fallback if not CN=Subnets is found
We may as well fall back rather than return NULL (which callers don't
do useful things with).

Andrew Bartlett
2010-05-09 21:18:52 +10:00
Stefan Metzmacher
435ce8ebd7 dsdb/password_hash: remove usage of msDs-KeyVersionNumber
metze
2010-05-09 21:18:52 +10:00
Andrew Bartlett
7b11ce738d s4:dsdb Use replPropertyMetaData as the basis for msDS-KeyVersionNumber
This means that the existing kvno will no longer be valid, all
unix-based domain members may need to be rejoined, and
upgradeprovision run to update the local kvno in
secrets.ldb/secrets.keytab.

This is required to match the algorithm used by Windows DCs, which we
may be replicating with.  We also need to find a way to generate a
reasonable kvno with the OpenLDAP backend.

Andrew Bartlett
2010-05-09 21:18:52 +10:00
Anatoliy Atanasov
f84aeea739 s4/rodc: Support read-only database
Check on modify if we are RODC and return referral.
On the ldap backend side now we pass context and ldb_modify_default_callback
to propagate the referral error to the client.
2010-05-04 18:32:18 +02:00
Anatoliy Atanasov
bcdaa23798 s4/rodc: Fix the callbacks up the stack to handle referrals on modify requests 2010-05-04 18:31:47 +02:00
Anatoliy Atanasov
d3081741c9 s4/rodc: Implement msDS-isRODC constructed attr 2010-05-03 18:28:00 +02:00
Nadezhda Ivanova
e2e39117bc Replaced DS_FLAG_ATTR_IS_CRITICAL with SCHEMA_FLAG_ATTR_IS_CRITICAL. 2010-05-03 16:47:56 +02:00
Nadezhda Ivanova
15b42d6515 Added a function to check if an attribute can belong to a filtered replica. 2010-05-03 14:50:10 +02:00
Andrew Bartlett
dfd7ad2083 s4:dsdb Fix use of memory after free in repl_meta_data
The upgraded link values are were allocated on tmp_ctx, and need to be
kept until they are written to the DB.  If we don't give the correct
context, they will be gone after the talloc_free(tmp_ctx).

Found by Matthieu Patou <mat+Informatique.Samba@matws.net>

Andrew Bartlett
2010-05-01 22:20:25 +10:00
Anatoliy Atanasov
dbbbc7d1f8 s4/rodc: RODC FAS initial implementation 2010-04-29 10:18:06 +03:00
Kamen Mazdrashki
59830d0a6e s4/dsdb: schemaInfo revision may be 0
In case schemaInfo value is still not set, WinAD supplies
schemaInfo blob with revision = 0 and GUID_ZERO
2010-04-29 04:54:07 +03:00
Kamen Mazdrashki
a8438015ca s4/dsdb: remove unused dsdb_schema_info_create() function 2010-04-29 04:54:07 +03:00
Kamen Mazdrashki
2264d917ae s4/dsdb: Update Schema cache with updated schemaInfo value
Error checking is simplified and my leave leeks.
I did it this way to make code more readable, and if we
get error in those lines, it will be WERR_NOMEM in which
case we are in a much deeper troubles than delayed freeing
of few bytes.
2010-04-29 04:54:07 +03:00
Kamen Mazdrashki
e41eac96af s4/samldb: Create initial schemaInfo value if it doesn't exists yet 2010-04-29 04:54:06 +03:00
Kamen Mazdrashki
546a727bd3 s4/dsdb: Use default schemaInfo value when no such value is given
Having no value for schemaInfo is totally OK as it turns out.
In such cases, we should use a default value with
all fields set to 0.
2010-04-29 04:54:06 +03:00
Kamen Mazdrashki
5bf12e101a Revert "s4/dsdb: Set schemaInfo attribute value during provisioning"
This reverts commit 8149094edd.

Windows implementation does not set schemaInfo attribute value
until first Schema update request.
This way, newly provisioned forest returns no schemaInfo value.

I think it won't be bad for us to have this value preset, but
I want to mimic Win AD behavior as close as possible.
2010-04-29 04:54:05 +03:00
Kamen Mazdrashki
bf49ac99c9 s4/dsdb: dsdb_validate_invocation_id() should validate by objectGUID
This function is used in DRSUpdateRefs() implementation where we
get DSA's objectGUID rather than invocationId
2010-04-28 12:11:03 +03:00
Stefan Metzmacher
4d191b6fa7 s4:dsdb/common: if we don't have the ip of the client return the server site as client site
metze
2010-04-27 13:00:24 +02:00
Andrew Tridgell
ff2edd52cb s4-dns: call spn update command alongside dns update
call samba_spnupdate at the same time as samba_spnupdate
2010-04-27 19:27:19 +10:00
Matthias Dieter Wallnöfer
8219c4f69c s4:kcc_periodic.c - fix counter types
We are counting LDB objects here -> therefore "unsigned"
2010-04-27 08:19:10 +02:00
Matthias Dieter Wallnöfer
093d35661d s4:util - add a function which finds the matching client site using the client address
The lookup of the client site is done using the subnets in the configuration
partition. If no one matches we use the Windows Server fallback mechansim.
This means: if only one site is available just use it. If they're more set the
output variable to "".

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-04-27 15:24:41 +10:00
Andrew Tridgell
7e2b3ab14f s4-repl: added a workaround for WERR_DS_DRA_NO_REPLICA DsReplicaSync errors
The 0xc0002104/WERR_DS_DRA_NO_REPLICA seems to be spurious, and can be
avoided by setting DRSUAPI_DRS_SYNC_ALL in the DsReplicaSync request.

We need to investigate this further, and find out from MS why this is
sometimes being sent, even when the target DC has the right repsFrom
entries
2010-04-27 15:24:40 +10:00
Andrew Tridgell
b0aa476948 s4-drs: add entries to repsTo based on calculated repsFrom
This is based on the documentation: "the KCC will automatically create
the Reps-To attributes on destination DSAs based on other DSAs
Reps-From entries."
2010-04-27 10:38:59 +10:00
Andrew Tridgell
3119296e42 s4-drepl: don't setup a repsFrom from a DC that isn't a master for a NC
use hasMasterNCs to see what NCs we should be pulling from each DC
2010-04-27 10:38:59 +10:00
Andrew Tridgell
5b81962ed1 s4-repl: these messages are common, and don't deserve debug level 1
getting older attributes is quite common
2010-04-27 10:38:58 +10:00
Andrew Tridgell
8aa30f9580 s4-repl: on a failed request, clear the current ptr
this prevents the queue being stuck on failure
2010-04-27 10:38:58 +10:00
Andrew Tridgell
9b18b339c0 s4-repl: end repl request when not doing an UpdateRefs
otherwise the queue is stuck forever
2010-04-27 10:38:58 +10:00
Andrew Tridgell
5fb60bc311 s4-repl: don't delete repsTo entry on DsReplicaSync
we rely on the highestUSN counters instead. W2K8 does not resend
DsUpdateRefs each time, and the WSPP docs do not indicate that repsTo
should be deleted
2010-04-27 10:38:58 +10:00
Andrew Tridgell
5ce1dbf2e3 s4-ddb: don't create partitions with the UNINSTANT flag set
these partitions and not on the server we are replicating from. Also
check for deleted partitions.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-04-26 19:06:07 +10:00
Andrew Tridgell
a31c711ba7 s4-drs: allow getncchanges requests to non WRIT_REP partitions for extended ops
Needed for RID allocation

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-04-26 19:06:07 +10:00
Andrew Tridgell
159de40b0b s4-drepl: don't send an UpdateRefs unless its a plain replication
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-04-26 19:06:06 +10:00
Andrew Tridgell
267e0b3616 s4-drs: make links to foreign partitions non-fatal
DN links outside the set of partitions we are replication should be
allowed.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-04-26 19:06:06 +10:00
Matthieu Patou
c88b83b7c1 s4 dns: Allow to specify static grant entries to be added to the dynamicaly generated named.conf.update
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2010-04-24 14:09:10 +02:00
Andrew Tridgell
bb1ba4ff76 s4-drs: added new SECURITY_RO_DOMAIN_CONTROLLER level
This is used for allowing operations by RODCs, and denying them
operations that should only be allowed for a full DC

This required a new domain_sid argument to
security_session_user_level()

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Pair-Programmed-With: Rusty Russell <rusty@samba.org>
2010-04-22 19:36:16 +10:00
Andrew Tridgell
1f92df90fd s4-drs: removed dsdb_validate_client_flags()
This test is in the wrong place. We end up validating our own flags.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-04-22 19:36:16 +10:00
Andrew Tridgell
0d3823b152 s4-dsdb: removed an unused variable 2010-04-22 19:36:16 +10:00
Andrew Tridgell
a06b537cc3 s4-dsdb: added dsdb_validate_invocation_id()
this validates that a invocationID matches an account sid

This will be used to ensure that we don't allow DRS replication
from someone a non-DC or administrator

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-04-22 19:36:16 +10:00
Andrew Tridgell
1ecefd74a2 s4-dsdb: added dsdb_get_extended_dn_sid()
This will be used by the RODC code

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-04-22 19:36:15 +10:00
Andrew Tridgell
70cc9fd5c6 s4-dsdb: moved rodc schema validation to samldb.c
This means we are only doing the checks for schema changes

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-04-22 19:36:15 +10:00
Fernando J V da Silva
73513fb7e7 s4-drs: Use new samdb_rodc() function in s4 code
This patch fits the calling to the new samdb_rodc() function and
fix a little bug in this function.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-04-22 19:36:15 +10:00
Fernando J V da Silva
59aa0a07d2 s40-drs: Do not send GetNCChanges messages to RODCs
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-04-22 19:36:15 +10:00
Fernando J V da Silva
fbdbd67c76 s4-drs: dsdb_validate_client_flags() function
This function is intended to check if some client is not lying about
his flags. At this moment, it only checks for RODC flags.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-04-22 19:36:15 +10:00
Fernando J V da Silva
57bcdf008f s4-drs: samdb_is_rodc() function and new samdb_rodc() function
This patch creates the samdb_is_rodc() function, which looks for
the NTDSDSA object for a DC that has a specific invocationId
and if msDS-isRODC is present on such object and it is TRUE, then
consider the DC as a RODC.
The new samdb_rodc() function uses the samdb_is_rodc() function
for the local server.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-04-22 19:36:15 +10:00
Fernando J V da Silva
c023fc217e s4-drs: Do not allow system-critical attributes to be RODC filtered
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-04-22 19:36:14 +10:00
Andrew Bartlett
47e7e48746 s4:ldap-backend Fix LSA test failures with OpenLDAP backend - convert SIDs
The SIDs in some queries were not being passed as binary, but as
strings in comparison with the securityIdentifer object.  We need to
recognise that these are SIDs in the simple_ldap_map.

Andrew Bartlett
2010-04-22 18:37:19 +10:00
Andrew Bartlett
cbb818222a s4:OpenLDAP-backend Use the new rdnval module in OpenLDAP
This is rather than rdn_name, which tries to do the job on the client
side.  We need to leave this module in the stack for Fedora DS (and of
course the LDB backend).

Andrew Bartlett
2010-04-22 18:37:18 +10:00
Andrew Bartlett
9eacde808e s4:dsdb Revert accidentilly commited change for LDAP backends
In the future, LDAP backends will be resposible for maintaining the
'name' attributes.

Andrew Bartlett
2010-04-22 18:37:18 +10:00
Andrew Tridgell
2dcc84432e s4-schema: allow revision numbers of zero
w2k8r2 sends a revision of zero in the initial schema replication
during a net vampire

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-04-21 13:35:56 +10:00
Andrew Bartlett
ea5cf7ce05 s4:provision Pass in the invoication ID and NTDS Settings DN to Schema()
By putting these values into the cache on the LDB, this reduces some
of the noise in provision, particularly with the LDAP backend.

Andrew Bartlett
2010-04-20 12:11:18 +10:00
Matthias Dieter Wallnöfer
e0d6f1a6da s4:dsdb/dns/dns_update.c - fix a typo 2010-04-17 20:42:37 +02:00
Nadezhda Ivanova
eef184301a s4:Replaced dsdb_get_dom_sid_from_ldb_message() with samdb_result_dom_sid() 2010-04-16 14:28:35 +03:00
Stefan Metzmacher
a7f8c197ad s4:rootdse: only return "tokenGroups", when the client asked for them
metze
2010-04-15 19:02:26 +02:00
Jelmer Vernooij
13bbfa3fca pydsdb: Fix memory leak on invalid parameters, formatting, trivial
typos.
2010-04-15 18:45:41 +02:00
Matthieu Patou
d784ecec55 s4 python: Add a function to get the oid of an attribute when the attid is known
This function is mainly to help decoding replPropertyMetaData in python

Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
2010-04-15 18:45:41 +02:00
Matthias Dieter Wallnöfer
34ff1c6944 s4:samdb_server_site_name - fix indentation 2010-04-13 15:40:43 +02:00
Matthias Dieter Wallnöfer
a894d6cc37 s4:acl/descriptor LDB module - distinguish between root and default basedn
The first is the forest base DN, the second the domain base DN. At the moment
we assume that they are both the same but it hasn't to be so.

Nadia, I would invite you to fix the outstanding parts regarding this (I added
comments).
2010-04-13 09:32:34 +02:00
Matthias Dieter Wallnöfer
719a46913b s4:dsdb/common/util.c - add a call which determines centrally the forest DNS domainname 2010-04-13 09:32:33 +02:00
Matthias Dieter Wallnöfer
c116d80053 s4:remove "samdb_root_dn", "samdb_base_dn", "samdb_config_dn" and "samdb_schema_dn"
They aren't needed anymore.
2010-04-13 08:57:07 +02:00
Matthias Dieter Wallnöfer
ad9e407357 Revert "s4:prefer "samdb_*_dn" basedn calls over the "ldb_get_*_dn" functions"
We should use the "ldb_get_*_basedn" calls since they are available in the LDB
library.
2010-04-13 08:55:15 +02:00
Matthias Dieter Wallnöfer
8e4c34880a s4:objectclass LDB module - remove a unneeded newline 2010-04-13 08:24:09 +02:00
Matthias Dieter Wallnöfer
98ce053efd s4:prefer "samdb_*_dn" basedn calls over the "ldb_get_*_dn" functions
Purely cosmetic change.
2010-04-12 18:49:01 +02:00
Jelmer Vernooij
3a34b5f35e subunit: Remove more test output that could be interpreted by subunit. 2010-04-11 20:57:33 +02:00
Jelmer Vernooij
7da94cc4a6 subunit: Support formatting compatible with upstream subunit, for consistency.
Upstream subunit makes a ":" after commands optional, so I've fixed any
places where we might trigger commands accidently. I've filed a bug
about this in subunit.
2010-04-11 20:57:33 +02:00
Matthias Dieter Wallnöfer
568ca2433d s4:samdb_server_site_dn - free unused DNs in the right way 2010-04-11 13:20:44 +02:00
Andrew Bartlett
77267733ed s4:dsdb Don't use the permissive modify control on schemaInfo updates
The use of 'replace' is enough to wipe out the old value, whatever it
is, we don't need to set 'permissive modify' too.

Additionally, this seems to be causing trouble for the OpenLDAP backend

Andrew Bartlett
2010-04-10 21:41:57 +10:00
Andrew Bartlett
5ebeab3794 s4:dsdb Don't return operational attributes on special DNs 2010-04-10 21:41:02 +10:00
Andrew Bartlett
6ef167c37b s4:rootdse Implement "tokenGroups" in the rootDSE
This returns the currently connected user's full token.  This is very
useful for debugging, and should be used in ACL tests.

Andrew Bartlett
2010-04-10 21:41:02 +10:00
Andrew Bartlett
944dc2cb0b s4:dsdb Improve error message in extended_dn_in
This error occours when an extended DN cannot be resolved, so it's
most helpful to print the problematic extended DN.

Andrew Bartlett
2010-04-10 21:41:01 +10:00
Andrew Bartlett
4074739fe7 s4:schema Try to fix OpenLDAP backend after schema reload support.
If we can't get @REPLCHANGED, default to a value of 0.

Andrew Bartlett
2010-04-10 21:40:59 +10:00
Kamen Mazdrashki
8149094edd s4/dsdb: Set schemaInfo attribute value during provisioning
After provisioning new Forest, schemaInfo should be set
to a value with revision=1 and current invocation_id
2010-04-09 12:21:34 +03:00
Kamen Mazdrashki
4ba2ac073d s4/dsdb: split writing of schemaInfo blob in two parts
ldb_msg preparation is moved into separate function
so that it can be used for implementing schemaInfo
updates both on module stack (dsdb_module_... functions)
and directly on ldb_context
2010-04-09 12:21:33 +03:00
Kamen Mazdrashki
fbef33fb73 s4/dsdb: Let caller to control if valid invocationId is critical or zero-guid is acceptable 2010-04-09 12:21:33 +03:00
Kamen Mazdrashki
5363b6e68b s4/dsdb: Use dsdb_schema_info object to create default schemaInfo values 2010-04-09 12:21:32 +03:00
Kamen Mazdrashki
c3d7798991 s4/dsdb: Use dsdb_schema_info object to verify schema_info blobs 2010-04-09 12:21:31 +03:00
Kamen Mazdrashki
15921b669e s4/waf: add new files to WAF build 2010-04-09 12:21:31 +03:00
Kamen Mazdrashki
6d439afbf7 s4/samldb: schemaInfo attribute must be updated when adding new Schema object 2010-04-09 12:21:30 +03:00
Kamen Mazdrashki
9d1f8bcca9 s4/dsdb: dsdb_schema_info object implementation 2010-04-09 12:21:26 +03:00
Kamen Mazdrashki
37a6b66344 s4/dsdb: Define dsdb representation for schemaInfo attribute 2010-04-09 12:21:25 +03:00
Jelmer Vernooij
57ac0a6042 s4-python: Move load_partition_usn to dsdb module. 2010-04-08 23:20:36 +02:00
Endi S. Dewata
5d5fc92c69 s4:dsdb - Handle INVALID_DN_SYNTAX from OpenLDAP in dsdb_module_load_partition_usn().
Signed-off-by: Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
2010-04-08 22:59:10 +02:00
Jelmer Vernooij
2578072541 s4-python: Move set_global_schema to pydsdb. 2010-04-08 12:21:35 +02:00
Jelmer Vernooij
21ab06f8a2 s4-python: Move samdb_ntds_objectGUID to pydsdb. 2010-04-07 17:39:59 +02:00
Jelmer Vernooij
ae97613499 s4-python: Move set_opaque_integer to pyldb. 2010-04-06 13:12:43 +02:00
Andrew Tridgell
7d34210772 s4-waf: added python_dsdb from merge with master 2010-04-06 20:27:26 +10:00
Andrew Tridgell
553324bc10 s4-waf: move to a universal method of recursing into subdirs
This works with both standalone lib builds and bundled builds
2010-04-06 20:27:25 +10:00
Andrew Tridgell
b690fedef5 s4-waf: removed the AUTOGENERATED markers
we won't be using the mk -> wscript generator again
2010-04-06 20:27:16 +10:00
Andrew Tridgell
01682f797f s4-waf: fixed some deps now we don't auto-include tevent and replace
this is preparation for being able to use system versions of these
libraries
2010-04-06 20:27:12 +10:00
Andrew Tridgell
f9eae32f4b s4-waf: mark the wscript files as python so vim/emacs knows how to highlight them 2010-04-06 20:27:11 +10:00
Andrew Tridgell
844acb2260 build: waf quicktest nearly works
Rewrote wafsamba using a new dependency handling system, and started
adding the waf test code
2010-04-06 20:26:48 +10:00
Andrew Tridgell
845e0cbe6f build: commit all the waf build files in the tree 2010-04-06 20:26:48 +10:00
Andrew Tridgell
8f1b809d2c build: nearly there on samba4 build 2010-04-06 20:26:47 +10:00
Andrew Tridgell
9129c3b3b6 build: fixes from ita 2010-04-06 20:26:40 +10:00
Andrew Tridgell
c7ea3e6fbf build: source= is clearer for source lists 2010-04-06 20:26:39 +10:00
Andrew Tridgell
07eeed33f6 build: heimdal_build waf support
heimdal now mostly builds
2010-04-06 20:26:38 +10:00
Jelmer Vernooij
55aeb682ba s4-python: Move dsdb_convert_schema_to_openldap to dsdb. 2010-04-04 00:42:52 +02:00
Jelmer Vernooij
2a67eda98f s4-python: Move set_opaque_integer -> dsdb. 2010-04-04 00:40:01 +02:00
Jelmer Vernooij
8afd52a641 s4-python: Move samdb_server_site_name to dsdb module. 2010-04-04 00:21:09 +02:00
Jelmer Vernooij
31a517e172 s4-python: Move dsdb constants to a separate python module. 2010-04-04 00:14:23 +02:00
Eduardo Lima
af807758e8 s4-drs: replmd_delete with the 3 stage deletion recycle bin 2010-03-26 16:50:48 +11:00
Fernando J V da Silva
8e1d947787 s4-drs: If we are a RODC then do not send DSReplicaSync messages 2010-03-25 15:02:19 +11:00
Matthias Dieter Wallnöfer
6a63c38c12 s4:ldb_modules/util.c - fix two counter variables to be "unsigned" 2010-03-23 00:16:18 +01:00
Andrew Bartlett
f8019ff793 s4:dsdb Add a shortcut sequence number for schema reloads
This uses the ldb sequence number, in a hope to detect an unchanged
schema quicker.

Andrew Bartlett
2010-03-22 20:24:41 +11:00
Andrew Bartlett
fe3e1af901 s4:dsdb Rework schema loading and add schema reloading
This commit reworks Samba4's schema loading code to detect when it
needs to reload the schema.  This is done by watching the @REPLCHANGED
special DN.

The reload happens by means of a callback, which is only set when the
schema is loaded from the ldb - not when loaded from an LDIF file or
DRS.

We also rework the global schema handling - instead of storing the
pointer to the global schema in each ldb, we store a flag indicating
that the global schema should be returned at run time.  This makes it
much easier to switch to a new global schema.

Andrew Bartlett
2010-03-22 20:24:41 +11:00
Andrew Bartlett
d0b54476fc s4:dsdb Move dsdb_save_partition_usn() to be a module helper function
This function should not traverse the module stack again, but instead
run from this point.  Also add a matching
dsdb_module_load_partition_usn() and change repl_meta_data to match.

Andrew Bartlett
2010-03-22 20:24:41 +11:00
Andrew Bartlett
639728a298 s4:schema Expand the schema structure
We now store the location of the schema in the schema, and provide
hooks for a future schema reloading mechanism.

Andrew Bartlett
2010-03-22 20:24:41 +11:00
Andrew Bartlett
7fc94eb9a7 s4:dsdb Add 'const' to some struct dsdb_schema variables
We don't currently require this, but we may move this way in future.
2010-03-22 20:24:40 +11:00
Andrew Bartlett
fc5a507a86 s4:dsdb Don't load the schema unconditionally
Schema loads now come at a price, so avoid doing them if we don't have
to (such as when doing an @REPLCHANGED or other special DN based
search).

Andrew Bartlett
2010-03-22 20:24:40 +11:00
Andrew Bartlett
6de83ef627 s4:dsdb Move rdn_name down the stack
This is done so that it can be (in future) removed when the OpenLDAP
backend is in use and the rdn_val module is used, while keeping as
similar semantics as possible between the module stacks.

Andrew Bartlett
2010-03-18 22:05:38 +11:00
Matthias Dieter Wallnöfer
c3509d88a4 s4:resolve_oids LDB module - not really a change but a nicer method to call "talloc_reference" 2010-03-16 15:01:45 +01:00
Matthias Dieter Wallnöfer
d7de3fa799 s4:dsdb - fix up warnings 2010-03-16 09:50:39 +01:00
Andrew Bartlett
e3cb626c61 s4:dsdb Show more detail in failure to compute the aggregate DN.
Andrew Bartlett
2010-03-16 19:26:09 +11:00
Andrew Bartlett
2de07761e0 s4:dsdb Change dsdb_get_schema() callers to use new talloc argument
This choses an appropriate talloc context to attach the schema too,
long enough lived to ensure it does not go away before the operation
compleates.

Andrew Bartlett
2010-03-16 19:26:03 +11:00
Andrew Bartlett
bf0b4d7ee3 s4:dsdb Fix warnings in DEBUG() by casting to unsigned long int 2010-03-16 19:26:02 +11:00
Andrew Bartlett
a7ec946ced s4:dsdb/acl Reduce calls to dsdb_get_schema() and add memory context
dsdb_get_schema() isn't a very cheap call, due to the use of LDB
opaque pointers.  We need to call it less, and instead pass it as a
parameter where possible.

This also changes to the new API with a talloc context.

Andrew Bartlett
2010-03-16 19:25:55 +11:00
Andrew Bartlett
1e6fee4185 s4:dsdb Add a memory context for dsdb_get_schema()
When specified, we talloc_reference onto this context to ensure that
pointers found in it are valid for the life of the objects they are
placed into.  (Such as the string form of LDAP attributes).

Andrew Bartlett
2010-03-16 19:25:14 +11:00
Andrew Bartlett
c874b9f42e s4:dsdb Don't error out if we can't get the Aggregate schema DN yet
It's easier to just set it up when we can, then to deal with the
ordering issues in ldb startup.  As long as we have it ready if a real
client ever asks for it, then we should be happy.

Andrew Bartlett
2010-03-16 19:25:14 +11:00
Matthias Dieter Wallnöfer
559575fe40 s4:dsdb/kcc/*.c - fix up wrong typed counters 2010-03-16 08:49:22 +01:00
Erick Nogueira do Nascimento
81932f9148 s4-drs: DsGetReplInfo(), infoType = DS_REPL_INFO_METADATA_2_FOR_OBJ
Implementation of the DS_REPL_INFO_METADATA_2_FOR_OBJ infoType for DsGetReplInfo()

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-03-16 13:31:08 +11:00
Matthias Dieter Wallnöfer
b3f727e6a5 s4:util.c - "dsdb_check_optional_feature" - counter should be "unsigned" 2010-03-12 18:56:44 +01:00
Stefan Metzmacher
77fb700e20 s4:dsdb/repl: make use of use tevent_req based dcerpc_binding_handle stubs
metze
2010-03-12 15:25:41 +01:00
Crístian Deives
a0527dd790 use unsigned instead of uint32_t for LDB counters.
the attribute num_values of the struct ldb_message_element is defined as
an unsigned int, so the counters of that variable should be of the same
type.
2010-03-12 16:31:20 +11:00
Crístian Deives
208e2801b4 nTDSConnection creation
create nTDSConnection objects to "imply" the minimum-cost spanning tree edges
for which no nTDSConnection objects yet exist. it also adds a test function in
kcc_connection so the kcctpl functions can be called. this patch is in accord
with the sections [MS-ADTS] 7.2.2.3.4.2 and 7.2.2.3.4.5.
2010-03-12 16:31:20 +11:00
Crístian Deives
6e20906f42 spanning tree computation
calculate the spanning tree for the intersite connection. this patch is in
accord with the section [MS-ADTS] 7.2.2.3.4.4.
2010-03-12 16:31:20 +11:00
Crístian Deives
b70df94f62 new function kcctpl_color_vertices
besides the new function implemented, some minor bugs were also fixed.  this
patch is in accord with the section [MS-ADTS] 7.2.2.3.4.3.
2010-03-12 16:31:20 +11:00
Eduardo Lima
7b20ad99d6 s4-drs: check if an optional feature is enabled 2010-03-12 16:31:20 +11:00
Nadezhda Ivanova
be79f572ed Split the dsdb_access_check_on_dn.
Split the dsdb_access_check_on_dn so it can be reused for checks
from both within the module stack and outside it.
2010-03-12 03:13:51 +02:00
Nadezhda Ivanova
4b256c6d8e Fixed ACL module to use dsdb_module_* API. 2010-03-12 02:21:16 +02:00
Nadezhda Ivanova
222b955237 Moved access_check_on_dn from acl module as an utility.
Made this an utility function so it can be used for access checking
outside of the acl ldb module, such as checking validated writes and
control access rights in other protocols (e. g drs)
2010-03-12 00:20:15 +02:00
Kamen Mazdrashki
9f21787131 s4/drs: DsGetNCChanges - Propagating IDL changes to source code
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2010-03-10 17:11:57 +01:00
Nadezhda Ivanova
deebbe7cfa A helper function to get the Infrastructure DN. 2010-03-09 14:56:46 +02:00
Nadezhda Ivanova
f742623b7b Added a check for permissions to modify the RDN attribute on rename.
Necessary because rdn module will be moved lower than acl in the stack.
2010-03-09 13:07:18 +02:00
Stefan Metzmacher
ec53a0ca5a s4:dsdb/dns: change callers of samba_runcmd()
metze
2010-03-09 21:49:45 +11:00
Matthias Dieter Wallnöfer
85598be1f9 s4:extended_dn_out LDB module - change counter variables to "unsigned" where appropriate 2010-03-07 20:18:10 +01:00
Matthias Dieter Wallnöfer
632adf7328 s4:repl_meta_data LDB module - change counter variables to "unsigned" where appropriate
I used "unsigned int" counters where we count LDB objects (LDB specification
prescribes to use "unsigned" index variables).
But on DSDB replication object counters I used "uint32_t" typed variables as it
is suggested.
If a counter variable counts both types of objects I used "unsigned int" since
size(unsigned int) >= size(uint32_t), but on most platforms equal.
2010-03-07 20:18:10 +01:00
Matthias Dieter Wallnöfer
3bb3667b43 s4:local_password LDB module - change counter variables to "unsigned" where appropriate 2010-03-07 20:18:10 +01:00
Matthias Dieter Wallnöfer
6997185e36 s4:ranged_results LDB module - change counter variables to "unsigned" where appropriate 2010-03-07 19:20:05 +01:00
Matthias Dieter Wallnöfer
a973d9eedb s4:objectguid LDB module - change counter variables to "unsigned" where appropriate 2010-03-07 19:20:04 +01:00
Matthias Dieter Wallnöfer
cd43dd04af s4:objectclass LDB module - change counter variabls to "unsigned" where appropriate 2010-03-07 19:20:03 +01:00
Matthias Dieter Wallnöfer
2932df57ae s4:anr LDB module - change counter variable to "unsigned" 2010-03-07 19:20:03 +01:00
Matthias Dieter Wallnöfer
77e1497a7b s4:acl LDB module - change counter variable to "unsigned" 2010-03-07 19:20:02 +01:00
Matthias Dieter Wallnöfer
f9f7199250 s4:linked_attributes LDB module - change counter variables to "unsigned" where appropriate 2010-03-07 19:20:01 +01:00
Matthias Dieter Wallnöfer
049f9d3c1a s4:kludge_acl LDB module - change counter variables to "unsigned" where appropriate 2010-03-07 19:19:50 +01:00
Matthias Dieter Wallnöfer
4ad912d2da s4:proxy LDB module - Change counter variables to "unsigned" where appropriate
Use "size_t" when counting string index positions.
2010-03-07 19:19:26 +01:00
Matthias Dieter Wallnöfer
90e236544f s4:schema_data LDB module - change counter variables to "unsigned" where appropriate 2010-03-07 19:12:30 +01:00
Matthias Dieter Wallnöfer
ad7dd1cf71 s4:resolve_oids LDB module - change counter variables to "unsigned" where appropriate 2010-03-07 19:11:48 +01:00
Matthias Dieter Wallnöfer
b85b9b364f s4:rootdse LDB module - change counter variables to "unsigned" where appropriate 2010-03-07 19:11:03 +01:00
Matthias Dieter Wallnöfer
d1dd0a560c s4:partition LDB module - change counter variables to "unsigned" where appropriate 2010-03-07 19:10:00 +01:00
Matthias Dieter Wallnöfer
5a54b204c3 s4:schema - Change also here counters to "unsigned" where needed
Counters which are used in the way  "for (i = 0; array[i] != NULL; i++)" I
modified to "unsigned" since for sure we don't want to have negative array
indexes there.
2010-03-07 19:01:15 +01:00
Matthias Dieter Wallnöfer
bd5f08f3d1 s4:schema_syntax.c - Change also here counters to "unsigned" where needed
Counters which are used in the way  "for (i = 0; array[i] != NULL; i++)" I
modified to "unsigned" since for sure we don't want to have negative array
indexes there.

There were many counter variables typed "uint32_t". This isn't fully correct
since those count LDB objects. The amount is saved in a "num_*" variable which
is "unsigned" without a bitlength specification. Therefore change also these
counters to be plain "unsigned".
2010-03-07 19:00:32 +01:00
Matthias Dieter Wallnöfer
61ae4be256 s4:dsdb/util - Change also here counters to "unsigned"
No need to have "signed" counters at those places.
2010-03-05 18:30:08 +01:00
Matthias Dieter Wallnöfer
3ec4c643a4 s4:repl - change also here the counter variables to "unsigned"
I changed also some "uint32_t" to "unsigned" since the LDB interface doesn't
specify the bitlength of the unsigned type.
2010-03-05 18:28:35 +01:00
Matthias Dieter Wallnöfer
6f11818923 s4:kcc - Change some counter variables to be unsigned
The upper limits are unsigned variables therefore also the counter variables
need to be like that.
2010-03-05 13:38:01 +01:00
Matthias Dieter Wallnöfer
82c2448573 s4:samdb_privilege.c - Change two counter variables to unsigned
Also here in both cases the unsigned counter fits better than the signed one.
2010-03-05 13:38:00 +01:00
Matthias Dieter Wallnöfer
c695ce729b s4:cracknames - Change two counter variables to unsigned
In both cases the unsigned counter fits better:
- in the first one since we are counting LDB objects starting from 0
- in the second since we are counting an array starting from 0
2010-03-05 13:38:00 +01:00
Matthias Dieter Wallnöfer
8297302e98 s4:operational LDB - don't accidentally "ate" search helper attributes if we need them for more constructed attributes
With this patch we delete the helper attributes at the end where all constructed
attributes have already been computed.
2010-03-04 18:16:24 +01:00
Matthias Dieter Wallnöfer
ffa03820f1 s4:operational LDB module - make the counters unsigned
No need to have signed counters here.
2010-03-04 18:16:23 +01:00
Matthias Dieter Wallnöfer
bf94d68df8 s4:operational LDB - implement the "tokenGroups" constructed attribute
It contains the transitive SID closure (expand member/memberOf attributes) of a
certain SAM object. The "tokenGroups" attribute never contains the SID of the
object itself.

References: http://msdn.microsoft.com/en-us/library/ms680275(VS.85).aspx,
http://support.microsoft.com/kb/301916,
MS-ADTS 3.1.1.4.5.19.
2010-03-04 18:16:23 +01:00
Matthias Dieter Wallnöfer
e34ee26169 s4:operational LDB module - use right memory context int "construct_primary_group_token"
Use the "msg" as temporary context and not "ldb" which lives much longer.
2010-03-04 18:16:21 +01:00
Matthias Dieter Wallnöfer
fd00867e85 s4:samdb.c - Make it signed-safe
Use an unsigned argument for the numbers of groups and the counter "i" since
the function is called only by "auth_generate_session_info" with an unsigned
number of groups argument.
2010-03-03 20:15:25 +01:00
Stefan Metzmacher
0547af244a s4:drepl_out_helpers: don't look at the internals of 'struct rpc_request'
metze
2010-03-01 16:11:56 +01:00
Stefan Metzmacher
1955cde46c s4:drepl_notify: don't look at the internals of 'struct rpc_request'
metze
2010-03-01 16:11:56 +01:00
Stefan Metzmacher
c4e72add67 s4:dsdb/repl: make use of explicit dcerpc_*_recv functions
metze
2010-03-01 16:11:54 +01:00
Anatoliy Atanasov
b73437fbaa s4/rodc: Implement samdb_rodc with ldb context 2010-03-01 14:17:32 +02:00
Stefan Metzmacher
4bad696f9e s4:dsdb/schema: fix validation of DNs
ldb_dn_extended_filter() removes all but the listed components,
I didn't noticed that when writting the code.
Doing a ldb_dn_remove_extended_components(dn2) is wrong.

This was hidden by some bugs in the ldb_dn code.

metze
2010-02-26 23:26:32 +01:00
Andrew Tridgell
b0b857d6ca s4-dns: use a loadparm list for samba_runcmd() commands
This allows commands with multiple arguments and quoting to be used,
while still avoiding running a shell (and this having shell expansion
problems)
2010-02-26 18:19:27 +11:00
Andrew Tridgell
64911507a0 s4-dsdb: fixed the fetch of the server site name
when the ntds objects were moved by a recent change it broke the
calculation of the server site

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-02-26 13:22:12 +11:00
Matthias Dieter Wallnöfer
fc4c839bc8 s4:DNS update - change "i" to be unsigned
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-02-25 08:17:12 +11:00
Matthias Dieter Wallnöfer
0be57c7478 s4:partition DSDB module - Generate basic referrals
This is a first, very basic implementation of the referrals (more informations
at MS-ADTS 3.1.1.4.6 and 3.1.1.3.4.1.12).

To have the full referral support (and to always point to the right host) the
full implementation using DNS will be needed (at the moment we always point to
the main DC which is referenceable through the DNS domainname).

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-02-25 08:17:06 +11:00
Matthias Dieter Wallnöfer
cd5b542878 s4:partition DSDB module - change the search and domain scope control handling
The domain scope control is always removed, from the search one only the two
interesting flags (which are handled) and it is marked as non-critical.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-02-25 08:17:00 +11:00
Matthias Dieter Wallnöfer
0efa8f4fbb s4:SAMLDB module - ignore referrals
They don't cause any harm to our functionality - so ignore them were not needed.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-02-25 08:16:46 +11:00
Matthieu Patou
00aeca7d7f dsdb: Add a more explicit error message for constructed attributes
Signed-off-by: Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
2010-02-24 14:50:30 +01:00
Kamen Mazdrashki
30ac3caade s4/drs: Propagate drsuapi_DsReplicaGetInfoRequest... changes into source code 2010-02-24 14:14:08 +02:00
Kamen Mazdrashki
99db858b15 s4/drs: Propagate drsuapi_DsReplicaSync changes in source base 2010-02-24 14:14:07 +02:00
Kamen Mazdrashki
fffdce62fc s4/schema: Move msDS-IntId implementation to samldb.c module
msDS-IntId attribute should be replicated, so it must be
implemented in a module that is before repl_meta_data module
(thanks abartlet for pointing this out).

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-02-24 12:01:51 +11:00
Andrew Tridgell
7593b6d03b s4-dns: improved logging, and run name check at startup 2010-02-23 13:48:21 +01:00
Andrew Tridgell
61af327e5d s4-dns: call out to the dns update command every 10 minutes
This periodically calls samba_dnsupdate to update our DNS entries if
needed
2010-02-23 13:48:20 +01:00
Matthias Dieter Wallnöfer
280a8a70fd s4:operational LDB module - enable support for passing referrals through it 2010-02-21 21:44:39 +01:00
Matthias Dieter Wallnöfer
c16d4fb76d s4:partition DSDB module - Cosmetic fixups 2010-02-21 21:44:24 +01:00
Matthias Dieter Wallnöfer
461987bc26 s4:password_hash - Fix up request message pointers
For add requests we need the add request messages, for modify requests we need
the modify request messages.
2010-02-21 21:43:48 +01:00